View previous topic :: View next topic
|
Author |
Message |
Vidya Kajale
New User
Joined: 01 Jun 2010 Posts: 43 Location: India
|
|
|
|
Hi,
I have file1 having diffent fields in below format:
Plastic no. , IA cd, Country cd , ZIP , Currency cd, Fees, Currency fees
the data in these fileds is been repeated for same plastic no. 2 times
And file 2 having fileds as plastic no. ,country cd,currency cd and currency fees for each plastic no. repeated 2 times for two different countries.
I need to put data from file2 to file1 for each plastic no. present in file1 for the fields Country cd, currency cd and currency fees.
Can i achive these using easytrive or sort card.
Please educate me on these. |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
What you have tries so far?
Check for Sort Join keys. Your requirement seems to be easily doable with JOINKEYS
Regards,
Chandan |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi Vidya,
You could explain your requirement in simpler and better by posting the sameple records of
file1 and file2 and just post the needed output file quoting the keys
Ofcourse,while doing so please do it within code tags |
|
Back to top |
|
|
Vidya Kajale
New User
Joined: 01 Jun 2010 Posts: 43 Location: India
|
|
|
|
Hi,
If i need to repeate it 200 times in the same file for same platic no. for 200 different countries shall i write sort join 200 times for each country code. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
1) tell us what sort product You are using ...
( ICE .... IBM DFSORT, WER... SYNCSORT )
2) please refrain from using local jargon and filed names
we take the trouble of understanding Your problem...
please spare us the trouble of decrypting Your organization jargon
post ( as usual for <sort> requests ... )
recfm/lrecl of the input/output file
position/length/format of the fields of interest ( no cobol jargon please )
clear description of the process
sample of the input file[s]
example of the outputs expected |
|
Back to top |
|
|
Vidya Kajale
New User
Joined: 01 Jun 2010 Posts: 43 Location: India
|
|
|
|
Hi,
We are using sort product as SYNCSORT.
file1:
Code: |
123456 ZA 123.00 981
123456 ZA 123.00 981
123456 ZA 123.00 981
123455 ZP 123.00 981
123455 ZP 123.00 981
123455 ZP 123.00 981
123454 ZE 123.00 981
123454 ZE 123.00 981
123454 ZE 123.00 981
|
file 2:
Code: |
123456 UK 001 862
123456 UK 001 862
123456 UK 001 862
123455 US 002 861
123455 US 002 861
123455 US 002 861
123454 AF 003 860
123454 AF 003 860
123454 AF 003 860
|
expected o/p:
Code: |
123456 ZA UK 001 123.00 862 981
123456 ZA UK 001 123.00 862 981
123456 ZA UK 001 123.00 862 981
123455 ZP US 002 123.00 861 981
123455 ZP US 002 123.00 861 981
123455 ZP US 002 123.00 861 981
123454 ZE AF 003 123.00 860 981
123454 ZE AF 003 123.00 860 981
123454 ZE AF 003 123.00 860 981 |
Input file1 of 958 bytes FB.
file2: 800 bytes FB.
o/p of 958 bytes FB.
Your data was CODE' d for readability |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Which version of SyncSort?
Do you have support for JNFnCNTL files for JOINKEYS? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Bill,
From the input and output
I dont think TS needs to use JNFnCNTL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I am not a <sort> expert ...
but the logic tells me that the <TS> will have to add a sequence number to each entry in each group in order to match in strict sequence |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Enrico,
The <TS> needs to join based on Plastic no. and consider the file is sorted so he gets the output as is.(If I understand <TS> correctly) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
NOPE
each <plastic> contains three entries and even if the TS posted irrelevant info
I would assume ( to be on the safe side ) 1<>1 2<>2 3<>3 |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Ah I was so dumb on that .. I missed out a cartesian product
Thanks for the clarification Enrico
Apologies Bill |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The key is a six digit number. There are three on each file. Which will get you nine joins per key. If one file has duplicates removed (information is duplicated, so should not be a problem) then it will make processing more straighforward. Even de-dupe both, if possible, and output three records per match at the end. |
|
Back to top |
|
|
|