Author: migusd
Subject: getting everything out of JOINKEYs
Posted: Mon Jun 05, 2017 9:26 am (GMT 5.5)
Hello,
I have a question about JOINKEYS... and an issue I don't know how to solve it.
I have two input files, and would like to create three output files out of it.
File 1. Unpaired file 1 records.
File 2. Unpaired file 2 records.
File 3. Paired records.
here is my code ... with first two output files
First the issue:
The process is working fine... it is doing what is supposed to. However, during my test, I forced to have only two records on my second output file. It did have those two records... however, it created empty records to match the number of records for output file 1. The meaningful records where the first two... the rest were empty records.
on my second test, I force it to have only one record in the second outfile. This time the outfile 2 was worse. it also contained a lot of empty records, but the sole record that I needed was in the position it was determined to be unpaired... say... contained 11 empty records, then the one I wanted, and then again the empty records to match the number of records of outfile 1.
As you may see, the input files are not even the same length and the key is found in different position in each file.
How can I solve this?
Now the question.
what should be the syntax on Join Statement to also have the paired records on a third file?
thank you in advance
_________________
shikoulitz
Subject: getting everything out of JOINKEYs
Posted: Mon Jun 05, 2017 9:26 am (GMT 5.5)
Hello,
I have a question about JOINKEYS... and an issue I don't know how to solve it.
I have two input files, and would like to create three output files out of it.
File 1. Unpaired file 1 records.
File 2. Unpaired file 2 records.
File 3. Paired records.
here is my code ... with first two output files
Code: |
JOINKEYS FILE=F1,FIELDS=(10,07,A) JOINKEYS FILE=F2,FIELDS=(07,07,A) JOIN UNPAIRED,ONLY REFORMAT FIELDS=(F1:1,80,F2:1,25),FILL=X'FF' SORT FIELDS=COPY OUTFIL FILES=1, INCLUDE(81,1,BI,EQ,X'FF'), OUTREC=(1:1,80) OUTFIL FILES=2, OUTREC=(1:81,25) |
First the issue:
The process is working fine... it is doing what is supposed to. However, during my test, I forced to have only two records on my second output file. It did have those two records... however, it created empty records to match the number of records for output file 1. The meaningful records where the first two... the rest were empty records.
on my second test, I force it to have only one record in the second outfile. This time the outfile 2 was worse. it also contained a lot of empty records, but the sole record that I needed was in the position it was determined to be unpaired... say... contained 11 empty records, then the one I wanted, and then again the empty records to match the number of records of outfile 1.
As you may see, the input files are not even the same length and the key is found in different position in each file.
How can I solve this?
Now the question.
what should be the syntax on Join Statement to also have the paired records on a third file?
thank you in advance
_________________
shikoulitz