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 a Line after a particular record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Mon Jul 18, 2011 7:40 pm    Post subject: Insert a Line after a particular record.
Reply with quote

Hi All,

I have an input file containing SYSOUT data of SORT pgm.
Assume LRECL=240, RECFM=FB

Input File :-
WER073I SORTJNF2 : DSNAME=TST.NEW.PROD.ER87251.M0611.PC.X4
WER484I SORTJNF2 : RCD IN= 110662,OMITTED= 0,PAIRED= 45247,UNPAIRED= 65415
WER052I END SYNCSORT - XP65402A,TC1STP1,,DIAG=EE00,61C2,C200,004E,A6FE,48CB,0
WER073I SORTIN : DSNAME=TST.TC1STP1.CLI654.JULR04A.ZIPMATCH
WER074I SORTOUT : DSNAME=TST.TC1STP1.CLI654.JULR04A.ZIPMATCH.DEFTTERR
WER054I RCD IN 100000, OUT 143
WER052I END SYNCSORT - XP65402A,TC1CHK,,DIAG=CC00,D35B,E01D,A4FD,85F2,68C3,26
WER074I SORTOUT : DSNAME=TST.TC2STP1.CLI654.JULR04A.UNMTCH
WER054I RCD IN 418775, OUT 418775
WER073I SORTJNF1 : DSNAME=TST.GM116101.CLI654.R04.WK26.M06.URP1

After every "END SYNCSORT" a blank line should appear as shown in below and the ouput should be

Output File :-
WER073I SORTJNF2 : DSNAME=TST.NEW.PROD.ER87251.M0611.PC.X4
WER484I SORTJNF2 : RCD IN= 110662,OMITTED= 0,PAIRED= 45247,UNPAIRED= 65415
WER052I END SYNCSORT - XP65402A,TC1STP1,,DIAG=EE00,61C2,C200,004E,A6FE,48CB,0

WER073I SORTIN : DSNAME=TST.TC1STP1.CLI654.JULR04A.ZIPMATCH
WER074I SORTOUT : DSNAME=TST.TC1STP1.CLI654.JULR04A.ZIPMATCH.DEFTTERR
WER054I RCD IN 100000, OUT 143
WER052I END SYNCSORT - XP65402A,TC1CHK,,DIAG=CC00,D35B,E01D,A4FD,85F2,68C3,26

WER074I SORTOUT : DSNAME=TST.TC2STP1.CLI654.JULR04A.UNMTCH
WER054I RCD IN 418775, OUT 418775
WER073I SORTJNF1 : DSNAME=TST.GM116101.CLI654.R04.WK26.M06.URP1

Thanks
-3nadh
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Mon Jul 18, 2011 8:08 pm    Post subject:
Reply with quote

Given that the number of records will not be very great, an edit macro or a Rexx script will work quite nicely, yes?
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Mon Jul 18, 2011 8:19 pm    Post subject: Reply to: Insert a Line after a particular record.
Reply with quote

I have tried the following code and it worked. Please let me know whether i need to do any changes further..

OPTION COPY
OUTFIL IFOUTLEN=240,
IFTHEN=(WHEN=INIT,BUILD=(1,240)),
IFTHEN=(WHEN=(12,12,CH,EQ,C'END SYNCSORT'),BUILD=(1,240,/,240X))

Thanks
-3nadh
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: Mon Jul 18, 2011 8:28 pm    Post subject: Reply to: Insert a Line after a particular record.
Reply with quote

Hello,

If you have tested and the code does exactly what you want, we shouldn't be needed. . . icon_confused.gif

Good to hear it is working icon_smile.gif

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Tue Jul 19, 2011 7:53 am    Post subject:
Reply with quote

I have n't tested it yet. But I think you could omit the below line in your code.
Code:
IFTHEN=(WHEN=INIT,BUILD=(1,240)),
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Tue Jul 19, 2011 4:10 pm    Post subject:
Reply with quote

Code:
  OPTION  COPY                                         
  OUTFIL IFTHEN=(WHEN(12,12,CH,EQ,C'END SYNCSORT'),     
         BUILD=(1,240,/,240:X))                           


should be enough for your requirement.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Wed Jul 20, 2011 2:21 pm    Post subject:
Reply with quote

Or even this.
Code:
  OPTION  COPY                                         
  OUTFIL IFTHEN=(WHEN(12,12,CH,EQ,C'END SYNCSORT'),     
         BUILD=(1,240,/))
icon_smile.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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