Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You have several errors in your job including using LRECL=50 for the output data sets instead of LRECL=44, and a mismatch between your WITH(48,1) field and your 46:C'11' and 46:C'22' ids.
Here's a DFSORT/ICETOOL job that will do what I think you want:
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
I'm not connected to the network where the Syncsort documentation is stored, but i believe SPLICE is available in your release.
I also believe there is diagnostic info that you chose not to post. . . Among other things, the message ids are missing. . . These need to always be posted.
It will probably help someone help you if you post the complete jcl and control statements - not what you believe is needed (a very common time-waster)
Below is an alternative solution using the JOINKEYS feature:
Code:
//IBMFHELP EXEC PGM=SORT,COND=(0,LT)
//*
//******************************************************************
//*THIS SORT WILL COMPARE THE INPUT FILES AND WRITE THE DATA TO 1 OF 3
//*FILES:
//* 1). UNIQUE RECORDS FROM F1
//* 2). UNIQUE RECORDS FROM F2
//* 3). MATCHING RECORDS OR RECORDS FOUND ON F1 & F2
//******************************************************************
//*
//SORTJNF1 DD *
375206319452271 BISWARANJAN 10100681.ABXS.SE
375206321701130 MANAS 10100681.MNOP.SE
375206321704385 SONAL 10100681.QRST.SE
//SORTJNF2 DD *
375212349452279 DEVID 10100681.ABXS.SE
375206319452271 BISWARANJAN 10100681.ABXS.SE
375206321704385 SONAL 10100681.QRST.SE
//*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(001,044,A) *JNF1
JOINKEYS FILE=F2,FIELDS=(001,044,A) *JNF2
JOIN UNPAIRED
REFORMAT FIELDS=(F1:001,044,
F2:001,044)
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(45,01,CH,EQ,C' '),
OUTREC=(01:001,044,
46:C'11')
OUTFIL FNAMES=OUT2,
INCLUDE=(01,01,CH,EQ,C' '),
OUTREC=(01:045,044,
46:C'22')
OUTFIL FNAMES=OUT12,
INCLUDE=(01,44,CH,EQ,45,44,CH),
OUTREC=(01:001,044,
46:C'12')
//*
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//OUT12 DD SYSOUT=*
Results:
OUT1:
Code:
********************************* TOP OF DATA **********************************
375206321701130 MANAS 10100681.MNOP.SE 11
******************************** BOTTOM OF DATA ********************************
OUT2:
Code:
********************************* TOP OF DATA **********************************
375212349452279 DEVID 10100681.ABXS.SE 22
******************************** BOTTOM OF DATA ********************************
OUT3:
Code:
********************************* TOP OF DATA **********************************
375206319452271 BISWARANJAN 10100681.ABXS.SE 12
375206321704385 SONAL 10100681.QRST.SE 12
******************************** BOTTOM OF DATA ********************************
Can you please let me know how WITH(45,1) works? Meaning what does 45,1 stands for?
In CTL1 and CTL2 "11" and "22" got added at 45 and 46th position.
How the key "21" is added and compared?
//CTL3CNTL DD *
OUTFIL FNAMES=OUT12,INCLUDE=(45,2,CH,EQ,C'21'),OUTREC=(1,44)
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
biswaranjan,
You have the latest release of SyncSort installed. Why not go for the JOIN solution already provided. You can further simplify it by adding the SAVE parameter instead of the INCLUDE for OUT12 dd to capture the remaining records as below
Code:
OUTFIL FNAMES=OUT12,SAVE,
OUTREC=(
Frank is a DFSORT developer, he does not answer questions on SyncSort .