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

Edit macro


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 4:15 pm
Reply with quote

Code:
...........
...........
...........
//STEP20  EXEC xxxxxxxxx                                       
//             xxxxxxxxxxxxxx                                       
//             xxxxxxxxxxxxxx                                   
//xxxxxxx   DD DSN=asd.qwe.qwe.NEW,                   
//             DISP=(NEW,CATLG,DELETE),                       
//             DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),   
//             SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),       
//             UNIT=3390                                       
//aaaaaa   DD DSN=asd.qwe.qwe.TARGET,                   
//             DISP=(NEW,CATLG,DELETE),                       
//             DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),   
//             SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),       
//             UNIT=3390     
..........
..........
..........


I am asked to use production JCLs for testing purpose
In this JCL, I have change the SPACE parameter of TARGET dataset.

From
SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),to
SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),

I have started with this code.

Code:
/*REXX*/                                         
ADDRESS ISREDIT "MACRO"                           
ADDRESS ISREDIT "CURSOR = 1"                     
VAR1 = "STEP20"                                   
VAR2 = "TARGET"           
VAR3 =  "(CYL,(1000,750),RLSE),VOL=(,,,20)"                       
ADDRESS ISREDIT " F "VAR1"  "


First I have to find STEP20 and then TARGET dataset and its SPACE parameter and apply the change.

Please help me to complete the macro and let me know if you need any other info.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Jun 19, 2008 6:51 pm
Reply with quote

Hi Gnanas !

Not really clear to me. Are you told to write EditMacro because there are several members in which this modification must be done. Otherwise a manual change would be ok.

Assuming the first, then there are more questions:

Why allways Step20, why allways the Dsn named TARGET,...and so on.

I think, you have to find out, which dataset is created, so which DD has the adequate DISP and SPACE parameters.

And you have to pay regard to some more occurrences.

So plse clarify the subject.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 7:05 pm
Reply with quote

Hi UmeySan!

Thanks for your reply.
Quote:
Are you told to write EditMacro because there are several members in which this modification must be done.

Yes.

We grouped JCLs for specific business requirement/flow.

This particular JCL is used on many groups.

So I have to change the SPACE parameter of TARGET dataset which is coded at STEP20.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 7:28 pm
Reply with quote

And no need to execute this edit macro manually. After creating JCL, it will be executed on that JCL automatically.

Code:
/*REXX*/                                                               
ADDRESS ISREDIT "CURSOR = 1"                                           
VAR1 = "STEP20"                                                       
VAR2 = "TARGET"                                                       
VAR3 = '//             SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),'       
ADDRESS ISREDIT " F "VAR1"  "                                         
/* ADDRESS ISREDIT" (L1) = CURSOR"   */                               
ADDRESS ISREDIT " F "VAR2"  "                                         
/* ADDRESS ISREDIT" (L2) = CURSOR"   */                               
L3 = L3 + 3                                                           
ADDRESS ISREDIT DELETE L3                                             
ADDRESS ISREDIT "LINE_BEFORE "L3" = '"VAR3"'"       


Will this work?
And please let me know how to execute on a member to test it ?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Jun 19, 2008 9:31 pm
Reply with quote

You should at least test the macro manually. Then test through batch job (if that is how you want to run it). Edit macros are executed as a command while inside of the editor (or possibly, as the initial macro when getting into the editor).

It is not clear what you mean:
Quote:
After creating JCL, it will be executed on that JCL automatically.


About your program:
1. you need to start with Address ISREDIT 'MACRO'

2. your solution did not match the requirement! Rather than changing one space value for another, you are replacing the 4th line no matter what was there. After you find STEP10 and after you find TARGET, issue a change command:
Code:
Address ISREDIT ,
"C 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),' ",
  "'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),' "
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 10:00 pm
Reply with quote

Hello Pedro,

This is the code I have come with.

Code:
/*REXX*/                                                           
ADDRESS ISREDIT "MACRO PROCESS"                                     
ADDRESS ISREDIT "CURSOR = 1"                                       
/* VAR1 = "STEP20"                     */                           
/* VAR2 = "TARGET"                    */                           
VAR3 = '//             SPACE=(CYL,(2000,750),RLSE),VOL=(,,,20),'   
L2 = 0                                                             
ADDRESS ISREDIT " F 'STEP20'"                                       
ADDRESS ISREDIT " F 'TARGET'"                                     
ADDRESS ISREDIT" (L2) = CURSOR"                                     
L3 = L2 + 3                                                         
ADDRESS ISREDIT DELETE L3                                           
ADDRESS ISREDIT "LINE_BEFORE "L3" = '"VAR3"'"   


Here I am finding STEP20 and TARGET dataset. From there, next to 3 lines, I am deleting a line which has the SPACE parameter and palcing new line with new SPACE parameter.

Let me explain how JCLs are created.
...We have a panel where we can enter business requirement/flow so that it will generate approprite JCLs from production JCLs for testing
...And we have macrolib(edit macros)
...After creation of JCL, it will search for a member in macrolib with the same name of JCL member.
...If it is found, that particular macro will be executed on that JCL member, if no macros found(no member is there in macrolib with same as JCL member), no macros are executed on that member.
...We will create macros with same name of JCL(member) and place it on macrolib so that it will be executed automatically.

Please let me know if any changes can be done to the macro.
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 20, 2008 1:48 am
Reply with quote

Perhaps I am reading too much into your requirement. Your requirement is very specific.

your solution did not match the requirement! Rather than changing one space value for another, you are replacing the 4th line no matter what was there. After you find STEP10 and after you find TARGET, issue a change command:
Code:

Address ISREDIT ,
"C 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),' ",
  "'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),' "


What if the line reads: "(CYL,(50,10),"? your method will still change it, though that was not one of your stated requirements. What if SPACE is on a different line that you thought?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Fri Jun 20, 2008 3:56 pm
Reply with quote

Hi,

I have noticed SPACE parameter after 2 lines from TARGET dataset. Thats why I coded to delete that line and to add another line with new SPACE parameter!!??? icon_mad.gif

Instead of this, I used your suggestion on my code. It's good. I will get back to you if any issues.

Thanks you very much, Pedro!
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Jul 01, 2008 2:55 pm
Reply with quote

This macro works to some extent.

Code:
/*REXX*/                                               
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "CURSOR = 1"                           
VAR1 = "STEP20"                                         
VAR2 = "TARGET"                                       
VAR3 = 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),'       
VAR4 = 'SPACE=(CYL,(1000,750),RLSE),VOL=(,,,20),'       
ADDRESS ISREDIT "F '"VAR1"'"                           
ADDRESS ISREDIT "F '"VAR2"'"                           
ADDRESS ISREDIT "C '"VAR3"' '"VAR4"'"                   

Default SPACE parameter for TARGET dataset is not same since that JCL can be taken either from production or from our testing library.
Code:
VAR3 = 'SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),'   


Consider this code part of our interest.

Code:
//aaaaaa   DD DSN=asd.qwe.qwe.TARGET,                   
//             DISP=(NEW,CATLG,DELETE),                       
//             DCB=(DSORG=PS,RECFM=FB,LRECL=160,BLKSIZE=0),   
//             SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),       
//             UNIT=3390 

So I've to find SPACE= keyword and change the parameter to new one upto comma (,).
// SPACE=(CYL,(250,100),RLSE),VOL=(,,,10),

Please help on this.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jul 01, 2008 9:50 pm
Reply with quote

Quote:
Please help on this.

It is not clear what you need help with.

It looks good to me; if it does not work, please explain why the result is not good.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
Search our Forums:

Back to Top