0

I'm trying to copy the value of LINE.I to variable THIS_IS_A_COMMENT2 so I can use it my JCL.

The JCLs are properly generated and executed, but the line QUEUE "//* THIS IS A COMMENT2 : " THIS_IS_A_COMMENT2 is completely ignored.

The SAY "VALUE OF LINE.I : " LINE.I works just fine, I can't figure out to copy the value of LINE.I to a simple variable.

THIS_IS_A_COMMENT  = "HELLO"
THIS_IS_A_COMMENT2 = ""

DO I = 1 TO LINE.0
    SAY "VALUE OF LINE.I : " LINE.I

    THIS_IS_A_COMMENT2 = LINE.I

    QUEUE "//USERIDK JOB 0000,'HELLO',"
    QUEUE "//            CLASS=T,"
    QUEUE "//            MSGCLASS=X,"
    QUEUE "//            MSGLEVEL=(1,1),"
    QUEUE "//            USER=USERID,"
    QUEUE "//            PASSWORD="
    QUEUE "//* THIS IS A COMMENT  : " THIS_IS_A_COMMENT
    QUEUE "//* THIS IS A COMMENT2 : " THIS_IS_A_COMMENT2
    QUEUE "//STEP1 EXEC PGM=IEFBR14"
    QUEUE "//DD1 DD DUMMY"
    QUEUE "/*"
    QUEUE "$$"
    O = OUTTRAP("OUTPUT.",,"CONCAT")
    "SUBMIT * END($$)"
    O = OUTTRAP(OFF)
END

I use the following jcl to submit my rexx code:

//JCLSAYHI JOB 00000,'SAY HI',
//             CLASS=T,
//             MSGCLASS=X,
//             MSGLEVEL=(1,1),
// USER=MYUSER,PASSWORD=
/*JOBPARM R=H101,T=999,L=9999,S=ANY
//*----------------------------------------------
//STEPREXX EXEC PGM=IKJEFT01,PARM='SAYHI3'
//SYSEXEC  DD DISP=SHR,DSN=MYUSER.REXX
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD DUMMY
//MYDATA   DD DISP=SHR,DSN=MYUSER.REXX.DATASET

The SYSEXEC executes the code above, and the MYUSER.REXX.DATASET dataset contains:

********************************* Top of Data ******
HELLO1
HELLO2
HELLO3
HELLO4
HELLO5
******************************** Bottom of Data ****

TRACE results

Found the problem (REXX doesn't add double quotes at the end of the THIS IS A COMMENT2 line, so the line is ignored in the generated JCL). Just not sure how to fix that:

27 *-*  QUEUE "//* THIS IS A COMMENT  : " THIS_IS_A_COMMENT
    >>> "//* THIS IS A COMMENT  :  HELLO"
28 *-*  QUEUE "//* THIS IS A COMMENT2 : " THIS_IS_A_COMMENT2 ""
    >>> "//* THIS IS A COMMENT2 :  HELLO1     <--- DOUBLE QUOTE MISSING AT THE END HERE
user3489502
  • 3,451
  • 9
  • 38
  • 66
  • This looks perfectly valid, with the assumption that the stem LINE. has info in it and LINE.0 has the number of entries. In, fact, I just ran this with a couple of minor mods for the JOB information and initializations for LINE.1 & LINE.2, with LINE.0 = 2. Something else is then wrong in your environment. Please put a TRACE ?I in front of the DO, comment out the OUTTRAPs, and walk through the loop. BTW, the text of the first SAY is misleading. – zarchasmpgmr Oct 26 '15 at 21:19
  • Super, thanks @zarchasmpgmr ! The TRACE helped me find the problem (Rexx didn't generate a double quote on that line). Just not sure how to fix that. See code above. – user3489502 Oct 30 '15 at 17:40

0 Answers0