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)