anatol
Active User
Joined: 20 May 2010 Posts: 121 Location: canada
|
|
|
|
I have two datasets:
First :
aaaa 124
bbbb 138
cccc 100
Second
aaaa 100
bbbb 140
cccc 100
is it possible to compare them and split it on to 3 datasets by digital values 1 where value less in the first file, 2 value is more than in first file, 3 value is equal
1st bbbb
2nd aaaa
3rd cccc |
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
anatol,
Because you haven't responded to all the questions asked, I am going to assume "few" things. In the REFORMAT, I am selecting entire record from from both the files but finally writting fields from first file only. While this can be changed,I also assumed 80 byte FB input files. I am creating 3 files, DMORE(Digital Value of file1 greater than file2), DLESS and DSAME.
See if below job works...
Code: |
//STEP0001 EXEC PGM=SORT
//SORTJNF1 DD *
AAAA 124
BBBB 138
CCCC 100
//SORTJNF2 DD *
AAAA 100
BBBB 140
CCCC 100
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,4,A)
JOINKEYS FILE=F2,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:1,80,F2:1,80)
OPTION COPY
OUTFIL FNAMES=DLESS,INCLUDE=(6,3,ZD,LT,86,3,ZD),BUILD=(1,80)
OUTFIL FNAMES=DMORE,INCLUDE=(6,3,ZD,GT,86,3,ZD),BUILD=(1,80)
OUTFIL FNAMES=DSAME,INCLUDE=(6,3,ZD,EQ,86,3,ZD),BUILD=(1,80)
/*
//DLESS DD SYSOUT=*
//DMORE DD SYSOUT=*
//DSAME DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=* |
Thanks, |
|