DATA Step, Macro, Functions and more

Reading a dataset on a Unix box from PC SAS

Reply
Occasional Contributor
Posts: 5

Reading a dataset on a Unix box from PC SAS

I need to use a dataset that resides on our primary SAS server, a Unix box, in a SAS program running on a local PC.
Super Contributor
Posts: 673

Re: Reading a dataset on a Unix box from PC SAS

Use remote login.
Super Contributor
Posts: 673

Re: Reading a dataset on a Unix box from PC SAS

I mean rsubmit.
Super Contributor
Super Contributor
Posts: 3,174

Re: Reading a dataset on a Unix box from PC SAS

If it is an "external" file (not a SAS file), use the FILENAME statement, presuming you have READ-access. Or if it is a SAS file / database, use the LIBNAME statement. Then in your SAS DATA / PROC step, you would refer to either the or , depending on the file / data type.

Suggest reviewing the SAS Language Dictionary on FILENAME / LIBNAME statements, and also refer to the SAS "companion" guide for your OS. These documents are accessible from the SAS.COM Support website.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 5

Re: Reading a dataset on a Unix box from PC SAS

It is a SAS data set, The libname docs don't mention a server connection, and refer me to the libname docs for my OS. Which OS, the one I am on, or the one I want to connect to? I haven't been able to find either.
Respected Advisor
Posts: 4,173

Re: Reading a dataset on a Unix box from PC SAS

Hi

If you have SAS/Connect licensed at your site (needed to connect your local SAS Server with the remote UNIX SAS Server) then you'll find the docu necessary in the SAS/Connect Users Guide.

The example sections might already give you all information you need - either Remote Library Services, or Data Transfer Services.

HTH
Patrick
SAS Employee
Posts: 27

Re: Reading a dataset on a Unix box from PC SAS

The best option would be SAS/CONNECT. You would need it licensed both on UNIX and on your PC.

If you don't have it licensed in both places, you could make a local copy of the dataset on your PC. But FTP alone won't be enough. SAS data sets are not compatible across operating systems. You will need to convert the data set for use on a PC using PROC CPORT.
Occasional Contributor
Posts: 5

Re: Reading a dataset on a Unix box from PC SAS

Thanks, but no cigar yet. We have SAS/Connect on both systems, and I have worked through the entire manual. I don't know enough to know which of the little detail settings I need to tweak. I just need a big picture. Right now I have been working with:
%let remhost = sascompute.wgu.edu;

options comamid=tcp remote=sascompute;

libname lhost 'c:\SAS Data';

/*************************************/
/* sign on and download data set */
/*************************************/

signon;

rsubmit;

libname rhost '/sasdata';

But can't even get the signon to work. It looks like there is a connection between session ID and server name, but I can't find how to associate them.
SAS Employee
Posts: 27

Re: Reading a dataset on a Unix box from PC SAS

Hi Mark,
Can you post your SAS log showing connection errors?
kind regards,
Daryl
Frequent Contributor
Posts: 91

Re: Reading a dataset on a Unix box from PC SAS

You'll need a connect script to do the actual logon to your UNIX system and then start SAS.
Occasional Contributor
Posts: 5

Re: Reading a dataset on a Unix box from PC SAS

Here is the log:

1 %let wrds = sascompute.wgu.edu.edu 23;
2 options comamid=TCP remote=wrds;
3
4 signon username=wgusas password = XXXXXXXX;
NOTE: Remote signon to WRDS commencing (SAS Release 9.02.02M2P090109).
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: The connection was refused.
ERROR: Remote signon to WRDS canceled.
5
6 options nocenter nodate nonumber ls=max ps=max;
7
8 libname ibeslib remote '/sasdata' server=wrds;
ERROR: Attempt to connect to server WRDS failed.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot find TCP service 'wrds'.
ERROR: Error in the LIBNAME statement.
9
10 proc contents data=ibeslib.bi_enrollment_summary_fact;
ERROR: Libname IBESLIB is not assigned.
11 run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.43 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
12
13 signoff;
NOTE: A link to WRDS does not exist. SIGNOFF is not necessary.
Super Contributor
Super Contributor
Posts: 3,174

Re: Reading a dataset on a Unix box from PC SAS

Have you considered contacting your SAS software administrator -- more than likely you're not the first individual making such an attempt for your site. Do consider that it's likely your onsite tech staff (or peer-users) are most informed about how SAS may be configured and what's needed to function correctly.

Scott Barry
SBBWorks, Inc.
Super User
Posts: 10,046

Re: Reading a dataset on a Unix box from PC SAS

Hi.
Is there FTP service in your primary SAS server.
If it has ,you can use ftp command.
Start-> run -> command-> ftp 10.1.2.1->binary 80 -> get test.sas7bdat


Ksharp
Trusted Advisor
Posts: 2,116

Re: Reading a dataset on a Unix box from PC SAS

You could use a "samba" connection from the unix server (it surfaces the unix files to the windows side). That requires the Unix admin to do some setup.
Valued Guide
Posts: 2,177

Re: Reading a dataset on a Unix box from PC SAS

Mark

SAS/Connect provides procs upload and download.
They support external files (i.e other than sas file types like data sets and catalogs) with the infile= and outfile= options.
Depending on the complexity of the file you want to transfer upi might alse want te BINARY option.

Good luck
peterC
Ask a Question
Discussion stats
  • 14 replies
  • 729 views
  • 0 likes
  • 9 in conversation