1. Yes Frank each record will be repeated based on the number of headers(here it is A B C)
2. No keys just duplicates
3. RECFM = FB
LRECL = 80
Input File :
A B C
111111111
111111111
111111111
2222222
2222222
2222222
33333
33333
33333
o/p File :
A
111111111
2222222
33333
B
111111111
2222222
33333
C
111111111
2222222
33333
Logic to be implemented:
Actually , the input file will have the header's in the first row of the file.The details record are in such a way that if there is 3 header, then each record will be duplicated 3 time.(as above)
My requirement is to split this input file into 3 blocks as we have 3 headers.Every block will be same (as every records will be available in every block)
Expecting your kind response !!! Hope u ll help me in this regards,
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
The details record are in such a way that if there is 3 header, then each record will be duplicated 3 time.
And if there are 4 headers, then each record will be duplicated 4 times? And so on? Or is there always just 3 headers?
The records with the headers is always the FIRST record?
What is the maximum number of headers? Is the length of each header really 1 byte? If not, what does the header record really look like? How do we identify one header from the next (specific positions, a delimiter, something else)?
And if there are 4 headers, then each record will be duplicated 4 times?
Exactly ... Frank.
Is there always just 3 headers?
No.Header will be maximum of 10.The duplication of record is based upon the header.i.e if n headers then n time the records are duplicated.
The records with the headers is always the FIRST record?
Yes.
What is the maximum number of headers?
10 headers.
Is the length of each header really 1 byte?
No.
If not, what does the header record really look like?
8 bytes . ( eg : MEM0FOI0)
How do we identify one header from the next (specific positions, a delimiter, something else)?
delimiter is used Frank. Its comma (MEM0FOI0,MEM0FOI1,MEM0FOI2...)
Sorry for the inconvienece made !!
Hope i have answered you clearly !!! let me know if u want more clarifcation ...
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Arun Raj,
Oops Sorry. I didn't notice that OP wanted the output also sorted. For some reason I thought he just wanted to Push the header on to the duplicated rows. My bad. Thanks for pointing it out.
Here are the updated control cards which would give him the desired results.