BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

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???????

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

3 REPLIES 3
ballardw
Super User

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

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

Reeza
Super User

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";

woo
Lapis Lazuli | Level 10 woo
Lapis Lazuli | Level 10

Thanks Reeza & Ballardw...

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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