Here INput file2:
I have to insert these records in output file as
aaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbb
cccccccccccccccc
into input file 2 between these matching keys
1111000 xxxxxxxxxxxxxxxxxxxx
.
.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
VIGNRSH,
can you please answer the following?
1. Does the key in file 2 always start with '1'?
2. What is the LRECL and RECFM of the input files?
3. What is the Criteria to append the alphabets at the end of the key? (A,B,C...)
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Quote:
No , it can be anynumeral or alphabet.
VIGNRSH,
It is going to be tough given that there is no way to identify the Key record from the other detail records in file 2. Is there an indicator or something in file 2 which identifies the key record? If there is an indicator then the grouping is easy.
Also you append A,B,C,D... to the records from file2, what happens if you have more than 26 records for a single key?
What is the max number of records u can have in file 1?
for generating the key, in file1, i thought of the following logic,
11110000
.xxxxxxxxxxxxx <--records to be inserted
.yyyyyyyyyyyy <--records to be inserted
.xxxxxxxxxxxxxxx <--records to be inserted
11110001
i thought we can modify the input file first to generate keys
11110000
1111000A xxxxxxxxxxxxx
1111000B yyyyyyyyyyyy
1111000C xxxxxxxxxxxxxxx
11110001
and then do insertion in file 2 , whenever the key matches until the second key match.
For me , i have not come across situations , where i have to insert greater than 26 alphabets.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
john george wrote:
Yes, I have one idea i n my mind.
Could u now solve this?
John George,
I am not sure how to generate the keys as the detailed records in the 2nd file are variable. Even if I can generate how am I going to map them to the detail records in file2?
If you know a way please let me know
I have a round about solution which requires 6 passes of data. It can be reduced to half or even less if we have identifier in file 2 for the key record
Joined: 18 Mar 2007 Posts: 44 Location: New Jersey,USA
Hi Skolusu ,
I had got it confimed that , those records that have to be inserted can be prefixed with key like ADD.
File1:
Input File1:
1110000 xxxxxxxxxxxxxxxxxxxx
1110001 xxxxxxxxxxxxxxxxxxxx
1110002 xxxxxxxxxxxxxxxxxxxx
But it should insert only if key s are matching in two files!
11100000 matches both files
11110001 matches both files
so only those records inbetween them has to be inserted .
So now my output should be,
Output file:
11100000 xxxxxxxxxxxxxxxxxxxx
1110000A aaaaaaaaaaaaaaaaaaaaa
1110000B bbbbbbbbbbbbbbbbb
11100001 xxxxxxxxxxxxxxx
Here probably we can generate the Seqnum intialised by first searching the input file for the most recent value and write to a file and then start
1110000 xxxxxxxxxxxxxxxxxxxx 132123
1110001 xxxxxxxxxxxxxxxxxxxx 132124
1110002 xxxxxxxxxxxxxxxxxxxx 132125
111002A xxxxxxxxxxxxxxxxxxxx a00005
1110003 xxxxxxxxxxxxxxxxxxxx 132125
our seq num generation from that.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
VIGNRSH wrote:
Hi Skolusu ,
I had got it confimed that , those records that have to be inserted can be prefixed with key like ADD.
can u guide me to fix this now?Thanks in Advance!
Vignrsh,
Here is a DFSORT/ICETOOL JCL which will give you the desired results. However I dont understand the count part as you show different results. You need to explain it in detail as to what you want clearly