Page 1 of 1

missing output from joinkey processing

PostPosted: Wed Aug 16, 2017 10:24 pm
by sigmazen
Hi
I'm getting an unexpected result from my sort.

//STEP010  EXEC PGM=SORT                                
//SORTJNF1 DD *                                          
1000                                                    
1001                                                    
1003                                                    
1005                                                    
//SORTJNF2 DD *                                          
1000                                                    
1003                                                    
1007                                                    
//SORTOF01 DD SYSOUT=*                                  
//SORTOF02 DD SYSOUT=*                                  
//SORTOF03 DD SYSOUT=*                                  
//SYSOUT   DD SYSOUT=*                                  
//SYSIN    DD *                                          
  JOINKEYS FILES=F1,FIELDS=(1,4,A)                      
  JOINKEYS FILES=F2,FIELDS=(1,4,A)                      
  JOIN UNPAIRED,F1,F2                                    
  REFORMAT FIELDS=(?,F1:1,4,F2:1,4)                      
  SORT FIELDS=COPY                                      
  OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'B'),BUILD=(1:2,4)
  OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C'1'),BUILD=(1:2,4)
  OUTFIL FILES=03,INCLUDE=(1,1,CH,EQ,C'2'),BUILD=(1:2,4)
/*                                                      
 


The output for SORTOF01 is as expected: 1000 and 1003
The output for SORTOF02 is as expected: 1001 and 1005
However the output for SORTOF03 is a blank row instead of 1007
If I tweak the BUILD to 1:1,5 I can see the row starts with 2 so it looks to be working, just no output :(
And thoughts?
Thanks in advance
Cheers

Re: missing output from joinkey processing

PostPosted: Thu Aug 17, 2017 9:51 pm
by sigmazen
Figured it out.
Because the REFORMAT is essentially appending F1 and F2 I needed pull the data from further along the concatenated row, thus:

OUTFIL FILES=03,INCLUDE=(1,1,CH,EQ,C'2'),BUILD=(1:6,4)