download data through ssh

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

download data through ssh

Hi all. I am merging data from wrds through ssh. I submitted batch job to the server, but what I get is log file only. How can I get the data file (.sas7bdat) I merged? Thanks


Accepted Solutions
Solution
‎06-27-2016 10:27 PM
Super User
Posts: 6,963

Re: download data through ssh

You need to determine the phyiscal location of the dataset.

- get the library name from the step where the dataset is created

- look for the corresponding libname statement, or look into the metadata where the library is defined, and get the file path from there

- use sftp or one of the WIndows-based clients (eg WinSCP) to copy the file.

 

If you created the dataset in WORK, you will never be able to retrieve the dataset, as WORK is transient and deleted once the batch run ends.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Trusted Advisor
Posts: 1,131

Re: download data through ssh

we use the ssh (secure shell) command to connect to the server and the scp (secure copy) command to copy the files into or between the servers.
Thanks,
Jag
Super User
Posts: 9,687

Re: download data through ssh

Can you use CURL command to get that file ?

Solution
‎06-27-2016 10:27 PM
Super User
Posts: 6,963

Re: download data through ssh

You need to determine the phyiscal location of the dataset.

- get the library name from the step where the dataset is created

- look for the corresponding libname statement, or look into the metadata where the library is defined, and get the file path from there

- use sftp or one of the WIndows-based clients (eg WinSCP) to copy the file.

 

If you created the dataset in WORK, you will never be able to retrieve the dataset, as WORK is transient and deleted once the batch run ends.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 2

Re: download data through ssh

Thanks a lot. No wonder I can't find data every time. When I libname to home directory, it does work. However, the storage of home directory is limited. I tried to libname to local computer file, but it shows the library does not exist. Is there a way I can save the data to local computer directly? Thanks

Super User
Posts: 6,963

Re: download data through ssh

You can only define a libname in SAS for a directory that is present in the SAS servers filesystem and where you (as user) have the necessary permissions (read and execute in UNIX).

If you want to write to your local PC, a network connection has to exist (as a mounted directory on your SAS server) that represents a storage resource on your PC.

I would NOT recommend this. Local PCs are rarely included in a company-wide backup/retrieval architecture; a sinlge failed disk can ruin years of work.

Instead have a talk with your system admin for the SAS server, and request a storage resource for your data on the server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 382 views
  • 0 likes
  • 4 in conversation