DATA Step, Macro, Functions and more

Libname - Library does not exist

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Libname - Library does not exist

Hello,

I am using SAS 9.3 in a 64 bit Windows 7 environment.  When I run the following libname 'EXTRACTS V9 "c:\sas_datasets\extracts";'  I get the message 'NOTE: Library EXTRACTS does not exist'.  The file location is valid and the datasets are present in this directory.

Some background on my issue - I am trying to schedule a program to run using windows task scheduler.  The SAS program works fine when I log into SAS and execute the program myself.  When I run the program from windows scheduler, I get the message saying the libraries don't exist.  I inserted 'libname _all_ list;' at the start of my program and it showed that the library is there (text below)

13         libname _all_ list;

NOTE: Libref=   EXTRACTS

      Scope=    Program "C:\sas_code\prod_code\extracts reporting\manual\2 report date range.sas"

      Engine=   V9

      Physical Name= c:\sas_datasets\extracts

      Filename= c:\sas_datasets\extracts

The only difference I was able to find was in the scope field.  When I run the program manually, the scope = DMS Process and when it is run from scheduler, scope = the sciprt name.  Any direction would be helpful.

Thanks

Drew


Accepted Solutions
Solution
‎06-24-2013 04:42 PM
Trusted Advisor
Posts: 2,113

Re: Libname - Library does not exist

Drew,

did you cut-n-paste the "physical Name"'s above?  There is an embedded blank after the "_" in the DMS Process one that does not exist in the code with the libname.

Doc

View solution in original post


All Replies
Super User
Posts: 17,750

Re: Libname - Library does not exist

If this is the code you're submitting I don't think its valid:

libname 'EXTRACTS V9 "c:\sas_datasets\extracts";'


It should be:

libname EXTRACTS "c:\sas_datasets\extracts";


Otherwise, post the exact code you're submitting.

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

Thanks for the quick response!  I added the single quotes for the post.  The exact libname at the top of my code is below.  I tried with and without the V9.

EXTRACTS V9 "c:\sas_datasets\extracts";

Thanks

Drew

Super User
Posts: 17,750

Re: Libname - Library does not exist

Missing the word libname? or just a typo again?

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

Ah, a copy/paste issue this timeSmiley Wink  For some reason, when I paste it into IE browser, libname disappears.

LIBNAME EXTRACTS V9 "c:\sas_datasets\extracts";

Thanks

Drew

Super Contributor
Posts: 1,636

Re: Libname - Library does not exist

Does V9 make a difference? I never use that in my libname statement.

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

The V9 did not change the outcome for me.

Thanks

Drew

Super User
Posts: 17,750

Re: Libname - Library does not exist

So the following works in open code:

LIBNAME EXTRACTS V9 "c:\sas_datasets\extracts";


but doesn't work in batch Smiley Happy.


What about when you %include the program? or is it only via windows scheduler where the error happens?

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

Thanks for the reply!  The issue is only occuring when it is run through the scheduler.  If I run the program manually (open sas and hit submit), it runs fine.  I am running local version of SAS.

Thanks again!

Drew

New User
Posts: 1

Re: Libname - Library does not exist

its not working for me
Super Contributor
Posts: 333

Re: Libname - Library does not exist

Are you using a local version of SAS or is SAS on a server?

Nevermind - Windows 7 was listed

Super Contributor
Posts: 333

Re: Libname - Library does not exist

We got a similar errors when we referenced mapped drive on our network without using the full network path in the sas program. You might want to try checking the option Run with highest privileges to make sure SAS has privileges on C: .

EJ

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

Thanks!  I do have run with highest privelages checked in the scheduler.

I am relativelty new to SAS and I may not have been clear when I initially explained my problem.  When I run the program manually (open sas and execute), I do not have the libname statement included because I do not get any errors in the program.

When I run the program from Windows Task Scheduler, I get the error ERROR: Libname EXTRACTS is not assigned.

Because of the above mentioned error, I added the libname statement (to assign the libname) which resulted in the error ERROR: Library EXTRACTS does not exist.

If I run the libname statement all by itself, I still ger the error ERROR: Library EXTRACTS does not exist.

The only difference I was able to find was in the results of libname list all listings. 

Code without libname

NOTE: Libref=   EXTRACTS

      Scope=    DMS Process

      Engine=   V9

      Physical Name= C:\sas_ datasets\extracts

      Filename= C:\sas_ datasets\extracts

Code with the libname

NOTE: Libref=   EXTRACTS

      Scope=    Program "C:\sas_code\prod_code\extracts reporting\manual\2 report date range.sas"

      Engine=   V9

      Physical Name= c:\sas_datasets\extracts

      Filename= c:\sas_datasets\extracts

I am running SAS 9.3 TS level 1M1 W32_7PRO platform.

Thanks again for your help!

Drew

Super Contributor
Posts: 1,636

Re: Libname - Library does not exist

could you open your sas and highlight the below libname statment and run it, then check the log file?

LIBNAME EXTRACTS "c:\sas_datasets\extracts";

Occasional Contributor
Posts: 12

Re: Libname - Library does not exist

Thanks for the response!

The log details are below.

9708   LIBNAME EXTRACTS "c:\sas_datasets\extracts";

NOTE: Library EXTRACTS does not exist.

Thanks!

Drew

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 21 replies
  • 21009 views
  • 0 likes
  • 7 in conversation