Page 1 of 1

Combine 22 datasets

PostPosted: Fri Nov 18, 2011 5:32 pm
by Manju Venkat
I have to combine 22 input datasets.
record length : 144 and record format : fb

i/p:
detail records
Trailer1 - record count (9 bytes)
Trailer2 - record count (9 bytes)
.........
Trailer15 - record count (9 bytes)

Note: No header record.

i have to combine all the input datasets and update the trailer counts of all the files.

o/p:
same file layout.
should get details of all the files and 15 trailer with updated counters of all the files.

trailer identifier is TOTAL ( starting from 1 , 5 bytes length )

ex:trailer
TOTAL NO OF ACCOUNTS THAT ARE S... : 000000001
TOTAL NO OF ACCOUNTS NOT FOUND ... : "
TOTAL NO OF ACCOUNTS THAT ARE N... : "
TOTAL NO OF ACCOUNTS CLOSED ... : "
TOTAL NO OF ACCOUNTS IN OVERDRA... : "
TOTAL NO OF ACCOUNTS WITH DEPOS....
TOTAL NO OF ACCOUNTS WITH A CAU...
TOTAL NO OF ACCOUNTS WITH A PAY...
TOTAL NO OF ACCOUNTS WITH A COU...
TOTAL NO OF ACCOUNTS WITH A NO ...
TOTAL NO OF ACCOUNTS WITH A NO ...
TOTAL NO OF ACCOUNTS WITH A POW...
TOTAL NO OF ACCOUNTS WITH A DEC...
TOTAL NO OF ACCOUNTS THAT ARE O...
TOTAL NO OF ACCOUNTS WITH CREDI...

Counter starts at position : 104

Re: Combine 22 datasets

PostPosted: Fri Nov 18, 2011 5:52 pm
by BillyBoyo
You are lucky, a moderator got there first and took out the "urgent" of your original subject.

You are not yet clear enough in describing your data.

Do you have 22 datasets, each (with no headers) containing 15 trailer records with counts on?

Do you want to combine all those into one dataset with 15 trailer records with counts on?

Or something else that you can now describe sufficiently clearly to elicit some help.

Re: Combine 22 datasets

PostPosted: Mon Nov 21, 2011 8:48 am
by Manju Venkat
HI,

Thanks for your quick reply. sorry for not providing the clear data's.

i have to combine 22 input dataset's to one dataset. Input and output file with no headers and 15 trailer records... i have to combine the detail records of each 22 files. each input file has 15 trailer records with counts.. and in output file i should write only 15 trailer records with all the counts of the other trailer counts .

i/p1:
12433465687697 - detail record
Trailer1 : 00000001
Trailer2 : 00000006
......
Trailer15 : 000000008

i/p2:
12433465687690 - detail record
Trailer1 : 00000003
Trailer2 : 00000004
......
Trailer15 : 000000001

likewise 22 files

O/p:
12433465687697
12433465687690
Trailer1 : 00000004
Trailer2 : 00000010
......
Trailer15 : 000000009

Re: Combine 22 datasets

PostPosted: Mon Nov 21, 2011 6:32 pm
by BillyBoyo
You could concatentate all your 22 datasets on SORTIN.

I would split the task into two parts. Firstly all the detail records on one dataset and the trailers on a seperate one.

From the detail records, I'd generate new trailer records.

I'd SUM the original trailers.

Extract the new trailers.

Compare the new trailers to the summerd original trailers.

This approach should ensure correct trailers, and identify any problems already existing.

You would need to identify from each detail record which trailer it is to be added to.

If you are totally secure with the existing contents of the trailers, you could ignore the generation of new trailers and the checking. Split the files as above, SUM the trailers and then do a SORT COPY with the two new files concatenated on the SORTIN.

If you want that approach in one step (maybe your files are huge), check out your documentation of Synctool.