X"91" call outs do not seem to work in managed code under visual studio

[Migrated content. Thread originally posted on 08 May 2012]

Have a problem with x"91" call outs in managed code.

Code reads as...

01 command-lin-string pic x(80) value "dir/w".

01 RESULT PIC X COMP-X.
01 FUNC PIC X COMP-X VALUE 35.
01 COMMAND-LIN.
03 COMMAND-LIN-LENGTH PIC X COMP-X VALUE 0.
:
:
DISPLAY COMMAND-LIN-STRING UPON COMMAND-LINE.
CALL x"91" USING RESULT, FUNC, COMMAND-LIN.
IF RESULT = 0
MOVE "01" to lnk-error-status
END-IF.

No DOS box appears showing a directory listing (as it does in UNMANAGED code) but RESULT comes back as 0!


Managed code as defined by Application (program) output as Class library under .Net Framework 4.0
Parents
  • Apparently x"91" call outs don't work in managed code.

    Must write as...

    Working-Storage Section.
    01 command-linex pic x(256) value spaces.
    01 command-line-len pic x(4) comp-5.
    01 run-unit-id pic x(8) comp-5.
    01 stack-size pic x(4) comp-5.
    01 flags pic x(4) comp-5.
    01 status-codex pic x(2) comp-5.

    Procedure Division.

    * DISPLAY COMMAND-LIN-STRING UPON COMMAND-LINE.
    * CALL x"91" USING RESULT, FUNC, COMMAND-LIN.

    String "wzzip -yp " delimited by size
    Backrest-FileName delimited by size
    " dip*.*" delimited by size
    into Command-Linex.

    move length of Command-Linex to command-line-len.
    move 5 to flags

    call "CBL_EXEC_RUN_UNIT" using command-linex
    by value command-line-len
    by reference run-unit-id
    by value stack-size
    by value flags
    returning status-codex.

    BF200.
    IF STATUS-CODEX = 0
    * IF RESULT = 0
    MOVE "01" to lnk-error-status

    One for the knowledge base methinks!!
Reply
  • Apparently x"91" call outs don't work in managed code.

    Must write as...

    Working-Storage Section.
    01 command-linex pic x(256) value spaces.
    01 command-line-len pic x(4) comp-5.
    01 run-unit-id pic x(8) comp-5.
    01 stack-size pic x(4) comp-5.
    01 flags pic x(4) comp-5.
    01 status-codex pic x(2) comp-5.

    Procedure Division.

    * DISPLAY COMMAND-LIN-STRING UPON COMMAND-LINE.
    * CALL x"91" USING RESULT, FUNC, COMMAND-LIN.

    String "wzzip -yp " delimited by size
    Backrest-FileName delimited by size
    " dip*.*" delimited by size
    into Command-Linex.

    move length of Command-Linex to command-line-len.
    move 5 to flags

    call "CBL_EXEC_RUN_UNIT" using command-linex
    by value command-line-len
    by reference run-unit-id
    by value stack-size
    by value flags
    returning status-codex.

    BF200.
    IF STATUS-CODEX = 0
    * IF RESULT = 0
    MOVE "01" to lnk-error-status

    One for the knowledge base methinks!!
Children
No Data