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

Insert Lines in JCL with Rexx after a particular line


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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
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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

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

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

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Aug 31, 2016 1:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top