Desktop productivity for business analysts and programmers

Help accessing sas libraries

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Help accessing sas libraries

I am trying to practice my programming for the base certification exam and I cannot seem to access the data in the libraries that came with EG 6.1. The SAS certification prep guide says use the libref.filename statement but it says the library I am accessing does not exist. The libraries and data I am trying to access is located on the SASapp server. Do I need to define the libraries path in a LIBNAME statement to let my program know the physical location of the library I am trying access. For example I am running a program that reads as follows:

LIBNAMEAAEM 'SAS:\Servers\SASApp\Libraries\AAEM';

DATA AAEM.BANK;

run;

proc print data=AAEM.BANK;

run;

Any help on this subject is greatly appreciated.


Accepted Solutions
Solution
‎02-10-2014 12:36 PM
Community Manager
Posts: 2,889

Re: Help accessing sas libraries

Will,

How about this:

libname AAEM meta library="AAEM";

This will use the library metadata to assign the library, and you won't need to know the physical path.

Chris

View solution in original post


All Replies
Community Manager
Posts: 2,889

Re: Help accessing sas libraries

I think the library you're trying to access is for use with SAS Enterprise Miner (not SAS Enterprise Guide) -- at least, within the SAS OnDemand environment.  Is that what you're using?

The LIBNAME path that you specify must map to a physical path on the host system where your SAS session is.  In the SAS OnDemand environment, you might try this:

libname aaem “/tutorials/em/data/aaem”;

(I found that in some support material -- I don't know if it's available in your environment.)

If running everything locally, I'd expect the LIBNAME path to be a local path such as:

libname sample "C:\Program Files\SASHome\x86\SASEnterpriseGuide\6.1\Sample\Data";

That's the EG sample data -- not the EM sample that might enclosed the BANK data you reference.

Chris

Occasional Contributor
Posts: 9

Re: Help accessing sas libraries

Chris,

I am using SAS EG 6.1 which is the one that came with the SAS on demand academics for students. I understand that I have to specify the physical location of the data being accessed. I am trying to access it from the server and I clicked on properties of the library AAEM which reads:

Type: Library

Server: SASApp

Engine: BASE

Location: /Shared Data/Libraries/AAEM

Options: ACCESS=READONLY

Libref: AAEM

Read Only: Yes

Tempory: No

What is the appropriate Syntax that will allow me to access the data and print it.

Thank you for all your help

Will

Solution
‎02-10-2014 12:36 PM
Community Manager
Posts: 2,889

Re: Help accessing sas libraries

Will,

How about this:

libname AAEM meta library="AAEM";

This will use the library metadata to assign the library, and you won't need to know the physical path.

Chris

Occasional Contributor
Posts: 9

Re: Help accessing sas libraries

Chris,

Thank you so much for your help and patience as this is the correct code. However, I am denied access to the BANK data. The error message reads, "Write access to member AAEM.BANK.DATA is denied." I can access the data when I physically  go into the library and click on it but it is not letting me access it through the code. Any reason as to why this is? Thanks again for all your help.

Will

Community Manager
Posts: 2,889

Re: Help accessing sas libraries

Will,

Maybe try:

libname AAEM meta library="AAEM" access=readonly;


And see how that does...


Or,


libname AAEM meta library="AAEM" metaout=data;


Chris

Occasional Contributor
Posts: 9

Re: Help accessing sas libraries

Chris,

I got it it to work. Thank you for your help.

Will,

N/A
Posts: 1

Re: Help accessing sas libraries

Could you post what you found out please? It would help other people looking at this post!

🔒 This topic is solved and locked.

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

Discussion stats
  • 7 replies
  • 1336 views
  • 6 likes
  • 3 in conversation