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

Insert a Line after a particular record.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Mon Jul 18, 2011 8:08 pm
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jul 18, 2011 8:28 pm
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: 2481
Location: @my desk

PostPosted: Tue Jul 19, 2011 7:53 am
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
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: 2481
Location: @my desk

PostPosted: Wed Jul 20, 2011 2:21 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top