BookmarkSubscribeRSS Feed
francisca
Calcite | Level 5

my code :

options pagesize=60 pageno=1 linesize=80 nodate;
libname mydata '/folders/myfolders/sasuser.v94';

proc contents data= mydata._all_;
run;

data tour;
input Country $ Nights Aircost Landcost Vendor $;
datalines;
France 8 793 575 Major
Spain 10 805 510 Hispania
India 10 . 489 Royal
Peru 7 722 590 Mundial
;

proc print data=tour;
run;

proc print data=mydata.tour;

TITLE 'Data Set MYLIB.INTERNATIONALTOURs ';

run;

 

 

MY error :

 

 

73
74 proc print data=mydata.tour;
ERROR: File MYDATA.TOUR.DATA does not exist.
75
76 TITLE 'Data Set MYLIB.INTERNATIONALTOURs ';
77
78 run;
 
2 REPLIES 2
Kurt_Bremser
Super User

That has nothing to do with creating a library.

That would be the case if this

libname mydata '/folders/myfolders/sasuser.v94';

fails.

Your problem comes from the fact that you created your dataset in WORK, not in MYDATA:

data tour;

A single-stage dataset name always means that the dataset will be created in WORK.

Use

data mydata.tour;

instead, and also include the library name in all further references, just like you did in proc print.

dougc
SAS Employee

To use the library you created you need to use a two-level name (libref.dataset).  If you omit the libref, then by default the data set you create goes in a temporary library called work.  To use library mydata, your code should look something like this:

 

options pagesize=60 pageno=1 linesize=80 nodate;
libname mydata '/folders/myfolders/sasuser.v94';

proc contents data= mydata._all_;
run;

data mydata.tour;
input Country $ Nights Aircost Landcost Vendor $;
datalines;
France 8 793 575 Major
Spain 10 805 510 Hispania
India 10 . 489 Royal
Peru 7 722 590 Mundial
;

proc print data=mydata.tour;

TITLE 'Data Set MYLIB.INTERNATIONALTOURs ';

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 897 views
  • 0 likes
  • 3 in conversation