ARG not working in Edit Macro

IBM's Command List programming language & Restructured Extended Executor
Jeff R
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
Referer: just found you on the Internet

ARG not working in Edit Macro

Postby Jeff R » Fri Dec 30, 2022 2:57 am

I'm trying to get an Edit Macro to accept ARG...Edit Macro is manually entered by user from within an active REXX.
Rexx invokes ISPEXEC View session of a PDS member
User enters Edit Macro "GENCHK x" (where x = a line # within the PDS member)
Edit Macro doesn't accept ARG 'x'

/* REXX */

ADDRESS ISREDIT
"MACRO"

ARG RSTRSTEP
SAY RSTRSTEP
EXIT

(EXIT added just for testing ARG)...RSTRSTEP is blanks

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: ARG not working in Edit Macro

Postby willy jensen » Fri Dec 30, 2022 4:10 am

No, EDIT macro parms are accessed like this:

Code: Select all

 Address Isredit "MACRO NOPROCESS (P)"  
 if rc=0 then exit EditMac(p)          
 /* regular pgm starts */
 arg name,opts                          
  . . .
 exit 0
 /* edit macro section */
EditMac:                                
 Address Isredit                        
 parse upper var p what .  
  . . .
 exit 0   

where 'p' contains the parm. This also demonstrates how you can use one REXX pgm as both an EDIT macro and a regular pgm.

Jeff R
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
Referer: just found you on the Internet

Re: ARG not working in Edit Macro

Postby Jeff R » Fri Dec 30, 2022 5:48 am

tried your suggestion and nothing happens (that I'm aware of)

changed
ADDRESS ISREDIT
"MACRO"
to
ADDRESS ISREDIT "MACRO NOPROCESS (RSTRSTEP)"
IF RC=0 THEN EXIT EDITMAC(RSTRSTEP)

added
EDITMAC:
ADDRESS ISREDIT
PARSE UPPER VAR RSTRSTEP
EXIT

not sure what you meant by "arg name,opts" but left in
ARG STRTSTEP
SAY STRTSTEP
EXIT

when i execute REXX (am already in VIEW session of PDS member) by entering "GENCHK 39"...'39' would be the desired input to REXX "GENCHK" and should be the value of STRTSTEP, my SAY STRTSTEP should display '39'
it displays nothing...and I don't hit the EXIT...I am somewhere still in the REXX

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: ARG not working in Edit Macro

Postby willy jensen » Fri Dec 30, 2022 6:30 pm

I need to see your pgm to determine why it's not working, but lets keep it really simple then.
Edit macro sample named EM1:

Code: Select all

/*    ISPF edit macro       rexx */
 Address Isredit "MACRO PROCESS (p)"
 Address Isredit                    
 say 'parm->' p                

When in edit, issue EM1 Kilroy was here
shows message: parm-> Kilroy was here

Jeff R
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Skillset: CA-7, JCL, SORT, Roscoe, TSO, REXX
Referer: just found you on the Internet

Re: ARG not working in Edit Macro

Postby Jeff R » Fri Dec 30, 2022 8:51 pm

ok, now that worked...thanks !


  • Similar Topics
    Replies
    Views
    Last post