GANAPATH
New User
Joined: 06 Mar 2006 Posts: 35
|
|
|
|
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 |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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'))
/*
|
|
|