ARG not working in Edit Macro



IBM's Command List programming language & Restructured Extended Executor

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
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

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:

 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.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

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
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

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:
/*    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

These users thanked the author willy jensen for the post:
Jeff R (Fri Dec 30, 2022 8:51 pm)
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: ARG not working in Edit Macro

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

ok, now that worked...thanks !
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post