title: compare two files then matched and umtached records to copy two diff files
body: <p>I have requirement to compare two files then matched records one file and unmatched into another file using joinkeys in jcl .I'm not sure whether this is the correct one or not. Could you, please, help me?
  the first input file having the only 18 record length which will compare to input2 first 18 length .if it match then we will wrire record into output file based on the buid condtion and if doesnot match then copy th record into another file </p>
  
  <pre><code>SORT FIELDS=COPY                             
  JOINKEYS FILE=F1,FIELDS=(1,18,A)             
  JOINKEYS FILE=F2,FIELDS=(1,18,A)             
  REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2) 
  OUTFIL FNAMES=MATCH                          
  SORT FIELDS=COPY                             
  JOINKEYS FILE=F1,FIELDS=(1,18,A)             
  JOINKEYS FILE=F2,FIELDS=(1,18,A)             
  JOIN UNPAIRED,F2,ONLY                        
  REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2) 
  OUTFIL FNAMES=UNMATCH                        
  </code></pre>