To test this out, I've created code to loop through my input, and then, generate and submit jobs.
The jobs get submitted properly, but they don't get generated properly when I display the values of LINE.I
This is the REXX code i'm using:
SAY 'START OF REXX CODE.'
"EXECIO * DISKR MYDATA (STEM LINE. FINIS"
THIS_IS_A_VALUE1 = "VALUE #1"
THIS_IS_A_VALUE2 = "VALUE #2"
TRACE 'R'
DO I = 1 TO LINE.0
PARSE VAR LINE.I
SAY "VALUE OF LINE.I : " LINE.I
THIS_IS_A_VALUE3 = LINE.I
QUEUE "//TESTA JOB 00000,'TEST',"
QUEUE "// CLASS=T,"
QUEUE "// MSGCLASS=X,"
QUEUE "// MSGLEVEL=(1,1),"
QUEUE "// USER=000000"
QUEUE "//* THIS IS A VALUE#1 : " THIS_IS_A_VALUE1
QUEUE "//* THIS IS A VALUE#2 : " THIS_IS_A_VALUE2
QUEUE "//* THIS IS A VALUE#3 : " THIS_IS_A_VALUE3
QUEUE "//STEP1 EXEC PGM=IEFBR14"
QUEUE "//DD1 DD DUMMY"
QUEUE "/*"
QUEUE "$$"
O = OUTTRAP("OUTPUT.",,"CONCAT")
"SUBMIT * END($$)"
O = OUTTRAP(OFF)
END
SAY 'END OF REXX CODE.'
"EXECIO * DISKR MYDATA (STEM LINE. FINIS"
THIS_IS_A_VALUE1 = "VALUE #1"
THIS_IS_A_VALUE2 = "VALUE #2"
TRACE 'R'
DO I = 1 TO LINE.0
PARSE VAR LINE.I
SAY "VALUE OF LINE.I : " LINE.I
THIS_IS_A_VALUE3 = LINE.I
QUEUE "//TESTA JOB 00000,'TEST',"
QUEUE "// CLASS=T,"
QUEUE "// MSGCLASS=X,"
QUEUE "// MSGLEVEL=(1,1),"
QUEUE "// USER=000000"
QUEUE "//* THIS IS A VALUE#1 : " THIS_IS_A_VALUE1
QUEUE "//* THIS IS A VALUE#2 : " THIS_IS_A_VALUE2
QUEUE "//* THIS IS A VALUE#3 : " THIS_IS_A_VALUE3
QUEUE "//STEP1 EXEC PGM=IEFBR14"
QUEUE "//DD1 DD DUMMY"
QUEUE "/*"
QUEUE "$$"
O = OUTTRAP("OUTPUT.",,"CONCAT")
"SUBMIT * END($$)"
O = OUTTRAP(OFF)
END
SAY 'END OF REXX CODE.'
This is the output of the submitted REXX code.. notice the missing " at the end of line 32, where I'm trying to show the value of LINE.I (through variable THIS_IS_A_VALUE3)
START OF REXX CODE.
16 *-* DO I = 1 TO LINE.0
>>> "1"
>>> "3"
18 *-* PARSE VAR LINE.I
20 *-* SAY "VALUE OF LINE.I : " LINE.I
>>> "VALUE OF LINE.I : HELLO#1
VALUE OF LINE.I : HELLO#1
22 *-* THIS_IS_A_VALUE3 = LINE.I
>>> "HELLO#1
24 *-* QUEUE "//TESTA JOB 00000,'TEST',"
>>> "//TESTA JOB 00000,'TEST',"
25 *-* QUEUE "// CLASS=T,"
>>> "// CLASS=T,"
26 *-* QUEUE "// MSGCLASS=X,"
>>> "// MSGCLASS=X,"
27 *-* QUEUE "// MSGLEVEL=(1,1),"
>>> "// MSGLEVEL=(1,1),"
28 *-* QUEUE "// USER=000000"
>>> "// USER=000000"
30 *-* QUEUE "//* THIS IS A VALUE#1 : " THIS_IS_A_VALUE1
>>> "//* THIS IS A VALUE#1 : VALUE #1"
31 *-* QUEUE "//* THIS IS A VALUE#2 : " THIS_IS_A_VALUE2
>>> "//* THIS IS A VALUE#2 : VALUE #2"
32 *-* QUEUE "//* THIS IS A VALUE#3 : " THIS_IS_A_VALUE3
>>> "//* THIS IS A VALUE#3 : HELLO#1
This is an example of one of the generated JCLs:
//TESTA JOB 00000,'TEST',
// CLASS=T,
// MSGCLASS=X,
// MSGLEVEL=(1,1),
// USER=000000
//* THIS IS A VALUE#1 : VALUE #1
//* THIS IS A VALUE#2 : VALUE #2
---> missing line here, should display this line --->//* THIS IS A VALUE#3 : HELLO#1
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DUMMY
/*
// CLASS=T,
// MSGCLASS=X,
// MSGLEVEL=(1,1),
// USER=000000
//* THIS IS A VALUE#1 : VALUE #1
//* THIS IS A VALUE#2 : VALUE #2
---> missing line here, should display this line --->//* THIS IS A VALUE#3 : HELLO#1
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DUMMY
/*
Any ideas of how I can display the value of LINE.I?
Thanks