
Reply to comment
Passing parms argument between CLIST and Macro
Pass Values from CLIST to and from a ISREDIT macro
We often make use of ISREDIT macros to do a quick job for us, for example tailoring a file to eliminate few records etc, or search a string in a file etc etc.
It becomes necessary at times to pass information to a macro and get back the information. The following example will show you how to achieve it.
CLIST code to pass values to a macro
SET PARM=valuetomacro
ISPEXEC VPUT (PARM)
ISPEXEC EDIT DATASET("USERID.ABC.XYZ") MACRO (macroname)
ISPEXEC VGET (PARM)
WRITE VALUE RETURNED BY MACRO IS &PARM
MACRO Code to receive and return the Parm value
PROC 0
ISREDIT MACRO
ISPEXEC CONTROL ERRORS RETURN
ISPEXEC VGET (PARM)
WRITE VALUE RECIEVED IN MACRO &PARM
SET PARM=valuefrommacro
ISPEXEC VPUT (PARM)
EXIT CODE(0)
Reply
Click the +1 button below to share it with your friends and colleagues
Share this if you liked it!