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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2122 views
  • 0 likes
  • 3 in conversation