Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Aug 08, 2011 10:31 am Post subject:
prog_mario,
For case b & C you want the same letter at the end? Assuming your input file lrecl is 80, recfm of FB and the key to match records is in pos 1 for a length of 5, the following DFSORT JCL will give you the desired results. The indicator is at the 81'st position.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
11111 - I EXIST ONLY IN FILE 1
22222 - BOTH FILES HAS ME
//INB DD *
22222 - BOTH FILES HAS ME
33333 - I EXIST ONLY IN FILE 2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,5,A)
JOINKEYS F2=INB,FIELDS=(1,5,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,80,F2:1,80,?)
INREC IFOUTLEN=81,
IFTHEN=(WHEN=(161,1,CH,EQ,C'1'),BUILD=(1,80,C'D')),
IFTHEN=(WHEN=(161,1,SS,EQ,C'2,B'),BUILD=(81,80,C'C'))
//*
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Aug 08, 2011 11:19 am Post subject:
prog_mario,
The Job works fine with DFSORT. Your Error messages indicate you are using syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. _________________ Kolusu
www.linkedin.com/in/kolusu
While the same basic process will work with both sorts, you must follow the syntax rules for each product. . .
I don't have Syncsort reference material with me, but the problem you are having is somethng you should readily see if you look in the Syncsort documentation. If you don't have the documentation and your organization is licensed to use the product, you may get the material for free from Syncsort support. _________________ All the best,
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum