Join files using SYMNAMES



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

Join files using SYMNAMES

Postby javivi » Mon Jun 06, 2011 5:13 pm

Hi

I'm using the SYMNAMES file to join files with JOINKEYS. It work but I have the problem that when I want to build a output file I can't use the fields names on SYSMNAMES because the position of the files are relatives from the begining of the file and as I'm using the REFORMAT card, it don't work correctley...

I meen

//SYMNAMES DD DISP=SHR,DSN=FICHE1                   
//         DD DISP=SHR,DSN=FICHE2
(the files:)
FILE1_REGIS,1,16
FILE1_FIELD1,1,4,CH
FILE1_FIELD2,5,2,CH
FILE1_FIELD3,7,10,CH

FILE2_FIELD,1,17
FILE2_FIELD1,1,4,CH
FILE2_FIEL2,5,7,CH
FILE2_FIELD3,12,6,CH

FILE1 RECORDS:
0001AA1111111111
0002BB2222222222
0003CC3333333333

FILE2_RECORDS:
00020000001YYYYYY
00030000003ZZZZZZ


OUTPUT FILE
0002BB0002BB22222222220

//SYSIN DD *                                                           
  SORT FIELDS=COPY                                                     
  JOINKEYS FILE=F1,FIELDS=(FILE1_FIELD1,A),                             
           INCLUDE=(FILE1_FIELD1,EQ,C'0011',AND,                             )
  JOINKEYS FILE=F2,FIELDS=(FILE2_FIELD1,A)                               
  JOIN UNPAIRED,F1                                                     
  REFORMAT FIELDS=(F1:FILE1_REGIS,F2:FILE2_REGIS,?),FILL=C'*'           
  OUTFIL FNAMES=SALIDA,                                                 
         INCLUDE=(34,1,CH,EQ,C'B'),                                   
           BUILD=(FILE1_FIELD1,FILE1_FIELD2,FILE2_FIELD1,FILE2_FIELD2,FILE2_FIELD3)
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join files using SYMNAMES

Postby Frank Yaeger » Mon Jun 06, 2011 11:19 pm

I think you're saying that you can't use the File1 and File2 symbols for the OUTFIL statement. That's correct because the OUTFIL statement references the fields from the reformatted record created by the REFORMAT statement. You would need to specify a new set of Symbols for the fields in the reformatted record created by the REFORMAT statement and use those symbols with OUTFIL BUILD.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Join files using SYMNAMES

Postby javivi » Thu Jun 09, 2011 6:52 pm

Thanks Frank.
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post