Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Scope of Rexx Variable in edit Macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
ermanjitsingh

New User


Joined: 08 Jun 2009
Posts: 19
Location: Banglore

PostPosted: Thu Aug 20, 2009 6:12 pm    Post subject: Scope of Rexx Variable in edit Macro
Reply with quote

Hi

I am calling one edit macro within one rexx code.
This edit macro is got called inside the do loop in rexx code.

I am using some varible in edit macro, the value of which i want to retained in further calls to the edit macro.

The issue is:
whenever each time macro got called in the loop the values of varaible used in macro got intilized. I want to retain those values in further calls of edit macro.

I am calling the Macro as follows:

Code:


DO I = 1 TO FIL.0                                                 
  DSET = INDD1                                                     
  AR = TAG ' ' ENHNAME ' ' CTLMEMR ' ' OPDS ' 'K                   
ADDRESS "ISPEXEC" "EDIT DATASET("DSET") MACRO(CALLMACR) PARM(AR)" 

End 


And my Edit macro code is:

Code:


=====================
    UGCG1BH.CLIST(CALLMACR)           
=====================                                           
ELSE K = 1                                         
ADDRESS  "ISREDIT" "MACRO_MSG = ON"               
         "ISREDIT" "F ALL '"TAG"'"                 
         "ISREDIT" "MACRO_MSG = OFF"               
IF SH <> 'NO' THEN                                 
DO                                                 
P = K                                             
FAY.P = TAG  ENH  CTL SH                           
SAY TAG  ENH  CTL SH                               
P = P + 1                                         
    "EXECIO * DISKW DSET (STEM FAY. FINIS"         
    "FREE FI(DSET)"                                 


I want to retain the value of P in the next call of edit macro.

Can anyone please help me on this ?
Back to top
View user's profile Send private message

prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Thu Aug 20, 2009 6:26 pm    Post subject:
Reply with quote

Use VERASE it before the loop in the calling macro, use VGET and VPUT in the callee and check the errorcode from the VGET to determine if this is the first time the callee is called.

And if you don't know what VERASE, VGET and VPUT do, please RTFM.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Thu Aug 20, 2009 6:37 pm    Post subject: Reply to: Scope of Rexx Variable in edit Macro
Reply with quote

1. Use VPUT and VGET

2. Do your code really look like this ???
Code:

=====================
    UGCG1BH.CLIST(CALLMACR)
=====================
ELSE K = 1
ADDRESS  "ISREDIT" "MACRO_MSG = ON"
         "ISREDIT" "F ALL '"TAG"'"
         "ISREDIT" "MACRO_MSG = OFF"
IF SH <> 'NO' THEN
DO
P = K
FAY.P = TAG  ENH  CTL SH
SAY TAG  ENH  CTL SH
P = P + 1
    "EXECIO * DISKW DSET (STEM FAY. FINIS"
    "FREE FI(DSET)"
Back to top
View user's profile Send private message
ermanjitsingh

New User


Joined: 08 Jun 2009
Posts: 19
Location: Banglore

PostPosted: Thu Aug 20, 2009 7:59 pm    Post subject: Reply to: Scope of Rexx Variable in edit Macro
Reply with quote

Thanks Robert and Marso for your replies.

I will try with VGET & VPUT And once its goes successful will let u know.

@Marco

I have given the part of Macro Code. Not the whole macro code.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Thu Aug 20, 2009 8:32 pm    Post subject: Reply to: Scope of Rexx Variable in edit Macro
Reply with quote

Quote:
I have given the part of Macro Code. Not the whole macro code.

Even if you give only a small part of your code, it must make some sense. icon_evil.gif

In your case, even the part that should... don't make any sense!!! icon_evil.gif icon_evil.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us