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)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
Â