BookmarkSubscribeRSS Feed
Top_Katz
Quartz | Level 8

Hi!  The Enterprise Guide Import Data Wizard makes it very easy to read files into a SAS Grid Server session directly from my local C: (or other) drive.  Can this be done with a SAS program?  When I look at the generated code from the Wizard, there's a crucial step missing.  The local file gets sucked up onto the server.  The generated code shows how to read the server copy of the file into SAS, but not how to get the file from the local drive onto the server.  Can this all be achieved within a SAS program?

Thanks!

4 REPLIES 4
SASKiwi
PROC Star

The SAS session you  are starting from EG runs on your remote SAS servers which aren't aware of local PC drives. Talk to your SAS administrator. Maybe there is a network folder share the SAS servers can reach, where you can drop the files you want to import. 

Top_Katz
Quartz | Level 8

Thank you for responding @SASKiwi .  If what you say is true, and as of now I have no reason to doubt it, I do feel disappointed.  After all, Enterprise Guide can communicate between my local drive and the server.  Why can't SAS do it too?  I understand that EG sits on my computer and knows how to locate the grid server because I gave it the grid server address. But then EG should be able to tell SAS where my computer is located; of course, SAS would have to have a way to use that information to reach back from the server to my computer, and it doesn't appear to have that capability.  Is my understanding correct?

SASKiwi
PROC Star

@Top_Katz  - "Enterprise Guide can communicate between my local drive and the server" -  correct, however the EG task that transfers files is built into the application itself. It is not SAS code that does this. When your EG runs SAS code, it is running it in a SAS session on your remote SAS application server. EG is handling all of the session communications - submitting programs and returning logs, data and results.

 

That remote SAS session can't "talk back" via EG to find out about your PC hardware - it is an architectural limitation. So that is why you can't run SAS code that references your local PC drives.

 

You could overcome that limitation by having a local SAS server running on your PC (a 'full' SAS installation) and communicating directly with your remote SAS server but that would be an expensive solution. Having a common folder share that your remote SAS server can reach is a far cheaper option. 

 

    

ErikLund_Jensen
Rhodochrosite | Level 12

Hi @Top_Katz 

Where do you want to run the SAS program?

 

Running the program in Display Manager on your PC requires a local SAS Foundation installed. In that case you can establish a remote connection to a GRID server context and allocate a library on the server as a remote library that is visible from the PC session. You would probably need to talk to your SAS administrator about which server context to login to, as she might have strong opinions about that.

 

If you don't have a local SAS and want to read the file with a SAS program running in the GRID, e.g. a program scheduled in DI Studio, the file must be transferred to a location where it is visible from the GRID. I use WinSCP to upload files to Linux, but ic can also be done from a Windows command line and scheduled on the PC, if it is a recurring task. Again - talk to your SAS administrator about a location where you can write files.

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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