Page 1 of 1

JOINKEYS UNPAIRED REFORMAT

PostPosted: Tue Aug 11, 2015 2:51 pm
by gauravfrankly
I have 2 files, (F1 and F2). both have LRECL=80
I have to compare these file records and have to find out the UNPAIRED records in F1 and F2.
donot have any column that can be used as key, so using complete record as key.
* Control statements for JOINKEYS application
JOINKEYS FILE=F1,FIELDS=(1,80,A)
JOINKEYS FILE=F2,FIELDS=(1,80,A)
JOIN UNPAIRED,F1,F2,ONLY
REFORMAT FIELDS= *************
* Control statements for main task (joined records)
OPTION COPY
Please give me the REFORMAT FIELDS code, to get this done.

Re: JOINKEYS UNPAIRED REFORMAT

PostPosted: Tue Aug 11, 2015 3:57 pm
by BillyBoyo
Please use the Code Tags to preserve spacing, and don't use all-caps for titles. The time that you are prepared to put into something often relates to the time that we then put into something.

Have a look in the documentation about how to create a REFORMAT statement. In your case it is simple, especially if you use the "match marker", the question-mark (?). You basically want "entire F1 record" followed by "entire F2 record" followed by the match-marker. You then interrogate (IFTHEN=(WHEN=(logicalexpression) the match-marker to know which data area is actually valid on the current REFORMAT record.