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

Create new members and change particular part in same


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Fri Jun 22, 2012 2:09 pm
Reply with quote

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 ? icon_confused.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jun 22, 2012 6:44 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Jun 22, 2012 6:54 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 22, 2012 6:59 pm
Reply with quote

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
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Fri Jun 22, 2012 10:16 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 22, 2012 10:55 pm
Reply with quote

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
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 Binary File format getting change whi... All Other Mainframe Topics 7
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts SELECT from data change table DB2 5
Search our Forums:

Back to Top