SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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