I've run into an oddity when passing an EXEC PARM to a COBOL program. I don't see anything in the JCL reference that seems to directly address this, but I'm wondering if I'm missing something. This is on a z/OS 1.4 system.

Basically, it seems that if the last character of the EXEC PARM string is a forward slash, that character is stripped from the PARM value before the parameter string is passed to my COBOL program. I can get a trailing forward slash passed to the COBOL program by coding two trailing slashes in the PARM= value, but the only mention I see in the JCL reference of a need to "double up" on characters in the PARM= string is for ampersands and apostrophes. Embedded forward slashes are passed as expected; only the final trailing slash is stripped from the parameter string value (so there's no need to "double up" on every forward slash, just the last one).

Can anyone cite documentation for this behavior?

Here are some examples of parameter values I've passed as EXEC PARMs and the parameter lengths and values recognized by the COBOL program:

==========

Single trailing Back Slash works as expected...

//PS020  EXEC PGM=GPDIRLNK,PARM='S:\Technical Documentation\'

COBOL Display of PARM length & value received:

****
*--> EXEC PARM LENGTH (00027)
*-->           VALUE  (S:\Technical Documentation\)
****

==========

Multiple Back Slashes work as expected...

//PS020  EXEC PGM=GPDIRLNK,PARM='S:\Technical Documentation\\\'

COBOL Display of PARM length & value received:

****
*--> EXEC PARM LENGTH (00029)
*-->           VALUE  (S:\Technical Documentation\\\)
****

==========

Single trailing Forward Slash is unexpectedly stripped from parm string...

//PS020  EXEC PGM=GPDIRLNK,PARM='S:/Technical Documentation/'

COBOL Display of PARM length & value received:

****
*--> EXEC PARM LENGTH (00026)
*-->           VALUE  (S:/Technical Documentation)
****

==========

Multiple trailing Forward Slashes always have final slash stripped...

//PS020  EXEC PGM=GPDIRLNK,PARM='S:/Technical Documentation///'

COBOL Display of PARM length & value received:

****
*--> EXEC PARM LENGTH (00028)
*-->           VALUE  (S:/Technical Documentation//)
****

==========

I can "double up" on the trailing Forward Slash as a work around to get what I need in the COBOL program, but I'm surprised by this behavior. Should I be?

Thanks!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to