Oh and for date comparisons it is best to have the dates be in a sortable format, e.g. yyyymmdd if you want the comparison to work as you expect. -- bc
On Thu, Aug 7, 2014 at 1:22 PM, Bob Cronin <[email protected]> wrote: > What are you missing? Perhaps that pick's compare is not arithmetic? When > comparing numbers I generally arrange for them to be the same length and > padded with leading zeros and it seems to work ok. > -- > bc > > > On Thu, Aug 7, 2014 at 1:09 PM, Miguel Soltero Diaz <[email protected]> > wrote: > >> Hi guys, >> I am trying to update a date which is the 8th word in PREVIOUS with the >> 2nd word in UNIQUE when the last one is greater. >> PREVIOUS contains 13 words & UNIQUE only 2. So, MATCHED & JOINED should >> be 15 words. >> SPEC READ both files seem to be working fine. However, when using PICK >> and comparing words 8 and 15, doesn't give the results I wanted. So I >> changed to compare with word 14 wich give me better results in file >> CHANGED. However, not what I need. File CHANGED is missing one record I >> need (THIBAUT) and adding a record shouldn't be there (HARDING). >> Same happened when I use JOIN instead of SPECS READ. >> What am I missing from PICK? >> and CHANGE stage eventhough is accepting the parms is not doing anything. >> What am I missing? >> >> included the files at the end. Obviously they are edited. >> one more thing. when editing JOINED file to see the end of the record >> with VERIFY 1 *, I can see the appended words with a blank space added >> before the first word in a second line. Not that I need, but why is that? >> One record look like this >> ===== ULTRAG|TOLKIEN|Lord of the Ring >> |00000|0000000|03/17/1999|06/27/2014|08/04/2014|N|6|S@ULTRAG||USGX| <-- >> first line >> TOLKIEN|07/31/2014| <--second >> line. see the space before TOLKIEN? >> >> Thanks guys >> >> Miguel Soltero Diaz. >> >> 'pipe (sep ! endchar ?)', >> '< 'thishost' UNIQUE', /* contains 2 >> words. 2nd word is a date. */ >> '! a1: LOOKUP pad blank ws | w1 ws | w2 master details', >> '! > 'thishost' MATCHED A', >> '! SPECS 1-* 1 read 1-* n ', /*should >> contain 15 words*/ >> '! > 'thishost' JOINED A', >> '! PICK wordsep | w8 << w14', /* dates. if date in >> w15 is greater*/ >> '! CHANGE /word 8/word 14/', >> '! > 'thishost' CHANGED A', >> '?', >> '< 'thishost' PREVIOUS', /*contains 13 >> words */ >> '! a1:', >> '! > 'thishost' ERRDET A', >> '?', >> ' a1:', >> '! > 'thishost' REST A' >> Exit rc >> >> ULTRAG JOINED >> ULTRAG|ROBIN|VAN PERSIE, >> ROBIN|00000|0000000|07/13/2006||07/01/2014|N|6|S@ULTRAG|3|TPSX| >> ROBIN|07/31/2014| >> ULTRAG|ROBIN1|S%40ULTRAG|00000|0000000|03/28/2012||09/06/2013|N|6|S@ULTRAG >> |138|USGX| >> ROBIN1|07/31/2014| >> ULTRAG|THIBAUT|COURTOIS, >> THIBAUT|00000|0000000|08/31/2002|07/07/2014|07/07/2014|N|6|S@ULTRAG|26147|USGX| >> <--missing >> THIBAUT|07/31/2014| >> ULTRAG|KOBE|BRYANT, KOBE|00000|0000000|06/16/2011||01/13/2014|N|6|S@ULTRAG >> |26147|TPSX| >> KOBE|08/01/2014| >> ULTRAG|BATMAN|BATMAN MISS >> ROBIN|00000|0000000|09/09/1991|05/13/2014|08/01/2014|N|1|10490||USGX| >> BATMAN|07/31/2014| >> ULTRAG|ROBOCOP|DON’T >> REMEMBER|00000|0000000|11/24/1993|05/30/2014|07/31/2014|N|6|S@ULTRAG >> ||USGX| >> ROBOCOP|07/31/2014| >> ULTRAG|TOLKIEN|Lord of the Ring >> |00000|0000000|03/17/1999|06/27/2014|08/04/2014|N|6|S@ULTRAG||USGX| >> TOLKIEN|07/31/2014| >> ULTRAG|CHAMPION2|GERMANY NATL >> TEAM|00000|0000000|08/04/1999||06/27/2014|N|6|S@ULTRAG|1945|TPSX| >> CHAMPION2|07/31/2014| >> ULTRAG|FANTAST4|Grimm, Ben >> |00000|0000000|10/05/1993|06/02/2014|08/04/2014|N|1|1043||USGX| >> FANTAST4|07/31/2014| >> ULTRAG|CMSPIPE|Plumber Learning >> |00000|0000000|02/10/2014|05/27/2014|08/01/2014|N|1|29109||USGX| >> CMSPIPE|07/31/2014| >> ULTRAG|DONOVAN|Donovan, >> Brandon|00000|0000000|03/01/2010|07/01/2014|07/01/2014|N|8|2427||USGX| >> DONOVAN|07/31/2014| >> ULTRAG|IRONMAN|Stark, >> Tony|00000|0000000|09/11/2013|05/20/2014|08/04/2014|N|1|2334||USGX| >> IRONMAN|07/31/2014| >> ULTRAG|BUELENS|Buelens, >> Kris|00000|0000000|03/21/2012|08/01/2014|05/07/2014|N|2|21245||USGX| >> BUELENS|07/31/2014| >> ULTRAG|RVDHEIJ|VAN HEIJ, >> ROB|00000|0000000|04/24/2012|06/18/2014|07/23/2014|N|2|2187||USGX| >> RVDHEIJ|07/31/2014| >> ULTRAG|KNICKER|KNICKERBOCKER, >> GLENN|00000|0000000|04/14/1999|06/10/2014|08/05/2014|N|6|S@ULTRAG >> |959|USGX| >> KNICKER|07/31/2014| >> ULTRAG|HARTMANN|Hartmann, >> John|00000|0000000|07/22/1991|06/10/2014|08/04/2014|N|6|S@ULTRAG||USGX| >> HARTMANN|07/31/2014| >> ULTRAG|WALTER|Walter, >> Mike|00000|0000000|05/06/1999|06/10/2014|08/04/2014|N|6|S@ULTRAG >> |9059|USGX| >> WALTER|07/31/2014| >> ULTRAG|ACKMAN|Alan|00000|0000000||07/01/2014|08/04/2014|N|1|1040||USGX| >> ACKMAN|07/31/2014| >> ULTRAG|HARDING|Harding, >> Michael|00000|0000000|01/06/2009||08/04/2014|N|6|S@ULTRAG|3492|TPSX| >> HARDING|07/31/2014| >> ULTRAG|RONALD|Van Der Lann, >> Ronald|00000|0000000|12/06/2013|07/03/2014|07/15/2014|N|2|276||GONE| >> RONALD|07/31/2014| >> >> ULTRAG CHANGED >> ULTRAG|ROBIN|VAN PERSIE, >> ROBIN|00000|0000000|07/13/2006||07/01/2014|N|6|S@ULTRAG|3|TPSX| >> ROBIN|07/31/2014| >> ULTRAG|ROBIN1|S%40ULTRAG|00000|0000000|03/28/2012||09/06/2013|N|6|S@ULTRAG >> |138|USGX| >> ROBIN1|07/31/2014| >> ULTRAG|KOBE|BRYANT, KOBE|00000|0000000|06/16/2011||01/13/2014|N|6|S@ULTRAG >> |26147|TPSX| >> KOBE|08/01/2014| >> ULTRAG|CHAMPION2|GERMANY NATL >> TEAM|00000|0000000|08/04/1999||06/27/2014|N|6|S@ULTRAG|1945|TPSX| >> CHAMPION2|07/31/2014| >> ULTRAG|DONOVAN|Donovan, >> Brandon|00000|0000000|03/01/2010|07/01/2014|07/01/2014|N|8|2427||USGX| >> DONOVAN|07/31/2014| >> ULTRAG|BUELENS|Buelens, >> Kris|00000|0000000|03/21/2012|08/01/2014|05/07/2014|N|2|21245||USGX| >> BUELENS|07/31/2014| >> ULTRAG|RVDHEIJ|VAN HEIJ, >> ROB|00000|0000000|04/24/2012|06/18/2014|07/23/2014|N|2|2187||USGX| >> RVDHEIJ|07/31/2014| >> ULTRAG|HARDING|Harding, >> Michael|00000|0000000|01/06/2009||08/04/2014|N|6|S@ULTRAG|3492|TPSX| >> >> HARDING|07/31/2014| <-- this record shouldn’t be >> here >> ULTRAG|RONALD|Van Der Lann, >> Ronald|00000|0000000|12/06/2013|07/03/2014|07/15/2014|N|2|276||GONE| >> RONALD|07/31/2014| >> > >
