BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

Are there only SAS data set files in SAS library or can be also other type of files?

For example: 

Is it possible to store SAS program files in library?

 

 

7 REPLIES 7
Reeza
Super User

A library is typically just a folder so you can definitely save the programs there but you won't see them in the library under the SAS Library Pane if that's what you're asking. You will see them under the SAS File Explorer or Servers Folders and Files pane.  

Patrick
Opal | Level 21

It's rarely done but you can pre-compile SAS programs and store them in a catalog which then gets accessed via a library. So there can be more than only tables under a library but it's not something you normally use/access directly. 

Other examples for things in SAS catalogs are compiled SAS macros and formats. To get access to these catalogs you need to have a library defined that points to the folder where the catalog file exists.

Tom
Super User Tom
Super User

You can use SAS catalogs to store a lot of different types of things.

You can use a SOURCE entry to store the source code of a program. 

Kurt_Bremser
Super User

On the most widely used platforms for SAS (Windows and UNIX), a SAS Base library is a directory in the file system. SAS stores datasets (.sas7bdat), views (.sas7bvew), indexes (.sas7bndx) and catalogs (.sas7bcat) there. And other stuff (the WORK of a workspace server is used by Enterprise Guide as intermediate storage for import/export files).

You can put any files you can think of into a library directory, but you will only see views and datasets via the library interface of your SAS GUI, as already mentioned (Display Manager will also show catalogs).

 

Storing stuff in catalogs for long-term is not recommended, as catalogs are platform- and version-specific. Always keep a source from which you can populate the catalogs.

Sajid01
Meteorite | Level 14

SAS library is a folder / directory at the operating system level. One can indeed stores any type of file in that. 
While SAS datasets can be accessed using the libname.datasetname syntax, for accessing code one needs the full physical path,

However, it is a good practice to store programs in their own folders. 

yabwon
Onyx | Level 15

Did you check the doc (#maxim1)?

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/p077cfj7uoozw7n13h5g1w8mnu72.htm

🙂

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



ballardw
Super User

I do a lot of ad hoc small requests. Many of these require one or two data sets and one or two SAS programs (read provided data source or extract from permanent library  and then manipulate to add analysis variables). I create a library to work in and the same folder will contain the output generated and often a copy of the request document(s).

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 417 views
  • 1 like
  • 8 in conversation