Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

DFSORT/ICETOOL :: Joinkeys with condition

$
0
0
Author: scdinesh
Subject: Joinkeys with condition
Posted: Tue Feb 14, 2017 12:20 am (GMT 5.5)

Hi,
Appreciate your help on following requirement:

I've 2 input files(File1 with length:437 and file2 with length:46), with the below sort card am able to create an output(file length:500) which is working as expected:
Code:
//COMPARE  EXEC PGM=SORT                                       
//UNLD   DD DSN=INPUT.FILE1,DISP=SHR                                         
//EXTRCT  DD DSN=INPUT.FILE2,DISP=SHR                         
//SORTOUT  DD DSN=OUTPUT.FILE1,DISP=(,CATLG)                       
//SYSIN    DD *
SORT FIELDS=COPY                           
JOINKEYS F1=UNLD,FIELDS=(7,20,A)         
JOINKEYS F2=EXTRCT,FIELDS=(27,20,A)       
JOIN UNPAIRED,F1                           
REFORMAT FIELDS=(F2:5,20,F2:25,2,F1:1,437) 


based on above results(derived from sortout(file) results),Now I need to add 2 more output files(in this same step), if I see spaces in 1st 20 character(1,20,CH,EQ,C' ') of OUTPUT.FILE1 need to write output file2 and if there is no spaces(1,20,CH,NE,C' ') need to write output file3

Thanks in advance

CODED and moved to the correct forum, please bear this in mind in the future


Viewing all articles
Browse latest Browse all 8500

Trending Articles