Author: nartcr
Subject: Syncsort Joinkey
Posted: Thu Jun 02, 2016 3:46 am (GMT 5.5)
I am trying to code something with Syncsort.
I have 2 input files of same length - 20 bytes. Field1 ( File 1, position 3 onwards for 5 bytes ) have to be compared with Field1 ( file 2, position 1 onwards for 5 bytes ). If they match, i want the field2 ( file 1, position 10 onwards for 4 bytes ) have to be matched with field 2 ( file 2, position 12 onwards for 4 bytes ). If i have a perfect match, i willl update the output file with last 5 bytes of output file, with contents of file 2.
output will have 1-15 contents copied from file 1. 16-20 contents from file 2. If there is match on field1 and field2, 16-20 should contain contents from file 2, otherwise it should contains the letters 'NMTCH'.
I have been reading the manuals, and i am kind of confused with sort keys. Especially since key is not unique here. i tried coding with sequence number. Is this even possible to code wih syncsort or icetool? Or should i code using programs instead?
Subject: Syncsort Joinkey
Posted: Thu Jun 02, 2016 3:46 am (GMT 5.5)
I am trying to code something with Syncsort.
Code: |
FILE1 FILE 2 COLUMNS COLUMNS 12345678901234567890 12345678901234567890 -------------------- -------------------- R1TEST1 NARA TEST1 REC1 NARA HOME R2TEST1 NARA TEST2 REC1 NARA LIBRA R2AMER1 NARA TEST2 REC1 AMAR GROUN R2AMER2 RAJE AMER1 REC1 NARA MOVIE R2TEST1 AMAR FILE 3 COLUMNS 12345678901234567890 -------------------- R1TEST1 NARA HOME R2TEST1 NARA HOME R2AMER1 NARA MOVIE R2AMER2 RAJE NMTCH R2TEST1 AMAR NMTCH |
I have 2 input files of same length - 20 bytes. Field1 ( File 1, position 3 onwards for 5 bytes ) have to be compared with Field1 ( file 2, position 1 onwards for 5 bytes ). If they match, i want the field2 ( file 1, position 10 onwards for 4 bytes ) have to be matched with field 2 ( file 2, position 12 onwards for 4 bytes ). If i have a perfect match, i willl update the output file with last 5 bytes of output file, with contents of file 2.
output will have 1-15 contents copied from file 1. 16-20 contents from file 2. If there is match on field1 and field2, 16-20 should contain contents from file 2, otherwise it should contains the letters 'NMTCH'.
I have been reading the manuals, and i am kind of confused with sort keys. Especially since key is not unique here. i tried coding with sequence number. Is this even possible to code wih syncsort or icetool? Or should i code using programs instead?