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
 

 

How to perform a rexx macro on a group of members .

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
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

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
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: 2360
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: 2360
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: 160
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: 2360
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
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue May 06, 2014 6:41 pm    Post subject:
Reply with quote

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

O.


Hi,
The same problem i am facing now regarding moving each member for processing. i tried your logic of giving ISREDIT "END" at the bottom but still there is no change. I will have to give F3 each time for processing each macro on each member.
here is my rexx code below :
Code:

/* REXX */
SAY "ENTER THE PDS NAME:"
PULL PDS
PDS = STRIP(PDS)
  X=SYSDSN("'"PDS"'")
  IF X = 'OK' THEN DO
  X = OUTTRAP('ML.')
   "LISTDS '"PDS"' MEMBERS"
    DO I=7 TO ML.0
       ML.I=STRIP(ML.I)
       ADDRESS ISPEXEC "EDIT DATASET('"PDS"("ML.I")') MACRO(DELSTP)"
       ADDRESS ISREDIT "END"
    END
  X = OUTTRAP('OFF')
  END
  ELSE
    SAY "THE ENTERED PDS IS NOT AVAILABLE"


Pleas kindly help in solving this issue. My macro will be compelted and will work fine if this problem is solved.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Tue May 06, 2014 6:47 pm    Post subject: Reply to: How to perform a rexx macro on a group of members
Reply with quote

This topic only finished over EIGHT years ago! Is this a record?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue May 06, 2014 6:59 pm    Post subject: Reply to: How to perform a rexx macro on a group of members
Reply with quote

YESSSS!

certainly is icon_wink.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue May 06, 2014 7:01 pm    Post subject: Reply to: How to perform a rexx macro on a group of members
Reply with quote

utter stupidity icon_evil.gif

the Address ISREDIT END

must be INSIDE the edit macro

and why not post where You were given the advice


You will keep having problem with Your code
if You do not learn to check the return codes
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue May 06, 2014 7:02 pm    Post subject: Re: Reply to: How to perform a rexx macro on a group of memb
Reply with quote

Nic Clouston wrote:
This topic only finished over EIGHT years ago! Is this a record?


Sorry i dint get the proper solution for the one which i was searching and here too i am not clear with the solution provided that why posted my doubt here so that the pesron who has asjed the question will atleast answer it....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue May 06, 2014 7:04 pm    Post subject: Re: Reply to: How to perform a rexx macro on a group of memb
Reply with quote

enrico-sorichetti wrote:
utter stupidity icon_evil.gif

the Address ISREDIT END

must be INSIDE the edit macro

and why not post where You were given the advice


You will keep having problem with Your code
if You do not learn to check the return codes



Hello,
I tried my code inside ISREDIT MACRO only but even then the code is not working properly. one kind suggestion is even if you do not want to help or speak with kind words atleast dont use harsh words to the prople who believe that they would get their problem solved regarding their doubts.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue May 06, 2014 7:06 pm    Post subject: Reply to: How to perform a rexx macro on a group of members
Reply with quote

Quote:
Sorry i dint get the proper solution for the one which i was searching and here too i am not clear with the solution provided that why posted my doubt here


You received the proper advice
You just did not try to understand IT

seems that we are wasting time trying to help You
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Tue May 06, 2014 7:08 pm    Post subject: Reply to: How to perform a rexx macro on a group of members
Reply with quote

Quote:
one kind suggestion is even if you do not want to help or speak with kind words atleast dont use harsh words to the prople who believe that they would get their problem solved regarding their doubts.


kind words are reserved for people who can understand them

for working code search my posts for the $APPLY script
the inner macros there WORK!

Your inner macro flow is just plain wrong

see for example the sequence

Quote:
ELSE
CALL INSERTSTP
INSERTSTP:
NBR2=NBR
NBR1=NBR-1
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 -> CLIST & REXX 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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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


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