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

how to find and add lines in the output


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
GANAPATH

New User


Joined: 06 Mar 2006
Posts: 35

PostPosted: Tue Dec 05, 2006 3:43 am
Reply with quote

HI ,

i have a file that has many rows, but there is only one existence of the word ABC, now i would like to take the file find for ABC as it is not always on a particulare line and then add some more lines after abc and retain the rest of the file, Can some one let me know.

file looks like this
sjdfjghj
sjdghfgf'
h]ghgh
ABC
dfjghh
rkhgithj

i want this to look like

sjdfjghj
sjdghfgf'
h]ghgh
ABC
123<--add these lines
456<-
789<-
dfjghh
rkhgithj

Thanks,
Ganapath
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 05, 2006 3:53 am
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL IFTHEN=(WHEN=(1,3,CH,EQ,C'ABC'),
    BUILD=(1,80,/,C'123',/,C'456',/,C'789'))
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top