BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
qh8519a
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

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

21 REPLIES 21
Reeza
Super User

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.

qh8519a
Calcite | Level 5

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

Reeza
Super User

Missing the word libname? or just a typo again?

qh8519a
Calcite | Level 5

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

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

Thanks

Drew

Linlin
Lapis Lazuli | Level 10

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

qh8519a
Calcite | Level 5

The V9 did not change the outcome for me.

Thanks

Drew

Reeza
Super User

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?

qh8519a
Calcite | Level 5

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

satvika
Calcite | Level 5
its not working for me
esjackso
Quartz | Level 8

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

Nevermind - Windows 7 was listed

esjackso
Quartz | Level 8

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

qh8519a
Calcite | Level 5

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

Linlin
Lapis Lazuli | Level 10

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";

qh8519a
Calcite | Level 5

Thanks for the response!

The log details are below.

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

NOTE: Library EXTRACTS does not exist.

Thanks!

Drew

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 21 replies
  • 67759 views
  • 2 likes
  • 7 in conversation