View previous topic :: View next topic
|
Author |
Message |
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
FIle1
Code: |
BABY12345
BOBY12345
POPY12345
JABBY7765
|
File2
Code: |
ABBY45678
BABY09875 CA
JABBY5566 DR
JABBY1123 GA
LABBY9900
QABY1100
BABY00997 DR
POPY00998 CA
POPY22334 MA
|
Output should be
File3
Code: |
BABY09875 CA
JABBY5566 DR
BABY00997 DR
POPY00998 CA
|
First 4 char is the keys for file1 and file2.File2 has to match with file1 with keys(1,4) and File2 to have either CA or DR. (or) File 1 has to match with File2 with keys(1,4) and file 2 have to have either CA or DR.
Could someone tell me the possible way to get this kind of output.
I have spend lot of effort to do this. but still the output is not as expected.
Thanks in advance. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
And now? |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Peter,
please find my updated post.
Thanks |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Could someone help me out? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
JOINKEYS will do the matching for you. INCLUDE on a JNFnCNTL file can be used to only match the CA/DR.
File 2 matching File 1 is the same as File 1 matching File 2, so I'm not sure why you repeated it. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Hi Bill Woodger,
can you please help me with an example?
it will be helpful
Thanks, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
please stop soliciting for replies
You should remember that
replying is on voluntary base
on our own time
free of charge
in less PC words when and if we feel like
and furthermore is saturday
for a question like the current one there are even too many examples on the forum
do a bit of research |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Examples in forums are confusing like anything.
Can any one please give an example for my requirement?
wanna go home???? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
JOINKEYS F1=INA,FIELDS=(1,4,A)
JOINKEYS F2=INB,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:1,12,F2:13,2)
OPTION COPY
//JNF2CNTL DD *
INCLUDE COND=(13,2,SS,EQ,C'CA,DR') |
|
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
getting this error
Code: |
JOINKEYS F1=INA,FIELDS=(1,10,A)
*
JOINKEYS F2=INB,FIELDS=(1,10,A)
*
REFORMAT FIELDS=(F1:1,10,F2:36,5465)
OPTION COPY
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
|
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Bill Woodger
Thank you so much for your help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Change F1 and F2 to FILES=F1 and F2 |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
it is working fine..
Thanks again |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
For non-SyncSort 1.4 users, move the INCLUDE to OUTFIL INCLUDE=. |
|
Back to top |
|
|
|