I need to verify that is necessary to insert on program Cobol at linkage section any characters of control, before my parameters.
I'm trying to call a program with parameters by clist, and I saw that parameters are wrong, when it are displayed.
WRITE ### CHAMADA DO SUBPGM ###
RUN PROGRAM(WE000C00) LIB('AXG.LOAD') +
WRITE ### RETORNO DO SUBPGM ###
-- CLIST EXECUTION
### CHAMADA DO SUBPGM ###
RUN PROGRAM(WE000C00) LIB('AXG.LOAD') PARMS('2005ABC WWWAAAAAAFFF')
***--- VOU INICIALIZAR O PROGRAMA ---***
:20 / 05AB / C W
### RETORNO DO SUBPGM ###
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
The Length of the string is two bytes, not four. Define as PIC 999 COMP
From the COBOL Reference
Specify run-time options in the PARM parameter of the EXEC statement that
starts execution. Code the PARM parameter as follows:
Parameter to be passed to the VS COBOL II program being executed.
This parameter is then accessed by a USING phrase in your application
If the user-parameter in the list contains a slash, add a trailing
slash. All data following this second slash is considered to be COBOL
run-time options. The last slash and the data following it are passed
to the program when the data following the last slash does not contain
any valid COBOL run-time options. In this case, the entire PARM
parameter is passed to the program and the COBOL run-time message
IGZ019I is sent. If there are no run-time options, failure to add the
trailing slash will cause the user-parameter data to the right of the
last slash to be treated (erroneously) as run-time options.
The Linkage Section record (level-01) that is to receive the
user-parameter data passed by the PARM string must be defined, taking
into account the halfword length field inserted in front of the string
by the system.
The program can test this field length for nonzero, to verify that
PARM-string data has in fact been passed. For example: