Help using Base SAS procedures

import/export from PC to UNIX

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

import/export from PC to UNIX

H,i

i am  running EG SAS remotly and i want to  import/export  files  from /to my PC . How do i do that?

 

i found  something online:

 

proc export data=work.temp outfile='Y:\WCR\test.xlsx' dbms=accesscs port=.. server=myserver;

but how do i find which port i need to use and  also myserver would be the windows server  right?  Can i  get  that info  from my system.

Please anyone

thx

 

 


Accepted Solutions
Solution
‎04-01-2017 10:14 AM
Super User
Posts: 17,750

Re: import/export from PC to UNIX

It sounds like with EG in a server set up. This means that SAS is no longer on your computer and ALL programs are essentially 'rsubmit' to the server by default.  You MAY have the option to run locally, if so you'll see a drop down to switch beside the RUN button that allows you to specify where your process is working. You can only work locally or on the server and not back and forth like you may have previously done.

 

You need to upload your Excel files to a server location and then use PROC IMPORT with the files on the server OR use the point and click interface to  import the files into your programs. It does make it hard to streamline processes. If you had access to X command or DDE those are likely gone as well. If your'e using the newest EG version, the copy files task should be installed to move your files onto the server. 

View solution in original post


All Replies
Super User
Posts: 17,750

Re: import/export from PC to UNIX

You're better off asking a colleague for instructions because set ups vary so you need to know how your system is set up.

 

In general, you should be able to use the GUI import/export in EG. 

 

If you want to do it using a program you should upload/move the excel file to the server first, because the server won't see your local drive. Unless you're running EG locally, but i suspect you're on a server. 

Super Contributor
Super Contributor
Posts: 440

Re: import/export from PC to UNIX

thanks Reeza for the answer

All my co workers are using and  been using pc sas and  now we are all switching to EG and none of us  has a  clue how to get import and  export files  from and  back to PC

So anyhting like signon/resubmit.... wont work here the way it works  when  u accessing unix  from pc  remotly?

Thsi  might be  a silly  question but i dont have much knowledge about it

Solution
‎04-01-2017 10:14 AM
Super User
Posts: 17,750

Re: import/export from PC to UNIX

It sounds like with EG in a server set up. This means that SAS is no longer on your computer and ALL programs are essentially 'rsubmit' to the server by default.  You MAY have the option to run locally, if so you'll see a drop down to switch beside the RUN button that allows you to specify where your process is working. You can only work locally or on the server and not back and forth like you may have previously done.

 

You need to upload your Excel files to a server location and then use PROC IMPORT with the files on the server OR use the point and click interface to  import the files into your programs. It does make it hard to streamline processes. If you had access to X command or DDE those are likely gone as well. If your'e using the newest EG version, the copy files task should be installed to move your files onto the server. 

Super Contributor
Super Contributor
Posts: 440

Re: import/export from PC to UNIX

Thx Reeza. Its EG SAS 5.1 so no i would not have that "copy files" feature and i cannot even create folders in PC from UNIX right? Anything there équivalent to the x command that windows has?
Super User
Posts: 17,750

Re: import/export from PC to UNIX

You can download and use the COPY task, you may need administrative privileges. 

Regarding X privileges, it depends on what you're trying to do. You can determine folder listings and files using FINFO functions. There's a macro inside the SAS 9.4 appendix that shows how. I think it will still work on your system if you're a few versions behind. 

Super User
Posts: 17,750

Re: import/export from PC to UNIX

You can download and use the COPY task, you may need administrative privileges. 

Regarding X privileges, it depends on what you're trying to do. You can determine folder listings and files using FINFO functions. There's a macro inside the SAS 9.4 appendix that shows how. I think it will still work on your system if you're a few versions behind. 

Super Contributor
Super Contributor
Posts: 440

Re: import/export from PC to UNIX

Thx Reeza.
I looked for the copy files package and could not find it.
This site says its there but i dont see it:
http://blogs.sas.com/content/sasdummy/2016/11/14/copy-files-task-moved-menus/
Do you know if it can be found under a different name?

In terms of the x commands... I just want to create folders to my pc (share srive)from my EG(remote sas sessions)
Something that you can do easily on pc sas:
X mkdir '\......."
Looked at those macros in the appendix none seems to take care of it
Super User
Posts: 17,750

Re: import/export from PC to UNIX

If the server has access to the shared drive this is possible. If it doesn't have access then it's likely not possible. 

 

You can look at several SAS functions to create the directory. 

http://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/

 

Another option is DCREATE() function to create directories. Again, these all require the server to have access to the shared drive. 

 

Super Contributor
Super Contributor
Posts: 440

Re: import/export from PC to UNIX

this is really  helpful

thanks Reeza

☑ This topic is SOLVED.

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

Discussion stats
  • 9 replies
  • 252 views
  • 1 like
  • 2 in conversation