View previous topic :: View next topic
|
Author |
Message |
kris_madras
New User

Joined: 04 Jul 2005 Posts: 42
|
|
|
|
I have two input files.
File-1
File-2
I am checking for the options to get below output file using SYNCSORT.
Output
Code: |
AAAAA 1234567
BBBBB 1234567
CCCCC 1234567 |
While the JOIN KEYS and REFORMAT is one option but it works only on KEYS. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2218 Location: USA
|
|
|
|
To JOINKEYS, use any existing field with blank character from each file.
If by a chance there are no such fields, append them using INREC OVERRIDE= parameters in two //JNF1CNTL and //JNF2CNTL DD control statements. |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3098 Location: NYC,USA
|
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2218 Location: USA
|
|
|
|
This sample is too sophisticated for no reason.
Everything is much easier:
Code: |
//SYSIN DD *
JOINKEYS F1=FILE1,FIELDS=(6,1,CH,A)
JOINKEYS F2=FILE2,FIELDS=(8,1,CH,A)
REFORMAT BUILD=(F1:1,6,F2:1,8)
SORT FIELDS=COPY
END
//* |
|
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3098 Location: NYC,USA
|
|
|
|
Yes but point is please search as there are so many such topics discussed in past ..
I would use at least 80,1 as key if it needs that way .. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2218 Location: USA
|
|
|
|
Rohit Umarjikar wrote: |
Yes but point is please search as there are so many such topics discussed in past ..
I would use at least 80,1 as key if it needs that way .. |
(80,1) needs to be appended to both input files. In this particular case there is no need for this extra activity. I prefer to leave things as simple as possible. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2218 Location: USA
|
|
|
|
BTW
If the real "File-2" always has only one single "record", then the same thing becomes even more trivial.
Code: |
//SYSIN DD *
INFILE BUILD=(1,5,X,C'1234567',X)
SORT FIELDS=COPY
END
//* |
From the initial topic absolutely no detail is clear: RECFM=? LRECL=?, for both input and output files...
If both files are unlimited in size, then even 1000 records + 1000 records input files should produce 1,000,000 output records! |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3098 Location: NYC,USA
|
|
|
|
👍Agree |
|
Back to top |
|
 |
|