IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Feb 14, 2006 4:10 pm
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
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: 2358
Location: Israel

PostPosted: Wed Feb 15, 2006 10:12 am
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
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: 2358
Location: Israel

PostPosted: Wed Feb 15, 2006 1:52 pm
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
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: 2358
Location: Israel

PostPosted: Sat Feb 25, 2006 3:17 am
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: 164
Location: India

PostPosted: Tue May 06, 2014 6:41 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue May 06, 2014 6:47 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 06, 2014 6:59 pm
Reply with quote

YESSSS!

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 06, 2014 7:01 pm
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: 164
Location: India

PostPosted: Tue May 06, 2014 7:02 pm
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: 164
Location: India

PostPosted: Tue May 06, 2014 7:04 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 06, 2014 7:06 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 06, 2014 7:08 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top