BookmarkSubscribeRSS Feed
msalam92
Calcite | Level 5

Hi all, 

 

I am trying to connect SAS to a linux box that holds particular files/ data.

 

1) How can this be done?

2) What type of access do I need? 

 

I'd imagine coding a macro in enterprise guide highlighting all the connection information will do the job. 

Please advise. 

 

Thank You in advance. 

 

22 REPLIES 22
msalam92
Calcite | Level 5

Hi all, 

 

I am trying to connect SAS to a linux box that holds particular files/ data.

 

1) How can this be done?

2) What type of access do I need? 

 

I'd imagine coding a macro in enterprise guide highlighting all the connection information will do the job. 

Please advise. 

 

Thank You in advance.

Reeza
Super User
Depends a bit, how is your SAS installation set up? Are you running EG locally or on the server? Do you have admin access if it's the server version? Does your local computer have access to the linux server?
msalam92
Calcite | Level 5

Hi Reeza, 

 

We are running EG on the server, and do have admin access. 

 

We have access to the Linux server via SSH. 

How will the connection be made through EG? Code based solution?

 

 

Reeza
Super User
I don't think I know the answer to your question then, but it's likely under SAS Administration so I've moved your questions to the right forum - and merged them into one to avoid duplicates.

I *think* you may be able to use FILENAME to make the connection but not sure.

https://documentation.sas.com/?docsetId=lestmtsglobal&docsetTarget=p0xln1fiwsr340n1xxf4mkmfxp6f.htm&...
msalam92
Calcite | Level 5

Thanks Reeza. 

 

To clarify; I want to connect SAS to a Linux box. That Linux box holds certain data files that I would like to take a read into SAS. 

Hope that helps.

 

 

Reeza
Super User
It can be as simple as setting up a network drive on the server and then SAS will allow you to see it. If you need controlled access, ie only certain users then it may require some permissions settings in the SAS server.
Reeza
Super User
And if you need a quicker answer, you may want to contact SAS Tech Support, they're the official support channel and you pay for support after all, definitely worht using. They can walk you through the steps needed.
Tom
Super User Tom
Super User

What do you mean by "connect SAS"?

Are you running SAS on one linux machine and you want the SAS programs to be able to read the files from a different linux machine?

Might be easiest to ask your linux administrators to mount the disks onto the machine(s) where SAS is running so you can just treat them as local files.

 

NOTE that the FILENAME statement can link to different machines using a number of protocols.  FTP, SFTP, HTTP, etc.

 

You could also potentially call system commands from your SAS program to copy the files to your local machine.

 

Is the remote machine also running SAS?  Do you has SAS/Share licensed on that machine?  If so you could share out SAS dataset via SAS/Share.

 

msalam92
Calcite | Level 5

Thank you for the response Tom!

 

So to clarify a bit more. 

 

I am trying to use SAS to connect to an "outside" Linux box. That Linux box has files that I want to "read into" my SAS environment. 

They are simple data drop files. 

 

This I believe will be the easiest way for me to bring in the data from the Linux boxes to use for reporting in SAS. 

Kurt_Bremser
Super User

Since the Linux box has SSH installed and running, you can use filename sftp.

Mind that you need to set up passwordless authentication with a public/private keypair before you can use this.

msalam92
Calcite | Level 5

Hi Kurt, 

 

Thank you so much for your response. 

 

Where will the passwords need to be set up? And what will the passwords be for?

Kurt_Bremser
Super User

You do not use passwords with SAS filename sftp. Instead you first establish public/private key authentication for your user (the one used to run the SAS session) from the commandline. The goal is to make

sftp user@host

work without being prompted for a password.

msalam92
Calcite | Level 5

Thanks Reeza. I got in touch with the help desk folks. 

 

They suggested created a LIBNAME and getting permissions to the box, then making the connection happen. 

Or create a library in the metadata server. 

 

Reeza
Super User
Libname is for SAS data sets, are the data text files or SAS data sets? I was thinking text files.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 22 replies
  • 1828 views
  • 5 likes
  • 4 in conversation