I have a one off REXX program that generates SYSIN cards. The problem that I'm encountering is the final ')' being dropped. I have tried different character masks i.e. queue"-START DB(" || part1 || ") SPACE(" || part2 || ")" but to no avail. I have included the REXX code, records and output. Can anyone tell me where I'm missing it? Thanks!
Code:
/* REXX */
inputFile = "SYSTMDD.REORG.FILE1"
outputFile = "SYSTMDD.REORG.FILE3"
"ALLOC FI(INFILE) DA("inputFile") SHR"
"ALLOC FI(OUTFILE) DA("outputFile") SHR"
"EXECIO * DISKR INFILE (STEM filedata. FINIS" /* Read file into array */
num_records = filedata.0 /* getnumber of records read */
SAY "Number of recorders read:" num_records
DO i = 1 TO num_records
record = filedata.i
record2 = translate(record, ' ', '.') /* Replace '.' with space */
parse var record2 part1 part2
queue"-STOP DB("part1") SPACE("part2")" <== this parentheses is lost
END
"EXECIO" queued() "DISKW outfile (FINIS"
"FREE FI(INFILE)"
"FREE FI(OUTFILE)"
EXIT
Source data:
AGMAILPD.AGADDRTS
AGMAILPD.AGAGNTTS
AGMAILPD.AGALTKTS
AGMAILPD.AGCBUSTS
AGMAILPD.AGCNTYTS
Output:
-STOP DB(AGMAILPD) SPACE(AGADDRTS
-STOP DB(AGMAILPD) SPACE(AGAGNTTS
-STOP DB(AGMAILPD) SPACE(AGALTKTS
-STOP DB(AGMAILPD) SPACE(AGCBUSTS
-STOP DB(AGMAILPD) SPACE(AGCNTYTS