DATA Step, Macro, Functions and more

Libref questions

Reply
Occasional Contributor
Posts: 11

Libref questions

Hi All,

 

would be really helpful if you could answer the following 2 questions:

 

1. I saw the following in one of the codes:

 

proc sql;
create table sqltest."##Drvr_Nbr_%sysget(USER)"n as
select statements.....

 

what does a sqltest table mean? 

 

2. 

I saw user_work.[dataset_name] in some places. Here does user_work refer to as a permanent or a temp libref?

 

Appreciate your help!

Thank you.

 

Respected Advisor
Posts: 2,812

Re: Libref questions

Posted in reply to astha8882000

SQLTEST in this case is a library reference, probably pointing to a database.

 

User_work is a permanent library. The only temporary library in SAS is WORK

--
Paige Miller
Super User
Posts: 13,304

Re: Libref questions

Posted in reply to astha8882000

@astha8882000 wrote:

Hi All,

 

would be really helpful if you could answer the following 2 questions:

 

2. 

I saw user_work.[dataset_name] in some places. Here does user_work refer to as a permanent or a temp libref?

 

Appreciate your help!

Thank you.

 


How sure are you that the code was "user_work.". Libraries are limited to 8 character names. I suspect someone may have been discussing default library names for single references in some fashion. By default most installations have WORK as the default single reference library, so when you use data=junk SAS automatically treats it as data=work.junk. But you can have a library defined as USER and when set it becomes the default for single level names and you have to explicitly use work.junk. And the USER library is not temporary.

 

I think we would have to see the original code and comments in more detail to get a more precise response.

Respected Advisor
Posts: 2,812

Re: Libref questions


@ballardw wrote:


How sure are you that the code was "user_work.". Libraries are limited to 8 character names.

Good catch, @ballardw!

--
Paige Miller
Valued Guide
Posts: 559

Re: Libref questions

[ Edited ]
Posted in reply to astha8882000

SAS libraries are in general referenced by two level name (libref.filename),if you don't specify the libref or libref is WORK then
SAS stores temporarialy.

libref will be the nick name you defiend in your LIBNAME statement

LIBNAME mydata "/user/path/";
LIBANME ORA Oracle user= password= schema=;

Here mydata will reference the physical path location and where as ORA will reference to Oracle.

 

 

So you need to know how these libraries are referenced.

Thanks,
Suryakiran
Ask a Question
Discussion stats
  • 4 replies
  • 103 views
  • 2 likes
  • 4 in conversation