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
 

 

Create new members and change particular part in same

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
rohanthengal

Active User


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

PostPosted: Fri Jun 22, 2012 2:09 pm    Post subject: Create new members and change particular part in same
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

Site Director


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

PostPosted: Fri Jun 22, 2012 6:44 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Jun 22, 2012 6:54 pm    Post subject: Reply to: Create new members and change particular part in s
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: 6967
Location: porcelain throne

PostPosted: Fri Jun 22, 2012 6:59 pm    Post subject:
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: 181
Location: Globe, India

PostPosted: Fri Jun 22, 2012 10:16 pm    Post subject: Brute force ways...
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: 6967
Location: porcelain throne

PostPosted: Fri Jun 22, 2012 10:55 pm    Post subject:
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    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
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am


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