BookmarkSubscribeRSS Feed
elsalam
Calcite | Level 5

I checked everything but have no clue.  the location is 200% correct.  see below copy and paste from SAS studio location.

/home/coccus030/sasuser.v94/institutiondata.txt

 

My code:

libname Lesson08 '/home/coccus030/sasuser.v94/institutiondata.txt';
Data Lesson08.college09ds;
Infile '/home/coccus030/sasuser.v94/institutiondata.txt.Lesson08' firstobs=2;
Input GenderType & $6. +1 Year +1 Total comma5. Asofdate Gender $ Instituion $;
run;

error log:

libname Lesson08 '/home/coccus030/sasuser.v94/institutiondata.txt';

ERROR: Library LESSON08 is not in a valid format for access method RANDOM.
ERROR: Error in the LIBNAME statement.
72 Data Lesson08.college09ds;
73 Infile '/home/coccus030/sasuser.v94/institutiondata.txt.Lesson08' firstobs=2;
74 Input GenderType & $6. +1 Year +1 Total comma5. Asofdate Gender $ Instituion $;
75 run;
 
ERROR: Libref LESSON08 is not assigned.
 
thx
5 REPLIES 5
Kurt_Bremser
Super User

Your libname is 200% bogus.

A libname for a Base SAS library does not point to a file, but to a directory.

Only some special engines (like Excel) point to files.

 

elsalam
Calcite | Level 5

Thanks Kurt 

 

I still not sure why not read. 

 

 

Shmuel
Garnet | Level 18

Try:

FILENAME Lesson08   '/home/coccus030/sasuser.v94/institutiondata.txt.Lesson08';
LIBNAME mylib       '/home/coccus030/sasuser.v94';

Data MYLIB.college09ds;
Infile Lesson08 firstobs=2;
Input GenderType & $6. +1 Year +1 Total comma5. Asofdate Gender $ Instituion $;
run;

Without having your input file I cant verify that code.

elsalam
Calcite | Level 5

Not working neither  same error message pop up with mylib.

 

 

this is the input file but I have to check this part yet because the libname and infile not work.

 

 

Variables: GenderType Year Total Asofdate
ihe-M 1970 5,044 Retrieved: 03/14/2012 f-IHE 1970  3,537 Retrieved: 03/14/2012
ihe-m 1980 5,874 Retrieved: 03/14/2012 f-IHE 1980  6,223 Retrieved: 03/14/2012
ihe-M 1990 6,284 Retrieved: 03/14/2012 F-IHE 1990  7,535 Retrieved: 03/14/2012
dgi-M 2000 6,722 Retrieved: 03/14/2012 f-dgi 2000  8,591 Retrieved: 03/14/2012
dgi-m 2001 6,961 Retrieved: 03/14/2012 f-dgi 2001  8,967 Retrieved: 03/14/2012
DGI-m 2002 7,202 Retrieved: 03/14/2012 f-dgi 2002  9,410 Retrieved: 03/14/2012
dgi-M 2003 7,260 Retrieved: 03/14/2012 F-DGI 2003  9,651 Retrieved: 03/14/2012
dgi-M 2004 7,387 Retrieved: 03/14/2012 F-DGI 2004  9,885 Retrieved: 03/14/2012
dgi-m 2005 7,456 Retrieved: 03/14/2012 f-DGI 2005 10,032 Retrieved: 03/14/2012
DGI-m 2006 7,575 Retrieved: 03/14/2012 f-dgi 2006 10,184 Retrieved: 03/14/2012
dgi-M 2007 7,816 Retrieved: 03/14/2012 f-dgi 2007 10,432 Retrieved: 03/14/2012
dgi-M 2008 8,189 Retrieved: 03/14/2012 F-DGI 2008 10,914 Retrieved: 03/14/2012
DGI-m 2009 8,770 Retrieved: 03/14/2012 F-dgi 2009 11,658 Retrieved: 03/14/2012

Shmuel
Garnet | Level 18

Saying "libname and infile not work." - is not enough.

To help you we need the full log.

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