I am trying to give two parms in a proc step(mentioned as below), but it is considering only first parm and ignoring the second. Can anyone help me in what way I can use the two parms in the same step.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You will have to be much clearer. You know what you are saying, but we don't. We don't know what program you are executing, nor what you consider to be the first or second PARM. It all looks like one PARM to me, possibly two values seperated by space, and from what you describe maybe the space is the problem. Complete guess.
do not use the slashes for USER parms separation
unless You know exactly whatYou are doing
the behavior You complain about is not the one expected , but Yo might have described it poorly
if the program is not invoked directly by a jcl EXEC statement the behavior might be different ( db2 and ims might be doing their parameter mangling too )
for HLL a forward slash is e used to separate the sections for the user parms and the LE/HLL environment parms
anything after the LAST slash is passed to the HLL/LE environment processing
but if the HLL/LE data is not a proper parameter the whole string is passed to the program as parms
naturally all depends on how Your environment is setup
( if the COBOL and PL1 are setup not to accept overrides )
checked with a quick and dirty snippet
Code:
****** ***************************** Top of Data ******************************
000001 IDENTIFICATION DIVISION.
000002 PROGRAM-ID PARMS.
000003 AUTHOR. <SOME AUTHOR>
000004 ENVIRONMENT DIVISION.
000005 DATA DIVISION.
000006 WORKING-STORAGE SECTION.
000007 LINKAGE SECTION.
000008 01 ARGS.
000009 05 ARGL PIC S9(04) COMP.
000010 05 ARGV PIC X(100).
000011 PROCEDURE DIVISION USING ARGS .
000012 DISPLAY 'ARG LENGTH :' ARGL .
000013 IF ARGL > 0
000014 DISPLAY 'ARG VALUE :' ARGV .
000015 GOBACK.
****** **************************** Bottom of Data ****************************
forget about the ARGV content
what counts is the ARGL
tested with ...
Code:
****** ***************************** Top of Data ******************************
000001 //ENRICO1 JOB (ACCT#),'PARMS$',NOTIFY=ENRICO,
000002 // CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
000003 //*
000004 //PARMS EXEC PGM=PARMS,PARM='AAAA/BB/HEAP(32)'
000005 //STEPLIB DD DISP=SHR,DSN=ENRICO.TEST.LOAD
000006 //SYSPRINT DD SYSOUT=*
000007 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data ****************************
to receive
Code:
********************************* TOP OF DATA **********************************
ARG LENGTH :0007
ARG VALUE :AAAA/BB/HEAP(32)
******************************** BOTTOM OF DATA ********************************
as expected
but ...
Code:
****** ***************************** Top of Data ******************************
000001 //ENRICO1 JOB (ACCT#),'PARMS$',NOTIFY=ENRICO,
000002 // CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
000003 //*
000004 //PARMS EXEC PGM=PARMS,PARM='AAAA/GARBAGE'
000005 //STEPLIB DD DISP=SHR,DSN=ENRICO.TEST.LOAD
000006 //SYSPRINT DD SYSOUT=*
000007 //SYSOUT DD SYSOUT=*
****** **************************** Bottom of Data ****************************
gives
Code:
********************************* TOP OF DATA **********************************
CEE3608I The following messages pertain to the invocation command run-time optio
CEE3611I The run-time option GARBAGE was an invalid run-time option or is not su
Environment.
ARG LENGTH :0012
ARG VALUE :AAAA/GARBAGE
******************************** BOTTOM OF DATA ********************************
developing and running such simple snippets is the best way to understand how things work
it' a pity that nobody has the ingenuity of doing it