BookmarkSubscribeRSS Feed
rohithverma
Obsidian | Level 7

Is it possible to create a library without using libname statement in sas and also without using the options in menu bar ??

10 REPLIES 10
ed_sas_member
Meteorite | Level 14

Hi @rohithverma 

 

What is the purpose of the question? For example, do you want to call macros automatically?

rohithverma
Obsidian | Level 7
I just want to know is there any way of creating a library without using LIBNAME statement as I have faced this question in one my interview recently. Thank you
Ksharp
Super User

Do you mind using libname() function in data step ?

Amir
PROC Star

If the organisation who interviewed you use SAS on the Mainframe then allocating a library through JCL (Job Control Language) might also be an option.

 

Amir.

Kurt_Bremser
Super User

@Amir wrote:

If the organisation who interviewed you use SAS on the Mainframe then allocating a library through JCL (Job Control Language) might also be an option.

 

Amir.


Which is basically the mainframe version of using environment variables.

Tom
Super User Tom
Super User

@Kurt_Bremser wrote:

@Amir wrote:

If the organisation who interviewed you use SAS on the Mainframe then allocating a library through JCL (Job Control Language) might also be an option.

 

Amir.


Which is basically the mainframe version of using environment variables.


Yes, but you have it backwards. I am sure that SAS's support of environment variables in other operating systems was created to mimic how they used  DDnames on IBM mainframes.

ballardw
Super User

@rohithverma wrote:
I just want to know is there any way of creating a library without using LIBNAME statement as I have faced this question in one my interview recently. Thank you

One way that is not really recommended but will work in SAS Foundation at least if your operating system has the correct associations for the SAS files: Double click to open a dataset file from something like the Windows Explorer or similar tool. SAS will create a library such as TMP1, the digit will likely increment if done to sets in different locations, to display the data set.

 

You may find this also happens when downloading a data set from the web depending on your browser or the source (like this forum).

Amir
PROC Star

You could consider using the libname() function (not statement) as detailed in the documentation:

 

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212079.htm

 

 

Kind regards,

Amir.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 10 replies
  • 732 views
  • 0 likes
  • 8 in conversation