BookmarkSubscribeRSS Feed
ccherrub
Obsidian | Level 7

So my code looks something like:

 

libname AEData "/home/u60650811/MYSAS/db1.sas7bdat"
access=readonly;
run;
 
Pretty simple however I don't know why I keep getting these errors:
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 libname AEData "/home/u60650811/MYSAS/db1.sas7bdat"
70 access=readonly;
ERROR: Library AEDATA is not in a valid format for access method RANDOM.
ERROR: Error in the LIBNAME statement.
71 run;
72
73 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
83
2 REPLIES 2
Kurt_Bremser
Super User

Libraries are directories containing datasets, catalogs, views. SAS datasets are files with extension .sas7bdat.

So your statement has to be

libname AEData "/home/u60650811/MYSAS";

after which you can access your dataset as aedata.db1.

Tom
Super User Tom
Super User

You pointe the libref at a file instead of directory.  Since a file is NOT a directory it is the wrong format. 

 

Either point the libref at the directory that contains the file and use a two level name when access the dataset.

libname AEData "/home/u60650811/MYSAS"  access=readonly;
proc contents data=aedata.db1 ;
run; 

Or use the quoted physical filename to reference that dataset directly.

proc contents data="/home/u60650811/MYSAS/db1.sas7bdat";
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2138 views
  • 0 likes
  • 3 in conversation