View previous topic :: View next topic
|
Author |
Message |
Celia Barossi
New User
Joined: 28 Nov 2005 Posts: 1
|
|
|
|
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.
--PGM
Code: |
LINKAGE SECTION.
01 WE000-LINKAGE PIC X(00020).
01 WE000-LINKAGE-R REDEFINES WE000-LINKAGE.
05 WE000-INPUT-PARMS.
10 WE000-ANO PIC X(00004).
10 WE000-TMA PIC X(00004).
10 WE000-IMC PIC X(00003).
05 WE000-OUTPUT-PARMS.
10 WE000-MESSAGENO PIC X(00006).
10 FILLER PIC X(00003).
|
-- CLIST
Code: |
WRITE ### CHAMADA DO SUBPGM ###
DSN SYSTEM(DB2B)
RUN PROGRAM(WE000C00) LIB('AXG.LOAD') +
PARMS('2005ABC WWWAAAAAAFFF')
END
WRITE ### RETORNO DO SUBPGM ###
END
|
-- CLIST EXECUTION
### CHAMADA DO SUBPGM ###
DSN SYSTEM(DB2B)
RUN PROGRAM(WE000C00) LIB('AXG.LOAD') PARMS('2005ABC WWWAAAAAAFFF')
***--- VOU INICIALIZAR O PROGRAMA ---***
:20 / 05AB / C W
**ERRO***
**WE000-MESSAGENO 999993
### RETORNO DO SUBPGM ###
END
***
|
|
Back to top |
|
|
John_Deal
New User
Joined: 28 Nov 2005 Posts: 4 Location: Montgomery, AL, USA
|
|
|
|
You forgot the 4 bytes that are used for the LENGTH of the linkage section... Try adding 4 bytes to the front of your linkage section...
|
|
Back to top |
|
|
DavidatK
Active Member
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
Quote: |
Specify run-time options in the PARM parameter of the EXEC statement that
starts execution. Code the PARM parameter as follows:
PARM='[user-parameter][/execution-options]'
user-parameter
Parameter to be passed to the VS COBOL II program being executed.
This parameter is then accessed by a USING phrase in your application
program.
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:
LINKAGE SECTION.
01 PARMDATA.
05 STRINGLEN PIC 999 USAGE COMP.
05 STRINGPARM PIC X(6).
PROCEDURE DIVISION USING PARMDATA.
IF STRINGLEN > 0 . . .
|
|
|
Back to top |
|
|
|