Variable length files matching records



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Variable length files matching records

Postby whowillwait4u » Thu Jun 28, 2012 3:55 pm

Hi,

I have two variable length files of LRECL 1296. There are no key fields.I want to match on whole records.If a record is present in both should go to BOTH.If a record is present only in file 1 it should go to F1ONLY.If a record is present only in file 2 it should go to F2ONLY.All 3 output files should be of fixed length with LRECL 1296. Fill the extra bytes with spaces.

Could you please help with DFSORT jcl needed?!
whowillwait4u
 
Posts: 15
Joined: Fri Feb 17, 2012 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable length files matching records

 

Re: Variable length files matching records

Postby NicC » Thu Jun 28, 2012 6:10 pm

The sort JCL is in the DFSORT manual - you will need to tailor it for your installation.

As for your joinkeys control cards - have you looked in the forum - done a search on joinkeys? It would apper that your requirements is a minimal joinkeys operation and plenty of examples exist.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Variable length files matching records

Postby BillyBoyo » Thu Jun 28, 2012 7:02 pm

One step with VTOF for each file.

Then a step for the joinkeys with UNPAIRED,F1,F2, specifying the full record as the key, using the ? in the REFORMAT and testing that/using SAVE for the split of the data into three files.

That plus the forum examples and the manual should get you started.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Variable length files matching records

Postby skolusu » Thu Jun 28, 2012 10:20 pm

Use the following DFSORT JCL which will give you the desired results
//STEP0100 EXEC PGM=SORT,REGION=0M                                             
//SYSOUT   DD SYSOUT=*                                               
//INA      DD DSN=Your Input VB file1,DISP=SHR                                     
//INB      DD DSN=Your Input VB file2,DISP=SHR                                     
//BOTH     DD SYSOUT=*                                               
//F1ONLY   DD SYSOUT=*                                               
//F2ONLY   DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  JOINKEYS F1=INA,FIELDS=(1,1296,A)                                 
  JOINKEYS F2=INB,FIELDS=(1,1296,A)                                 
  JOIN UNPAIRED                                                     
  REFORMAT FIELDS=(F1:1,1296,?,F2:1,1296)                           
  OUTFIL FNAMES=BOTH,INCLUDE=(1297,1,CH,EQ,C'B'),BUILD=(1,1296)     
  OUTFIL FNAMES=F1ONLY,INCLUDE=(1297,1,CH,EQ,C'1'),BUILD=(1,1296)   
  OUTFIL FNAMES=F2ONLY,INCLUDE=(1297,1,CH,EQ,C'2'),BUILD=(1298,1296)
//*                                                                 
//JNF1CNTL DD *                                                     
  INREC OVERLAY=(1296:X)                                             
//*                                                                 
//JNF2CNTL DD *                                                     
  INREC OVERLAY=(1296:X)                                             
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Variable length files matching records

Postby whowillwait4u » Tue Jul 03, 2012 6:47 pm

Thank you All!

I got what i am looking for. I did the same told by Billyboyo before posting this in forum. VTOF and JOINKEYs. But i wanted to reduce the number of steps in my JOB. skolusu gave me that. Thank buddies!. I appreciate your time!
whowillwait4u
 
Posts: 15
Joined: Fri Feb 17, 2012 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Variable length files matching records

Postby skolusu » Tue Jul 03, 2012 11:29 pm

whowillwait4u wrote:Thank you All!

I got what i am looking for. I did the same told by Billyboyo before posting this in forum. VTOF and JOINKEYs. But i wanted to reduce the number of steps in my JOB. skolusu gave me that. Thank buddies!. I appreciate your time!



You don't need VTOF as you can directly create the FB files. Use the following Control cards
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  JOINKEYS F1=INA,FIELDS=(5,1292,A)                                 
  JOINKEYS F2=INB,FIELDS=(5,1292,A)                                 
  JOIN UNPAIRED                                                     
  REFORMAT FIELDS=(F1:5,1292,?,F2:5,1292)                           
  OUTFIL FNAMES=BOTH,INCLUDE=(1293,1,CH,EQ,C'B'),BUILD=(1,1292)     
  OUTFIL FNAMES=F1ONLY,INCLUDE=(1293,1,CH,EQ,C'1'),BUILD=(1,1292)   
  OUTFIL FNAMES=F2ONLY,INCLUDE=(1293,1,CH,EQ,C'2'),BUILD=(1294,1292)
//*                                                                 
//JNF1CNTL DD *                                                     
  INREC OVERLAY=(1296:X)                                             
//*                                                                 
//JNF2CNTL DD *                                                     
  INREC OVERLAY=(1296:X)                                             
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post