siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi all,
just need a help from u guys.
I am having an input file whose LRECL = 80
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
111
120:25354754:48225
123:568545:556566665
1222:sadsdasda
12121212:45544445
000:RECORD NO"12345"?
1222:sasdaioo
4444"RECORD NO"12345"?
|
My output file should be like below,
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
120:25354754:48225
123:568545:556566665
12121212:45544445
000:RECORD NO?
4444:RECORD NO?
|
So here
1) The lines where the first 3 characters are "111" that need to be deleted
2) The first 4 character are "1222" it need to be deleted and
3) IF the value from position 5 to 13 = RECORD NO then it will omit the rest of the stuff after that value by replacing a ? mark.
Please help me in solving this problem. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
3) IF the value from position 5 to 13 = RECORD NO then it will omit the rest of the stuff after that value by replacing a ? mark |
From your example, it appears that you also want to do this if the value from position 6-14 = RECORD NO.
You can use a DFSORT job like the following to do what you asked for. Modify as needed.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OMIT COND=(1,3,CH,EQ,C'111',OR,1,4,CH,EQ,C'1222')
INREC IFTHEN=(WHEN=(5,9,CH,EQ,C'RECORD NO'),
OVERLAY=(14:C'?',20X)),
IFTHEN=(WHEN=(6,9,CH,EQ,C'RECORD NO'),
OVERLAY=(15:C'?',20X))
/*
|
|
|