Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to perform a rexx macro on a group of members .

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
av_sukumar

New User


Joined: 12 Oct 2004
Posts: 6

PostPosted: Tue Feb 14, 2006 3:08 pm    Post subject: How to perform a rexx macro on a group of members .
Reply with quote

Hi Everybody,

My doubt is I want to execute a rexx macro on group of members i.e
a dataset at one shot. Could some one please send me the suggesion
about how to do this..

Thanks in advance,
A.Sukumar
Back to top
View user's profile Send private message
References
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Tue Feb 14, 2006 4:10 pm    Post subject:
Reply with quote

Here is my way to run a macro against each member of a PDS:
Code:

/*------------------------------- REXX ------------------------------- 
 * PROGRAM   : C@ALL                                                   
 * FUNCTION  : An example of how to run an edit-macro against all       
 *           : members of PDS.                                         
 * AUTHOR    : OFER                                                     
 * DATE      : 28/03/04                                                 
 * HOW TO USE:                                                         
 *           :                                                         
 *------------------------------------------------------------------*/ 
                                                                       
ARG PDS .                                                               
                                                                       
MAC  = 'TEMPMAC'                               /* Macro name          */
                                                                       
PDS = "'"STRIP(PDS,"B","'")"'"                                         
                                                                       
X = OUTTRAP("LIBMEM.")                         /* Trap output of TSO  */
 ADDRESS TSO "LISTDS "PDS" M"                                           
X = OUTTRAP("OFF")                                                     
                                                                       
PDS = STRIP(PDS,"B","'")                                               
                                                                       
DO I = 7 TO LIBMEM.0                                                   
  LIBMEM.I = STRIP(LIBMEM.I)                   /* Member name         */
  ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")"   
  SAY I RC LIBMEM.I                                                     
END                                                                     
                                                                       
EXIT                                                                   
                                                                       


O.
Back to top
View user's profile Send private message
av_sukumar

New User


Joined: 12 Oct 2004
Posts: 6

PostPosted: Wed Feb 15, 2006 9:49 am    Post subject:
Reply with quote

Hi ,

Thanks for the reply . I tested the above macro but the problem is that whenever its executing the ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")" line , Macro was opening the member in edit mode , if you press F3 then only its picking the second member. If we have 1 or 2 members this would be ok but it we want to execute on the 50 to 100 members this way is not ok ,Is in it??.

So what I want is , If we execute the macro it should perform that on all the member and come out.

please send me the reply asap.


Awaiting for reply,
A.Sukumar.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Wed Feb 15, 2006 10:12 am    Post subject:
Reply with quote

Make sure that your macro have "ADDRESS ISREDIT 'END'" as the last edit command.

O.
Back to top
View user's profile Send private message
av_sukumar

New User


Joined: 12 Oct 2004
Posts: 6

PostPosted: Wed Feb 15, 2006 12:34 pm    Post subject:
Reply with quote

Hi I checked with the above instruction which you had mentioned But still its giving the same problem. Check my macro below.

Code:
 
/*REXX*/                                                               
"ISREDIT MACRO"                                                         
ARG PDS .                                                       
MAC  = 'DELL'                               /* MACRO NAME          */                                                                           
PDS = "'"STRIP(PDS,"B","'")"'"                     
X = OUTTRAP("LIBMEM.")                         /* TRAP OUTPUT OF TSO  */
ADDRESS TSO "LISTDS "PDS" M"                                           
X = OUTTRAP("OFF")                                         
PDS = STRIP(PDS,"B","'")                               
DO I = 7 TO LIBMEM.0                                                   
   LIBMEM.I = STRIP(LIBMEM.I)                   /* MEMBER NAME         */
   ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")"   
   "ISREDIT END"                                                         
END
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Wed Feb 15, 2006 1:52 pm    Post subject:
Reply with quote

I really don't get what you do. I gave you a REXX exec, wich runs on a PDS, and invoke the macro TEMPMAC agains each member.

You turned my REXX exec into edit macro.... icon_eek.gif

O.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 180
Location: Toronto, Canada

PostPosted: Sat Feb 25, 2006 3:15 am    Post subject:
Reply with quote

Guys,

Where do I need to write either TEMPMAC or DELL?

because I try to execute your code (both the above), I get an error message command TEMPMAC (or DELL) not found.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Sat Feb 25, 2006 3:17 am    Post subject:
Reply with quote

Edit Macro written in REXX should be saved in your SYSEXEC library.

O.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1