Posted: Mon Sep 22, 2014 12:36 pm Post subject: DFSORT to Split the records according to the header
Hi,
I have below input file, with 3 report DF, EE, and GG.
I need to split the input files into three files based on the group header.
Code:
1DF AABB
HEAD1
HEAD2
ZYKA DATA
ZYKA DATA
1DF AABB
HEAD1
HEAD2
YYAA DATA
ZYYA DATA
1EE CCDD
HEAD1
HEAD2
ZYZZ DATA
XYZZ DATA
1DF SSDD
HEAD1
HEAD2
ZYYA DATA
ZYYA DATA
1EE FFGG
HEAD1
HEAD2
GGYY DATA
HHYY DATA
1GG FFHH
HEAD1
HEAD2
AAYY DATA
AACC DATA
Output should be
DF-REport File1
Code:
1DF AABB
HEAD1
HEAD2
ZYKA DATA
ZYKA DATA
1DF AABB
HEAD1
HEAD2
YYAA DATA
ZYYA DATA
1DF SSDD
HEAD1
HEAD2
ZYYA DATA
ZYYA DATA
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Mon Sep 22, 2014 12:58 pm Post subject:
Magesh_J wrote:
Please advice if i am missing something, or any other best way to achive this ?
Magesh_J,
why do you need to validate 3 bytes? 2 bytes is more than enough. Just push the contents from byte 2 for a length of 2 bytes. Use the following control cards
Notice that SORTOUT will be 82 bytes as you haven't chopped off the additional bytes that you pushed. Ideally I would add another OUTFIL File with SAVE to have all the records that do not fit the include conditions.
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