BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

proc sql ;

libname ss 'pathname' ;

quit;

 

if i apply above program the library will form can you explain?

7 REPLIES 7
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

@thanikondharish a library does not form.

A library is assigned and that is what you have with libname ss 'pathname' ;

 

@thanikondharish help those that have helped you, go back to all of your unsolved questions and confirm if they were solved.  You have a whole lot of questions that are very simple to answer that have been answered and are marked as not solved.

 

Give create to others, learn by reading and please do some searching.

SuryaKiran
Meteorite | Level 14

Hello,

 

PROC SQL is part of Base SAS that is used for SQL. Please check this link to see what it can do.

Thanks,
Suryakiran
cosmid
Lapis Lazuli | Level 10

Interesting, I didn't know you could assign a lib ref within a Proc SQL step like that. Does this mean that you can pretty much use the libname statement almost anywhere? I know by convention, it's usually at the top of programming code.

novinosrin
Tourmaline | Level 20

"Does this mean that you can pretty much use the libname statement almost anywhere? "

- Libname statement is a global statement and you can use global statements anywhere in a SAS program. This applies to all global statements. Global statements are not executable; they take effect as soon as SAS compiles program statements.

 

With the above being said, I do not like the practice of using anywhere that causes difficulty in reading ease. Basically, the good thing is that it is flexible. That's about it

 

 


@cosmid wrote:

Interesting, I didn't know you could assign a lib ref within a Proc SQL step like that. Does this mean that you can pretty much use the libname statement almost anywhere? I know by convention, it's usually at the top of programming code.


 

cosmid
Lapis Lazuli | Level 10

Thanks for the clarification! I forgot that it's a global statement.

ballardw
Super User

@cosmid wrote:

Interesting, I didn't know you could assign a lib ref within a Proc SQL step like that. Does this mean that you can pretty much use the libname statement almost anywhere? I know by convention, it's usually at the top of programming code.


The library has to be defined before use.

 

I consider this particular behavior one of the SAS helpful interpretations of doing what we meant and not actually coded such as the warning about misspelled keywords such as accidentally using PROG instead of PROC.

cosmid
Lapis Lazuli | Level 10

Yes, I know it has to be defined before use. But thanks for pointing it out:)

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 7 replies
  • 1721 views
  • 4 likes
  • 6 in conversation