Desktop productivity for business analysts and programmers

plz help on x cmd from base SAS

Accepted Solution Solved
Reply
Super Contributor
Super Contributor
Posts: 318
Accepted Solution

plz help on x cmd from base SAS

Hello please help me to write x command to copy single file. using Base SAS 9.1

I have &dir resolves to w:\woo\finance\

and    &fname resolves to send file name 09-18-2014.txt

and then i am using below x command to transfer the file

option noxwait;

data _null_;

x "copy &&dir..&fname \\server_path";

run;

this is not resolving to w:\woo\finance\send file name 09-18-2014.txt and file not getting transfer and giving warning message like


The quoted string currently being processed has become more than 262 characters long.

         You may have unbalanced quotation marks.

can someone please help???????


Accepted Solutions
Solution
‎09-18-2014 03:08 PM
Grand Advisor
Posts: 17,461

Re: plz help on x cmd from base SAS

If the path has spaces, it needs quotes around it as well. Find the command that works from the command line or a .bat file first then find a way to get SAS to accomplish the same.

Try using %sysexec if you want as well.

%sysexec copy "file path 1" "path 2";

View solution in original post


All Replies
Grand Advisor
Posts: 10,251

Re: plz help on x cmd from base SAS

x "copy &dir.&fname. \\server_path";

two .. in start had one resolve to w:\woo\finance\.send file name 09-18-2014.txt

Solution
‎09-18-2014 03:08 PM
Grand Advisor
Posts: 17,461

Re: plz help on x cmd from base SAS

If the path has spaces, it needs quotes around it as well. Find the command that works from the command line or a .bat file first then find a way to get SAS to accomplish the same.

Try using %sysexec if you want as well.

%sysexec copy "file path 1" "path 2";

Super Contributor
Super Contributor
Posts: 318

Re: plz help on x cmd from base SAS

Thanks Reeza & Ballardw...

x copy "&dir.&fname." "\\server path"; did work. Reeza, its good to know i can use %sysexec too...

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 361 views
  • 3 likes
  • 3 in conversation