View previous topic :: View next topic
|
Author |
Message |
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Hi Team,
I am in need to create rexx macro where i will create 4 replicas of the same job. (i.e. job which i have opened and executed REXX MACRO).
I have given below code pops in my mind:
Code: |
ADDRESS ISREDIT
"MACRO"
------------CREATE MEMBER1 [LinenumberFROM] [LinenumberTO]
CHANGE ALL 'OLDSTRING1' 'NEWSTRING1'---- this is not working...
------------CREATE MEMBER2 [LinenumberFROM] [LinenumberTO]
CHANGE ALL 'OLDSTRING2' 'NEWSTRING2'---- this is not working...
------------CREATE MEMBER3 [LinenumberFROM] [LinenumberTO]
CHANGE ALL 'OLDSTRING3' 'NEWSTRING3'---- this is not working... |
I am able to create members which are copies of the same job where i have executed REXX macro. But not able to change into the newly created datset. Can anyone suggest me the way to do so ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But not able to change into the newly created datset. |
What does this mean? It is not clear what your problem is. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
The edit macro statements only apply to the file being edited.
When you create a new member, its data is no longer part of editor session. You cannot issue editor commands against a member that you are not editing.
I suggest changing the data before moving it out. Something like this:
Code: |
CHANGE ALL 'OLDSTRING1' 'NEWSTRING1' [LinenumberFROM] [LinenumberTO].
------------CREATE MEMBER1 [LinenumberFROM] [LinenumberTO] |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
a rexx edit macro executes within a ds
so, if you want to do something in another dataset,
you have to invoke EDIT or VIEW with the MACRO option.
that you do not know the above
very, very, very, very basic fundamental of EDIT Macro's,
means you should either start reading
or
stop writing REXX Scripts.
you have to understand what is going on in the machine,
if you expect to utilize programming languages that specifically address a particular machine's attributes.
in this case REXX Edit Macros on an IBM MVS/z/OS machine. |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Thanks all, Just like dbz.. said, I have opened the source member in view mode and executed the above code... Brut Force way.. sometimes works..
Its working fine... i am able to create 5 replicas of my current member with the proper respective replacements... So i am successful in keeping the source member free from any changes.
Thanks dbz.. for your valuable suggestion. But when i tried to explore through Rexx-reference manuasl, i cant easily understand the things properly. Even i could not see any idea given there to fulfill my requirements.
Code: |
/* REXX */
ADDRESS ISPEXEC MACRO
"C ALL STRING1 STRING2"
"C ALL STRING3 STRING4"
"CREATE MEM1 1 397"
"C ALL STRING2 STRING5"
"C ALL STRING4 STRING6"
"CREATE MEM2 1 397" |
and so on... so this above snippet gives me multiple replicas of my current job.(provided that my current job/member must be opened in view mode to keep it free from the C ALL execution) |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
You can always CANCEL, thus negating any changes to your 'base' member.
and though I am happy you solved your problem,
it was Pedro who supplied the solution which you have used.
for you reference:
EDIT and EDIT MACROS V11R0
ISPF SERVICES Guide V1R7
ISPF Library
again, suggest you read the first part of the REXX Programmers Guide.
REXX is only a programming language (albeit a Scripting Language) |
|
Back to top |
|
|
|