BookmarkSubscribeRSS Feed
Tap222
Calcite | Level 5

error.png

whay it showing error  with following code?

libname books "C:\books\datasets";
data book.ytdsales(label='Sales for 2014');
attrib section length=$30 label='Section'
booktitle length=$50 label='Title of Book'
author length=$50 label='First Author'
publisher length=$50 label='Publisher'

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

This has nothing to do with macro SAS.  The program is telling you that the path:

c:\books\datasets

Does not exist.  

 

This can mean you don't have a directory named that or SAS doesn't have access to it.

 

What software are you using, SAS UE version is mounted in a virtual image and you need to use Unix paths to certain areas to get data, you can't use local C drive.

Shmuel
Garnet | Level 18

1) There is no folder : C:\books\datasets - check again the exact path name.

2) if you define libname books '...' then refer  to dataset should be

       books.<data set name> and not book.<dataset name>  (letter S is absent)

Tap222
Calcite | Level 5

Instead book.ytdsales.I am using work.ytd slaes its working.When I run this code a library name book created but In SAS log file it says book doesnot exist.

Shmuel
Garnet | Level 18

you defined libname books not libname book.

 

change to libname book and post your new log again

Kurt_Bremser
Super User

@Tap222 wrote:

Instead book.ytdsales.I am using work.ytd slaes its working.When I run this code a library name book created but In SAS log file it says book doesnot exist.


This is because the path for your library book does not exist (in the scope of your SAS process, which might be on a remote server or in a virtual machine).

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
  • 5 replies
  • 1014 views
  • 0 likes
  • 4 in conversation