View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Tue Jul 27, 2010 11:02 pm Post subject: output file needed bases on input requirement |
|
|
Hi,
I have an input file with 22 bytes and RECFM=FB. I want to pull out all the records which have non RW in column 21-22 . Sometimes there could be a record in the first line which might have non RW but also I have to pick up the next record in case if it exists.
Code: |
----+----1----+----2--
**********************
XYZSPQR TS 0001 UT
-THRU 0004
XYZSPQR1 TS 0001 RW
-THRU 0010
XYZSPQR2 TS 0001 RW
-THRU 0010
XYZSPQR3 TS 0001 RW
-THRU 0010
XYZSPQR4 TS 0001 UT
-THRU 0010
XYZSPQR5 TS 0001 RW
-THRU 0010
XYZSASN TS UT
XYZSBSUS TS RW
|
I want the output as:
Code: |
----+----1----+----2--
**********************
XYZSPQR TS 0001 UT
-THRU 0004
XYZSPQR4 TS 0001 UT
-THRU 0010
XYZSASN TS UT
|
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Jul 27, 2010 11:24 pm Post subject: |
|
|
yadav2005,
Try these untested control cards
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(21,2,CH,NE,C' '),PUSH=(23:21,2))
OUTFIL INCLUDE=(23,2,CH,NE,C'RW'),BUILD=(1,22)
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed Jul 28, 2010 6:02 am Post subject: |
|
|
Kolusu Thanks your code helped me a lot. |
|
Back to top |
|
 |
puttu Beginner
Joined: 29 Jul 2010 Posts: 41 Topics: 9
|
Posted: Fri Jul 30, 2010 1:56 am Post subject: |
|
|
yadav2005 wrote: | Kolusu Thanks your code helped me a lot. | Excellent kolusu..... |
|
Back to top |
|
 |
|
|