File tailoring with single and double quotes
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: File tailoring with single and double quotes Author: misi01Location: Stockholm, Sweden PostPosted: Fri Aug 13, 2021 3:03 am
    —
I have a workaround for this, but I'm wondering if they solution I have is the only way to go.

I'm generating program JCL using Rexx and File Tailoring. One tricky line I need to include looks like this in the skeleton
Code:

)SEL &CONTIN = Y                                                   
 RUN PROGRAM(&PROGRAM) PLAN(&DB2PLAN) -                             
)CM It seems to be impossible to file tailor with a combination of 
)CM single and double quotes on the same line (maybe it IS possible,
)CM but it's easier to include special characters for the " and then
)CM run a simple edit CHA command to get the results I want)       
 PARM('/TEST(ALL,"*",PROMPT,"MFI%ICA300??:INSPPREF")')             
)ENDSEL                                                             
)SEL &CONTIN NE Y                                                   
 RUN PROGRAM(&PROGRAM) PLAN(&DB2PLAN)                               
)ENDSEL                                                             

In the example above, the line starting with PARM is the one causing the problem and the problem seems to be the double quotes.
When I run my script, the line containining
Code:

 RUN PROGRAM(&PROGRAM) PLAN(&DB2PLAN) - 

is changed nicely to
Quote:

RUN PROGRAM(IRI507) PLAN(BATCHCD) -

but all lines (20 or so starting with the PARM line) after that are not generated in the resulting JCL file. If I define the line as
Code:

 PARM('/TEST(ALL,§*§,PROMPT,§MFI%ICA300??:INSPPREF§)')   

instead, then all the lines are generated (I let my script then do a change '§' '"' all after the JCL has been generated).
I have tried running ISPFTTRC, but that, strangely seems to resolve everything okay. (In the example below, I tried defining a variable in my script called Q that contained a double quote, but still all lines starting with PARM were never generated/shown)
Quote:

)SEL &CONTIN = Y
)SEL Y = Y
RUN PROGRAM(&PROGRAM) PLAN(&DB2PLAN) -
RUN PROGRAM(IRI507) PLAN(BATCHCD) -
)CM It seems to be impossible to file tailor with a combination of
)CM single and double quotes on the same line (maybe it IS possible,
)CM but it's easier to include special characters for the " and then
)CM run a simple edit CHA command to get the results I want)
PARM('/TEST(ALL,&Q*&Q,PROMPT,&QMFI%ICA300??:INSPPREF&Q)')
PARM('/TEST(ALL,"*",PROMPT,%ICA300??:INSPPREF")')
)ENDSEL
)ENDSEL

I've tried defining the double quotes as "double" double quotes so the line would look like this
Code:

 PARM('/TEST(ALL,""*"",PROMPT,""MFI%ICA300??:INSPPREF"")')   

with the same results and now I've run out of ideas.
Do I have to use something like a § and then change it using the ISREDIT change command (not a big deal at all), or is there some "cleaner" way round the problem?

#2:  Author: kolusuLocation: San Jose PostPosted: Fri Aug 13, 2021 12:17 pm
    —
Did you try this approach of concatenation ?

Code:

/* rexx */                       
SAY "PARM('/TEST(ALL,"       ||, 
    '"'                      ||, 
    '*'                      ||, 
    '"'                      ||, 
    ',PROMPT,'               ||, 
    '"'                      ||, 
    'MFI%ICA300??:INSPPREF'  ||, 
    '"'                      ||, 
    ")')"                         


results in

Code:

 PARM('/TEST(ALL,"*",PROMPT,"MFI%ICA300??:INSPPREF")')

#3:  Author: misi01Location: Stockholm, Sweden PostPosted: Mon Aug 16, 2021 1:33 am
    —
Slight misunderstanding here. It's not a problem of me defining the combination of single/double quotes in a Rexx variable that is the problem.
It's getting the FTINCL to recognize this combination.
I'll include 2 variations again. First, with the combination of s/d quotes in the variable. Note I changed the string in the skeleton to use the variable DEBPARM instead of the original s/d quote combination.

Here's the debparm variable content in the rexx script (with surounding *)
Quote:
Line 153 debparm *PARM('/TEST(ALL,"*",PROMPT,"MFI%ICA300??:INSPPREF")')'*


Here is the (partial) generated JCL. Note how it "gives up" with the PARM line and all JCL lines after it.
Quote:
//IRI507 EXEC PGM=IKJEFT1B,DYNAMNBR=100
//*
//SYSTSIN DD *
DSN SYSTEM(DB2C)
RUN PROGRAM(IRI507) PLAN(BATCHCD) -
**************************** Bottom of Data **********


The results from ISPFTTRC
Quote:
19 1 1 )CM run a simple edit CHA
20 1 1 &DEBPARM
24 1 1 0 PARM('/TEST(ALL,"*",PROMP
21 1 1 )ENDSEL
21 1 0 )ENDSEL
22 1 )SEL &CONTIN NE Y
24 1 0 )ENDSEL
25 1 END
25 1 0 END
26 1 //*
26 1 0 //*
27 1 &STPLIB1
27 1 0 //STEPLIB DD DISP=SHR,DS
28 1 &STPLIB2
28 1 0 // DD DISP=SHR,DS
29 1 &STPLIB3
29 1 0 // DD DISP=SHR,DS
30 1 &STPLIB4
30 1 0 // DD DISP=SHR,DS
31 1 &STPLIB5
31 1 0 // DD DISP=SHR,DS

0 FTCLOSE
-------------------------- Total Records=59 <------- Note the 59 records that weren't generated


Now, using a § placeholder for the double quotes

Here's the debparm variable content in the rexx script (note the § character instead of dq)
Quote:
Line 153 debparm *PARM('/TEST(ALL,§*§,PROMPT,§MFI%ICA300??:INSPPREF§)')'*


Here is the resulting generated JCL (after including a simple ISREDIT 'change § to " all' in the rexx script)
Quote:
//IRI507 EXEC PGM=IKJEFT1B,DYNAMNBR=100
//*
//SYSTSIN DD *
DSN SYSTEM(DB2C)
RUN PROGRAM(IRI507) PLAN(BATCHCD) -
PARM('/TEST(ALL,"*",PROMPT,"MFI%ICA300??:INSPPREF")')'
END
//*



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group