sparrow New User Joined: 26 Mar 2007 Posts: 57 Location: Pune
hello..how do i pass variable with some value to a called macro ?
and how do i accept in the macro ?
expat Global Moderator Joined: 14 Mar 2007 Posts: 8657 Location: Back in jolly old England
Marso REXX Moderator Joined: 13 Mar 2006 Posts: 1276 Location: Israel
In this example, my rexx program edits a file (full name in var dsn_member) and runs the MYMACRO macro.
Values are passed with the PARM option:
dsn_member = 'HLQ.SPF.COBOL('member')'
MyParms = '7 14 A'
Address ISPEXEC "EDIT DATASET('"dsn_member"') MACRO(MYMACRO) PARM(MyParms)"
In the macro:
Address ISREDIT "MACRO (ParmFROM ParmTO ParmSEQ)"
In this example, ParmFROM contains 7, ParmTO = 14 and ParmSEQ = 'A'
In order for your rexx program to continue without displaying the edited member, the macro should finish with SAVE;END or a CANCEL;END.
The macro can search and/or modify the edited file. For this use only commands. ISPF Edit and Edit Macro
superk Moderator Team Head Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Another repetitive topic that seems like it's been beaten to death.
It's quite plainly shown when you do a copy of one of the ISPF EDIT models into your code:
'EDIT DATASET('dsname') VOLUME('serial') PASSWORD('pswd') ',
'PANEL('panel-id') MACRO('mac-name') PROFILE('prof-name')',
'PROFILE('prof-name') FORMAT('form-nam') MIXED(NO) ',
'CONFIRM(YES) WS(NO) WRAP ',
'EDIT DATAID('data-id') MEMBER('mbr-name') PANEL('panel-id') ',
'MACRO('mac-name') PROFILE('prof-name') FORMAT('form-nam')',
'MIXED(NO) CONFIRM(YES) ',
'WS(NO) WRAP PRESERVE ',
mac-name - Optional, name of the initial macro to be executed
after the data is read.
parmvar - Optional, name of a variable containing parameters
to be passed to the initial macro. The value of the
variable must be 200 characters or less.
All times are GMT + 6 Hours