Posted: Tue Oct 06, 2009 1:29 pm Post subject: Copy set of records contain particular record.
Hi,
I have a file (LRECL=1050, RECFM=FB) as shown below and want copy only those set (01 to 99) of records that contain "Invalid" starting at 16th position. The key starts at 10th position with length of 6 bytes.
Code:
----+----1----+----2----+----3----+----4
01PR8 MTX1R8SUPRAS
02PR8 MTX1R816CUBE 2009 000001898
06PR8 MTX1R82078000012008-02-18-21.16
10PR8 MTX1R8Indian Child star
12PR8 MTX1R8Invalid Charge ON BUS BUG
99PR8 MTX1R8
011P1 MKX1P1VIEWTY
031P1 MKX1P116CxvE 2009 000001898
071P1 MKX1P12078000012008-02-18-21.16
111P1 MKX1P1Indian Ahald punt
991P1 MKX1P1
01CUT YMTXCUTCHARUS
02CUT YMTXCUT16KIMS 2009 000001898
08CUT YMTXCUT2078000012008-02-18-21.16
13CUT YMTXCUTIndian Milkh aoly
12CUT YMTXCUTInvalid Charge ON FAT SIT
99CUT YMTXCUT
Expected Output:
Code:
01PR8 MTX1R8SUPRAS
02PR8 MTX1R816CUBE 2009 000001898
06PR8 MTX1R82078000012008-02-18-21.16
10PR8 MTX1R8Indian Child star
12PR8 MTX1R8Invalid Charge ON BUS BUG
99PR8 MTX1R8
01CUT YMTXCUTCHARUS
02CUT YMTXCUT16KIMS 2009 000001898
08CUT YMTXCUT2078000012008-02-18-21.16
09CUT YMTXCUTIndian Milkh aoly
12CUT YMTXCUTInvalid Charge ON FAT SIT
99CUT YMTXCUT
Please help.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Oct 06, 2009 3:08 pm Post subject:
mf_user,
The following DFSORT JCL will give you the desired results. Btw the string INVALID for the key YMTXCUT does not start in pos 16 , but I assumed it is a typo
Posted: Wed Oct 07, 2009 10:22 am Post subject: Thanks
Kolusu, Thank you....Yes. It was a typo _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
I wonder if it was achievable in single step with the latest SORT tools available _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Kolusu, Our program is designed to read the entries based on type of record (first two digits) in sorted order. So, invalid record (12) being the first record in output file would not work for us. But, I am interested to know the solution.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Wonderful......thanks a lot. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum