On Mon, 27 Dec 2010 15:21:48 -0500, zMan wrote:

>On Mon, Dec 27, 2010 at 2:57 PM, John Mattson wrote:
>> This little REXX snippet does just fine with most TSO commands including
>> those with data sets in single quotes.
>>
>> /* REXX */
>> arg cmd
>> ADDRESS "TSO"
>> pq=pos("'",cmd); do while pq>0
>>  cmd=insert("''",cmd,pq)
>>  pq=pos("'",cmd,pq+3); end
>> interpret "'"cmd"'"
>>
>> BUT !!! it goes crazy when you try to use it with "*" and/or "**" .  Wants
>> to treat the "*" as arithmetic operators.  Makes something like LISTDSD
>> DA('SYS1.**') AUTH fail every time.  Any suggestions on how to get this to
>> just treat the "*" as a String?
>>
>>    15 +++  'LISTDSD DA('''SYS1.**''')'
>>    15 +++ interpret "'"cmd"'"
>> IRX0026I Error running TR$, line 15: Invalid whole number
>
>Why are you using INTERPRET here? I can't hardly read it due to the
>quotes-within-quotes, so maybe it would be obvious in another font,
>but it seems like that's the key question. If you just want it to
>execute the command, remove the INTERPRET.
>
Yup.  But then he'd also need to remove the superfluous code
that attempts to double apostrophes.

It's easy to surmise that the OP was confronted by a coding
problem, and in the erroneous belief that INTERPRET solves all
problems (it doesn't, and often when it does it's still a
poor choice), mixed in an INTERPRET, eye of newt, and hair
of bat.  When that didn't work, he asked the list for help
with a problem largely of his own creation.  I wonder why
he didn't retreat and ask for help with the original problem.

A common slogan on mechanics' vans is "Fix it yourself, then
bring it to us!"

-- gil

----------------------------------------------------------------------
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