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
 

 

Edit macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Gnanas N

Active Member


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

PostPosted: Thu Jun 19, 2008 4:15 pm    Post subject: Edit macro
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: 755
Location: Germany

PostPosted: Thu Jun 19, 2008 6:51 pm    Post subject:
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: 788
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 7:05 pm    Post subject:
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: 788
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 7:28 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Jun 19, 2008 9:31 pm    Post subject: Reply to: Edit macro
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: 788
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 10:00 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Jun 20, 2008 1:48 am    Post subject: Reply to: Edit macro
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: 788
Location: Chennai, India

PostPosted: Fri Jun 20, 2008 3:56 pm    Post subject:
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: 788
Location: Chennai, India

PostPosted: Tue Jul 01, 2008 2:55 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Jul 01, 2008 9:50 pm    Post subject: Reply to: Edit macro
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Mass comment and edit elixir1986 IBM Tools 3 Thu Mar 02, 2017 10:09 pm
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm


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