Break file into multiple with hdr/trl



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Break file into multiple with hdr/trl

Postby manojtyagi2012 » Sat Oct 13, 2012 5:30 pm

Hi,

My requirement is to break a file into several files (total 10) based on the 2 byte code appearing at the end. Also Header and trailer needs to be written to each output file along with COUNT of records in each files excluding header/trailer record.There are 10 different codes which can appear A0, A1,A2... A9. at pos 79 , 80

Input file :
1. FB , LRECL=80. File appearing in sorted order of codes
2. Count appearing in header / trailer match and is equal to no of details records in input file.
2. format :
HEADER<<YYYYMMDD>><<FILENAME-10 bytes>><COUNT 8 bytes)
11111111111111111111111111111111111111111111111111111A0
11111111111111111111111111111111111111111111111111111A0
22222222222222222222222222222222222222222222222222222A1
22222222222222222222222222222222222222222222222222222A2
33333333333333333333333333333333333333333333333333333A3
TRAILER<<COUNT 8 bytes)

Output required.
1. 10 output files should be created containing records for each 2 byte code with header and trailer records
2. Header - First 24 bytes should be same as in Input file, but COUNT = no of record in the broken file excluding hdr/trl
3. Trailer - Same as in Input file, but COUNT = no of records in broken file (same as appearing in Header).


I am able to break the INPUT file into 10 files based on 2 byte code appearing at 79th pos, but don't know how to generate Header and trailer with the above requirement.

please help

Regards\
Manoj Tyagi
manojtyagi2012
 
Posts: 1
Joined: Sat Oct 13, 2012 5:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Break file into multiple with hdr/trl

Postby BillyBoyo » Mon Oct 15, 2012 3:24 am

Have a look at this one from the "sibling" site:

http://ibmmainframes.com/about57659.html#288966
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post