View previous topic :: View next topic
|
Author |
Message |
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
Iam creating a macro for generating spufi report.
This is how i want my macro to work. I will open the SPUFI output dataset and enter
the macro name like 'MAC2'. I want the macro to remove the SPUFI generated lines.
In the report i want only one COLUMN HEADER and following should be all data.
This is my macro.
Code: |
/*REXX****************************************/
/* EDIT MACRO - SPUFI ERROR REPORT ***********/
/*********************************************/
ADDRESS ISPEXEC
"ISREDIT MACRO"
"ISPEXEC CONTROL ERRORS RETURN"
"ISREDIT F SELECT"
"ISREDIT LABEL .ZCSR = .TOP"
"ISREDIT F X'5E' ALL"
"ISREDIT LABEL .ZCSR = .BOTTOM"
"ISREDIT DELETE ALL .TOP .BOTTOM"
"ISREDIT X ALL"
"ISREDIT F ALL P'DSNE6==I'"
"ISREDIT DELETE ALL NX"
"ISREDIT RESET"
"ISREDIT ONLY '----+-----'"
"ISREDIT DELETE ALL NX"
"ISREDIT ONLY 'EMPNO'"
"ISREDIT FLIP"
"ISREDIT FIND FIRST 'EMPNO'"
"ISREDIT DELETE ALL X"
"ISREDIT RESET"
"ISREDIT END"
EXIT |
The macro which i have done is static.
Code: |
"ISREDIT ONLY 'EMPNO'" |
I want to make it a little bit dynamic by passing parameters(HEADER COLUMN INFO).
I don't know how to involve parameter variable in the macro ?
Code: |
/*REXX****************************************/
/* EDIT MACRO - SPUFI ERROR REPORT ***********/
/*********************************************/
ADDRESS ISPEXEC
"ISREDIT MACRO(HEADER) NOPROCESS"
"ISPEXEC CONTROL ERRORS RETURN"
"ISREDIT F SELECT"
"ISREDIT LABEL .ZCSR = .TOP"
"ISREDIT F X'5E' ALL"
"ISREDIT LABEL .ZCSR = .BOTTOM"
"ISREDIT DELETE ALL .TOP .BOTTOM"
"ISREDIT X ALL"
"ISREDIT F ALL P'DSNE6==I'"
"ISREDIT DELETE ALL NX"
"ISREDIT RESET"
"ISREDIT ONLY '----+-----'"
"ISREDIT DELETE ALL NX"
"ISREDIT ONLY 'HEADER'" <---------- Here parameter has to be used
"ISREDIT FLIP"
"ISREDIT FIND FIRST 'HEADER'" <---------- Here parameter has to be used
"ISREDIT DELETE ALL X"
"ISREDIT RESET"
"ISREDIT END"
EXIT |
How to do it ?
Thank You In Advance,
Sushanth |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This has been discussed quite a few times in the forum. Maybe used VGET or VPUT for your search arguments. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thanks EXPAT. I will see that.
Sushanth |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can pass parameters in the MACRO command itself, for example:
"ADDRESS ISREDIT 'MACRO (PARM1 PARM2) PROCESS'"
O. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
O,
How to see the passed parameters in the SAY. To check is it receiving the correct value.
Code: |
ADDRESS ISPEXEC
/*ADDRESS ISPEXEC */
"ISREDIT MACRO (HEADER) PROCESS"
"ISPEXEC CONTROL ERRORS RETURN" |
When i give like this it display HEADER
Thank You,
Sushanth |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Remove the quotes, as HEADER is a variable, not a constant literal.
O. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Yes. Thank You O.
I have made a few enchancements to my program.
Here is the code.
Code: |
/*REXX****************************************/
/* EDIT MACRO - SPUFI ERROR REPORT ***********/
/*********************************************/
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
"ISREDIT F SELECT"
"ISREDIT (TOP) = CURSOR"
"ISREDIT LABEL .ZCSR = .TOP"
"ISREDIT F X'5E' ALL"
"ISREDIT (BOTTOM) = CURSOR"
SELECT
WHEN TOP=BOTTOM THEN
DO
"ISREDIT DELETE ALL .TOP .TOP"
END
OTHERWISE
DO
"ISREDIT LABEL .ZCSR= .BOTTOM"
"ISREDIT DELETE ALL .TOP .BOTTOM"
END
END
"ISREDIT X ALL"
"ISREDIT F ALL P'DSNE6==I'"
"ISREDIT DELETE ALL NX"
"ISREDIT RESET"
"ISREDIT ONLY '----+-----'"
"ISREDIT DELETE ALL NX"
"ISREDIT ONLY "HEADER""
"ISREDIT FLIP"
"ISREDIT FIND FIRST "HEADER""
"ISREDIT DELETE ALL X"
"ISREDIT RESET"
"ISREDIT END"
EXIT |
Thank You,
Sushanth Bobby |
|
Back to top |
|
|
|