I am trying to write a REXX which will be passed a PDS as input. The REXX will read thru all the members, and will update the 3rd line of all the members
with some data.
My code is as below
/*REXX*/
MAC = 'LN2'
INPUT = 'TE.AA.YY.FTP.CTLCARDS.DECOM'
X = OUTTRAP(MEMS.)
/* TO GET THE MEMBER LIST FROM THE INPUT PDS */
"LISTDS '"INPUT"' MEM"
X = OUTTRAP(OFF)
DO I=7 TO MEMS.0
MEMS.I = STRIP(MEMS.I)
SAY 'MEMBER:'MEMS.I
ADDRESS ISPEXEC "EDIT DATASET ('"INPUT"("MEMS.I")') MACRO ("MAC")"
END
EXIT
MAC = 'LN2'
INPUT = 'TE.AA.YY.FTP.CTLCARDS.DECOM'
X = OUTTRAP(MEMS.)
/* TO GET THE MEMBER LIST FROM THE INPUT PDS */
"LISTDS '"INPUT"' MEM"
X = OUTTRAP(OFF)
DO I=7 TO MEMS.0
MEMS.I = STRIP(MEMS.I)
SAY 'MEMBER:'MEMS.I
ADDRESS ISPEXEC "EDIT DATASET ('"INPUT"("MEMS.I")') MACRO ("MAC")"
END
EXIT
and the Macro is
***************************** Top of Data ******************************
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
MYDATA = "AAAA"
ADDRESS ISREDIT "LINE_AFTER 3 = (MY DATA)"
ADDRESS ISREDIT "SAVE"
ADDRESS ISREDIT "END"
EXIT
**************************** Bottom of Data ****************************
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
MYDATA = "AAAA"
ADDRESS ISREDIT "LINE_AFTER 3 = (MY DATA)"
ADDRESS ISREDIT "SAVE"
ADDRESS ISREDIT "END"
EXIT
**************************** Bottom of Data ****************************
While executing, I am getting below error
ISPF Edit Macro Error
Command ===>
******************************************************************************
* *
* Command in error . : LINE_AFTER 3 = (MY DATA) *
* *
* Invalid parameter *
* Extraneous or invalid parameter was specified for LINE_AFTER command. *
* *
* Error message ID . : ISRE181 *
* *
* Last return code . : 20 *
* *
* Macro executing . : LN2 *
* *
* Press ENTER key to terminate the macro. *
* *
* *
* *
******************************************************************************
*DSLIST DSLIST -DSLIST
Command ===>
******************************************************************************
* *
* Command in error . : LINE_AFTER 3 = (MY DATA) *
* *
* Invalid parameter *
* Extraneous or invalid parameter was specified for LINE_AFTER command. *
* *
* Error message ID . : ISRE181 *
* *
* Last return code . : 20 *
* *
* Macro executing . : LN2 *
* *
* Press ENTER key to terminate the macro. *
* *
* *
* *
******************************************************************************
*DSLIST DSLIST -DSLIST
Request for suggestions on how to resolve this,
The expected output is that the 3rd line as shown below having XXXXXXXX SHOULD be replaced with MY DATA
File Edit Edit_Settings Menu Utilities Compilers Test Help
-------------------------------------------------------------------------------
EDIT TE.AA.YY.FTP.CTLCARDS.DECOM(AA157FTP) - 01 LN2 macro error
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 I am testing this
000002 Lets test this
000003 XXXXXXXX
000004 One more line
000005 And one more
000006 QUIT
****** **************************** Bottom of Data ****************************
-------------------------------------------------------------------------------
EDIT TE.AA.YY.FTP.CTLCARDS.DECOM(AA157FTP) - 01 LN2 macro error
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 I am testing this
000002 Lets test this
000003 XXXXXXXX
000004 One more line
000005 And one more
000006 QUIT
****** **************************** Bottom of Data ****************************