Question

  Asked: Nov 19 2007   2:35 PM GMT
  Asked by: Shortputt


REXX Program - How to write output string from edit find command


REXX

In my REXX program how do I write a string of data, found using an edit 'find' command, to the output file? I have used variations of the EXECIO command but it treats my variable names as literals. Pgm follows:
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
/* */
/*********************************************************** */
/* REXX EXEC USING EDIT MACRO COMMANDS: EXTRACTS AND CLEANS */
/* UP JCL/PROC DATA FOR INPUT TO BATCH FLOWCHART PROGRAM */
/*********************************************************** */
"FREE FI(OUTDD)"
"ALLOC FI(OUTDD) DA('SC.USER.GLBL.E56.FLOWCHRT') SHR REUSE"
RETURN_CODE = 0 /* INITIALIZE RETURN CODE */
out_ctr = 0 /* INITIALIZE # OF LINES READ */
/* */
"EXECIO 0 DISKW OUTDD (OPEN" /* OPEN INDD */
/* */
/* */
ADDRESS ISREDIT "F 'PGM='"
ADDRESS ISREDIT (LINDATA) = LINE .ZCSR
SAY ABOUT TO ISSUE THE PUSH
LNDAT = "LINDATA"
PUSH LNDAT
SAY FIND DD STMT
ADDRESS ISREDIT F ' DD '
ADDRESS ISREDIT (LINDATA) = LINE .ZCSR
SAY ABOUT TO ISSUE THE PUSH
LNDAT = "LINDATA"
PUSH LNDAT
SAY SAVED LINE DATA LINDATA
/* */
"EXECIO * DISKW OUTDD (FINIS"
out_ctr = out_ctr + 1 /* INCREMENT OUTPUT LINE CTR */
"EXECIO 0 DISKW OUTDD (FINIS" /* CLOSES THE OPEN FILE, OUTDD */
SAY 'FILE OUTDD NOW CONTAINS ' out_ctr' LINES.'
EXIT 0

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



I believe the following lines need to be changed as shown:
ADDRESS ISREDIT (LINDATA) = LINE .ZCSR
to:
ADDRESS ISREDIT "(LINDATA) = LINE" .ZCSR
and remove the quotes from these lines:
LNDAT = "LINDATA"

to:
LNDAT = LINDATA


Rich
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development.

Looking for relevant Development Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register