10-27-2014 01:30 PM
I have a big permanent data set in sas and some formats defined on it by my boss. The dataset is in my drive, but I cant open it or view it. SAS replies data file is shorter than expected. I ran the formats before calling the dataset as well. I don't know what I am doing wrong!!
10-27-2014 01:41 PM
I tried viewing the data set by clicking on the sas dataset icon. It gave me message dataset is shorter than expected. use proc datasets option to correct it. later i tried reading data in sas after referencing the libname statement and it showed me 1 observation and 0 variables, which cant be true.
I know that this dataset has a lot of format defined on it. I ran those formats too.
10-27-2014 02:07 PM
Have you compared the size of the file that was copied to your drive with size of the original? Something may have happened during the copying of the file especially if you are talking about really large file (multiple gbs). I dont think the formats are the problem since not having them would throw a different error than the one you are describing.
I would first verify that the full file was copied correctly to your drive.
10-27-2014 02:27 PM
Is the dataset backed up at all? It is good practice to ensure that all business-critical SAS data is regularly backed up. If it is being backed up get a restore from a date when you know the dataset was OK.
10-28-2014 08:40 AM
Look at the physical properties of the file (directory listing). This will give you a first idea if the data set contains any data at all.
If it has a sensible size, try to fix it with proc datasets.
If not, look for a backup, or try to recreate it with the code originally used.
10-28-2014 12:37 PM
The file is 5kb, although it should be way bigger. I didn't create this dataset, my boss gave me this dataset as a permanent dataset in sas with formats defined on it. She gave me formats as well. I first tried viewing data with viewtable option, but it said dataset is smaller than expected. cant open use proc datasteps to fix it, which I don't know how. I looked up online but not sure how to do it. Can you suggest how can I back up my dataset. I am very naive in sas.
10-28-2014 12:44 PM
I dont think this is a SAS issue but an corrupt file issue. You may have to go back to the original and get a new copy. Copy the file again and then look in your OS to make sure the copy is the same size as the original. If it matches, then try to read it through SAS.
OR if you have access to the original file location you can try to to point SAS to that file directly and see if you have the same problems.
10-29-2014 12:32 AM
5kb is an empty data set generally.
Get a new copy of the file as others have suggested.
Also can you show your code where you tried to access it via libname? It's easy to accidentally overwrite a dataset in SAS which is what might have happened.
10-29-2014 02:57 AM
The repair action would look like that:
proc datasets library=my nolist;
But that file looks kaput, so as others suggested, get a new copy. And when doing that, have your boss open it on her machine, so you know the file is OK at her site.
10-28-2014 11:21 PM
Are both the environment are same,I think this more like an environment issue i.e from windows to Linux .
If not try this too:
proc datasets library=your lib nolist;