DATA Step, Macro, Functions and more

Not being able to read SAS dataset using libname

Reply
Contributor
Posts: 35

Not being able to read SAS dataset using libname

I'm not being able to read a particular SAS dataset (in sas7bdat format) into SAS using libname. Even obs=1 does not work. SAS gets hanged every time I run. I tried few times, but it doesn't work.

Super User
Posts: 6,938

Re: Not being able to read SAS dataset using libname

Please post your libname statement and the log that you get when you execute it.

Then try to run a PROC CONTENTS on the dataset.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 5,257

Re: Not being able to read SAS dataset using libname

What's the origin of the data set? Perhaps it's create on some other host?

Perhaps it's corrupt. Try PROC DATASETS with REPAIR.

Can you create new data sets in the same libname?

Can you read other data sets in the same libname?

Data never sleeps
Contributor
Posts: 35

Re: Not being able to read SAS dataset using libname

I tried "proc datasets library=your_lib; repair a; quit;. ". It says index of the dataset is damaged. 

In the same libname, I'm being able to create new datasets as well as read other datasets.

 

Super User
Posts: 6,938

Re: Not being able to read SAS dataset using libname

Then I'd use the hints provided here: http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000247698.htm

to list, remove and recreate the damaged index(es).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 5,257

Re: Not being able to read SAS dataset using libname

"When you use the REPAIR statement for SAS data sets, it recreates all indexes for the data set"

So is it fixed after the REPAIR?

If not, share the full log from the REPAIR operation.

Data never sleeps
Super User
Posts: 10,500

Re: Not being able to read SAS dataset using libname

What version of SAS are you using?

Do you know who made the data set and which version of SAS was used?

SAS 9.4 datasets are not readable by version 9.2 32 bit at least. So if you have an older version of SAS that may be the cause.

 

 

Ask a Question
Discussion stats
  • 6 replies
  • 309 views
  • 0 likes
  • 4 in conversation