Tom - below code is working fine except for "NJ" path. i am getting "copycmd" var exactly like mentioned below but not getting anything for NJ path in second "data both" step... -------------------------------------------------------------------------------------------------------------------------- /*i am not getting value for NJ path for this variable*/ copycmd copy "f:\woo\db\USUser1_market.mdb" "f:\transfer\mdb\ny\USUser1_market.mdb" copy "f:\woo\db\USUser2_market.mdb" "f:\mkt\files\pa\USUser2_market.mdb" copy "f:\woo\db\USUser3_market.mdb" "f:\transfer\mdb\ny\USUser3_market.mdb copy "f:\woo\db\USUser4_market.mdb" "f:\mkt\files\pa\USUser2_market.mdb" ------------------------------------------------------------------------------------------------------------------------ /*i have different path name for my original code but path contains same space, & and - (hyphen) signs for NJ path*/ getting this warning message: WARNING: In a call to the CATX function, the buffer allocated for the result was not long enough to contain the concatenation of all the arguments. The correct result would contain 203 characters, but the actual result may either be truncated to 200 character(s) or be completely blank, depending on the calling environment. The following note indicates the left-most argument that caused truncation. --------------------------------------------------------- proc format; value $ location "NY"="f:\transfer\mdb\ny" "PA"="f:\mkt\files\pa" "NJ"="f:\shares\market database\design & dev\business applications\finance - planning\nj"; run; %let path=f:\woo\db ; data files ; infile "dir /b &path\*.mdb" pipe truncover lrecl=256 ; input filename $256. ; username = scan(filename,1,'_'); run; data both ; merge files (in=in1) control (in=in2); by username ; if in1 ; targetdir = put(location,$location.); run; data both ; merge files (in=in1) control (in=in2); by username ; if in1 ; targetdir = put(location,$location.); copycmd = catx(' ','copy' ,quote(cats("&path\", filename)) ,quote(cats(targetdir)) ); run; data _null_; set both ; infile cmd pipe filevar=copycmd ; input @; run;
... View more