Write and run SAS programs in your web browser

SAS Studio: Accessing PC/Local files

Reply
New Contributor
Posts: 2

SAS Studio: Accessing PC/Local files

Using SAS Stuido (9.4) to write and execute code on a remote LINUX server. I have jobs that need to import or export files from/to my PC. I am begining to think that this is not a built in capability with SAS Studio? With BASE SAS, I could simply do a proc import/export then proc upload/download. Not so with SAS Studio? If not, can someone explain why SAS would not allow that capability on SAS Studio?

 

Super User
Posts: 3,171

Re: SAS Studio: Accessing PC/Local files

The problem is you are comparing SAS installed on a PC with the exclusively server-based interface of SAS Studio. With SAS Studio your PC simply becomes a viewer of SAS running on a server so there is no connection to your PC's hard drive.

 

A common solution in this situation is to create a network folder share that is readable by both the SAS server and your PC. Then you can simply drop the files to be loaded into this folder where SAS can read them. You would reference this folder like this: //ServerName/Folder1/Folder2. I suggest you talk to your SAS administrator as this is going to require a server configuration change. 

New Contributor
Posts: 2

Re: SAS Studio: Accessing PC/Local files

Thank you for taking the time to respond. One quick follow-up ... The SAS Studio GUI actually provides a way to manually import PC files. So it can see the PC files if I opt to import them manually. But to do a proc import is not possible. Shouldn't they be able to allow the proc to do it if the GUI can?

 

I will talk to our SAS admin about your suggested solution. That makes sense.

Super User
Posts: 3,171

Re: SAS Studio: Accessing PC/Local files

In Enterprise Guide there is a similar manual task for uploading and downloading SAS data. The point being that once you move from SAS on a PC to a server-based thin client SAS interface like EG or SAS Studio you lose the ability to programmatically access PC data from SAS. There are many positives to thin client interfaces, but there are some restrictions too.  

Super User
Posts: 7,092

Re: SAS Studio: Accessing PC/Local files


CoolBreeze wrote:

Thank you for taking the time to respond. One quick follow-up ... The SAS Studio GUI actually provides a way to manually import PC files. So it can see the PC files if I opt to import them manually. But to do a proc import is not possible. Shouldn't they be able to allow the proc to do it if the GUI can?

 

I will talk to our SAS admin about your suggested solution. That makes sense.


Actually, it is not the SAS GUI per se that sees your local data, it is the web browser that provides this capability through javascript or a Java sandbox.

When you import PC files via SAS Studio, the web browser is used to read the PC data, the Java applet converts to text (if necessary) which is then copied to a temporary location on the server, where then (and only then) the workspace server (the SAS process itself) starts to read.

A proc import on its own needs someone else to move the data to the SAS server. That "someone else" is either the SAS Studio web app and it's PC parts (javascript, Java applet), or it is you. If you want to use proc import (or a data step) in manually created code, you need to provide for the data transfer yourself. You can use a shared network resource, or you can use a smiple SSH-based tool like WinSCP.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 7

Re: SAS Studio: Accessing PC/Local files

Hi,

I'm having the same questions as QuickBreeze.
I have to import file from my local computer into SAS Studio but automatically. So the manually way won't be usefull.
I understand that when you are on SAS Studio you're directly on the server. But I would like to know a way to create a "path" between my server and my local.

I don't have the SAS Studio University version so I can't create a Shared folder;

Is there a way to create one even with the SAS Studio mid_tier version ? or another way to use easilly proc import/export ?

Thank you in advance !
Super User
Posts: 7,092

Re: SAS Studio: Accessing PC/Local files


elisa_s wrote:
Hi,

I'm having the same questions as QuickBreeze.
I have to import file from my local computer into SAS Studio but automatically. So the manually way won't be usefull.
I understand that when you are on SAS Studio you're directly on the server. But I would like to know a way to create a "path" between my server and my local.

I don't have the SAS Studio University version so I can't create a Shared folder;

Is there a way to create one even with the SAS Studio mid_tier version ? or another way to use easilly proc import/export ?

Thank you in advance !

Read my last post thoroughly. The answer is still valid.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 7

Re: SAS Studio: Accessing PC/Local files

Yes thank you.

I'm not very familiar with neither shared network resource or winSCP. Still a little bit blurry for me Smiley Sad

When I look on the internet it seems that it's 2 differents software and it's quite complicated in my company to install new stuff. And the idea for me is not to move my local txt into the server (I can do it with fileZilla) but really to create like a "libname" on my local.

I was adviced to use fillename FTP but it didn't work so far.
Super User
Posts: 7,092

Re: SAS Studio: Accessing PC/Local files

Let's elaborate:

 

Your file sits on your local PC

The SAS process (which is executing on a server) needs to "see" that file.

 

Option 1: copy the file to the SAS server. This involves software like FileZilla or WinSCP, which might be scriptable. The necessary server processes for the needed SSH protocol are usually available on servers out of the box.

Option 2: filename FTP. This means that you somehow must make your PC a FTP server, more complicated than option 1. And you can only read text files with that.

Option 3: Make your SAS server a file server, and mount the exported directory on your PC (mounting is done with Windows Explorer). Needs configuration and possibly installation of software on the SAS server. After that you save to that location from your PC apps.

Option 4: Have a resource on a file server in your company, which you can access from your PC (something like a H:\ drive), mounted on the SAS server. You save to that location from your PC apps, and read from that location with SAS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 7

Re: SAS Studio: Accessing PC/Local files

Thank you ! Much clearer.

I will see with my IT for option 4.
Super User
Posts: 7,092

Re: SAS Studio: Accessing PC/Local files

Be aware of the different file/pathname syntax if the SAS server runs on any UNIX flavor.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 10 replies
  • 757 views
  • 2 likes
  • 4 in conversation