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
 

 

Insert Lines in JCL with Rexx after a particular line

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

New User


Joined: 23 Apr 2015
Posts: 16
Location: Hungary

PostPosted: Tue Aug 30, 2016 4:18 pm    Post subject: Insert Lines in JCL with Rexx after a particular line
Reply with quote

Hello!

I am looking for a solution for inserting lines after a particular line in every member in a pds. To be more specific I would like to change the output, wich was 1 record, now it is going to be 3 records. It varies in wich line this output is located.
I have guess to make it work Isredit Line after command.

Sorry if this question has already been asked, I seached the forum, but I had 8000 matches on my keywords, so I rather ask it again.

Csongor
Back to top
View user's profile Send private message

Csongor

New User


Joined: 23 Apr 2015
Posts: 16
Location: Hungary

PostPosted: Tue Aug 30, 2016 6:00 pm    Post subject: Reply to: Insert Lines in JCL with Rexx after a particular line
Reply with quote

I made some progress, I think this was the hard part. Now I can add lines after a defined line.

I open with Rexx for edit:
Code:

/*REXX*/                                                 
ADDRESS ISPEXEC                                           
"EDIT DATASET ('SA81380.AJM.CMD.G0054V00') MACRO(EDITKE2)"
EXIT   
                                                   


And then i use the macro. The key is to define a label (.here), and after that the line_after can be used. I did not succeed to pass variables at first, but I did not try vput vget so far, it should work..

Code:

/*REXX*/                                             
B=2                                                   
ADDRESS ISREDIT "MACRO NOPROCESS"                     
ADDRESS ISREDIT "ISREDIT LABEL" B "= .HERE"           
ADDRESS ISREDIT "ISREDIT LINE_AFTER .HERE = "DATA" " 
B=B+1                                                 
ADDRESS ISREDIT "ISREDIT LABEL" B "= .HERE"           
ADDRESS ISREDIT "ISREDIT LINE_AFTER .HERE = "DATA" " 
ADDRESS ISREDIT "SAVE"                               
ADDRESS ISREDIT "END"       
                         
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Tue Aug 30, 2016 8:10 pm    Post subject:
Reply with quote

Read about system defined labels, like .ZCSR...
Back to top
View user's profile Send private message
Willy Jensen

New User


Joined: 01 Sep 2015
Posts: 94
Location: Switzerland

PostPosted: Wed Aug 31, 2016 1:02 pm    Post subject:
Reply with quote

I just did something similar. Note that the line_after can take a line number as argument, which allowed me to do:
Code:

n=some-line-number
l1 = 'first line inserted'
l2 = 'second line inserted'
l3 = 'third line inserted'
"line_after" n "= (l3)"  /* insert in */
"line_after" n "= (l2)"  /* reverse  */
"line_after" n "= (l1)"  /* order     */
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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