Modify FOO to translate the parm by replacing a designated character (such as
\) with a quote. You can then code the proc invocation as
//MYSTEP EXEC BAR,STRING='The value is \3.14\'
and code the jobstep as
//STEP1 EXEC PGM=FOO,PARM='&STRING'
Your translate table is simply
TBL DC 256AL1(*-TBL)
ORG TBL+C'\'
DC CL1' '
ORG
and the translation is performed with a single TR.
Alternately, instead of coding the parameter in the proc invocation using
STRING, use
//MYSTEP EXEC BAR,PARM.STEP1='The value is ''3.14'''
and only use the "normal" double quotes instead of quadruple ones.
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of
Charles Mills
Sent: Monday, September 13, 2010 12:58 PM
To: [email protected]
Subject: Another brain-dead quoted PROC parm question
I've got a program FOO that requires a string with embedded blanks as a
parm, e.g.
//STEP1 EXEC PGM=FOO,PARM='Hello World'
I'd like to be able to set up a proc BAR that would take a parm STRING= and
pass it to FOO as the PARM=, e.g.
//BAR PROC STRING='the string'
//STEP1 EXEC PGM=FOO,PARM=&STRING
If I do it that way, then it fails for lack of quotes around &STRING.
If I code it as PARM='&STRING', then if the user wants to pass in a string
with quotes in it, he needs quadruple quotes, e.g.
//MYSTEP EXEC BAR,STRING='The value is ''''3.14'''''
which I find fairly ridiculous and non-intuitive and error-prone. Is there
some trick to being able to have a PROC parm that is quoted but does not
need quadruple quotes? I tried the trick setting &Q to '''' and using that
instead of a literal quote and also a null parameter &X to fool JCL but
couldn't get those to work either.
----------------------------------------------------------------------
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