Yes to 1 and 2. All fixed:

    // if it begins with a single quote then have to remove and "un-double"
any quotes
    static const char quote = '\'';
    if ( command[0] == quote )
    {
        int to = 0;
        for ( unsigned int from = 1; from < strlen(command)-1; )
        {
            if ( command[from] == quote ) from++;

            command[to++] = command[from++]; 
        }

        command[to] = '\0';     // terminate it
    }

Charles

-----Original Message-----
From: Robert A. Rosenberg [mailto:[email protected]] 
Sent: Monday, May 26, 2014 8:15 PM
To: IBM Mainframe Discussion List
Cc: Charles Mills
Subject: Re: Passing lower case data on MODIFY

At 11:47 -0700 on 05/26/2014, Charles Mills wrote about Passing lower case
data on MODIFY:

>I don't see anything in the MODIFY or EXTRACT documentation (other than 
>information specific to System Rexx). (I'm sure someone will be happy 
>to point it out if I missed something <g>.) I'd like to confirm what I 
>am observing to make sure it is not some bug or mis-observation of my 
>own. It appears to me that
>
>F taskname,foo results in FOO being passed to the program.
>
>F taskname,'foo' results in 'foo' being passed to the program.
>
>Is there any way to just pass foo -- lower case, no quotes -- on a 
>MODIFY command? (I don't mind the quotes in the syntax; I can readily 
>live with that; it's the passing of the quotes into the program that is 
>currently fouling me up.)
>
>(Taskname is a z/OS started task.)

A couple of questions.

1) Will the passed parm have imbedded blanks or will it be a single string
of characters?

2) Can there be any imbedded quotes in the parm?

To fix #1, check if the first character is a quote. If so, then pass
starting from the second character and do not pass the last character (the
ending quote). So long as you pass a length, any imbedded blank should not
be an issue.

As to #2, after removing any bracketing quotes, you can either pass the
doubled single quotes or parse and rebuild the parm by converting the
doubled quotes to a single occurrence.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to