proc sql ;
libname ss 'pathname' ;
quit;
if i apply above program the library will form can you explain?
@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.
Hello,
PROC SQL is part of Base SAS that is used for SQL. Please check this link to see what it can do.
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.
"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.
Thanks for the clarification! I forgot that it's a global statement.
@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.
Yes, I know it has to be defined before use. But thanks for pointing it out:)
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!
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.
Ready to level-up your skills? Choose your own adventure.