View previous topic :: View next topic
|
Author |
Message |
av_sukumar
New User
Joined: 12 Oct 2004 Posts: 6
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
av_sukumar
New User
Joined: 12 Oct 2004 Posts: 6
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Make sure that your macro have "ADDRESS ISREDIT 'END'" as the last edit command.
O. |
|
Back to top |
|
|
av_sukumar
New User
Joined: 12 Oct 2004 Posts: 6
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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....
O. |
|
Back to top |
|
|
jz1b0c
Active User
Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Edit Macro written in REXX should be saved in your SYSEXEC library.
O. |
|
Back to top |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
This topic only finished over EIGHT years ago! Is this a record? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
YESSSS!
certainly is |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
utter stupidity
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
enrico-sorichetti wrote: |
utter stupidity
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|