BookmarkSubscribeRSS Feed
vivekpn_sas
Calcite | Level 5
Hi experts,

I need a very genuine help for my project . Wants to code the copying file from sas to local pc so I can automate it to SMC. Pls advice if it's possible to code it through SAS
7 REPLIES 7
Kurt_Bremser
Super User

I suggest to use a shared network resource that is accessible both from your client and the SAS server.

Copying from a SAS program on the server directly to your PC requires that your PC is up and running all the time, and running file transfer server software, something which is usually not appreciated by IT people.

vivekpn_sas
Calcite | Level 5
Thanks for your response first. I am trying to copy to a shared windows path only. But not sure of what is the code to do so. To copy a file from sas to windows shared path
Kurt_Bremser
Super User

If you want to share a SAS dataset, you just define a library (LIBNAME) to the shared location and use it to create the dataset.

if you want to share the output of a procedure, use the appropriate path to the shared resource in the respective ODS statement.

Similarly, you can use the path to the shared resource in FILENAME or FILE statements when exporting to external files, or in the OUTFILE= option of the PROC EXPORT statement.

 

The most important part is that the shared resource has to be available on the SAS server. If that is a Windows system, the UNC path should work, if it is Linux/UNIX, you need the shared resource mounted on the server.

vivekpn_sas
Calcite | Level 5
As per my understanding we can't use proc export to copy a dataset nor naming a windows paths to a library will work. Can u share the piece of code. Anyone knows it pls share I will try in my system of it works
Kurt_Bremser
Super User

Before we start tinkering with SAS code, we need to make sure that the shared resource is available on the server. Log on to it with your SAS userid using any kind of SSH client, and see if you can navigate there; if you have trouble with this, get in touch with your server admins.

SASKiwi
PROC Star

What does "so I can automate it to SMC" mean? Why do you need to copy a SAS dataset to your local PC? If your Windows(?) SAS server storage is accessible via file shares it could be as simple as going into Windows Explorer and doing a copy and paste.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 7 replies
  • 1246 views
  • 0 likes
  • 3 in conversation