I am trying to view this downloaded SAS data file. However, I am having problems with opening it. I try to open 'new program' within SAS and the file will show up if I press show all files. However, when it comes up it is just all characters.(Like shown in the attached picture.) Then I can see it in the given folder when I search for it on my PC through the explorer (SAS enviorment) but when I try to open it then, it says the file does not exist or cant be displayed.
I have attached the pictures and the file itself. I have been stuck on this for a while. Thank YOU!
If you can view the table than you can also see the variable names and their attributes, or
you can use PROC CONTENTS to see that information.
Then use:
data new;
set <libname>.<dataset name>;
... any sas code relating to variable ...
run;
/* === OR === */
proc print data=<libname>.<dataset name>;
... any print options or none ...
run;
Sas dataset is a binary file with sas specific format, depending on sas varsion.
A sas program is a text file.
You cannot display sas dataset using sas program edotor.
You got the message "The table SASDATA.nhanes2006 either does npt exist or cannot be displayed".
As file is displayed in the library, on the left side window - it exists - but it cannot be displayed.
There might be different reasons for it:
- Is file on same computer as SAS installation? Link to library shows: "\\client\e$\SASData".
It seems to me that answer is NO.
- Do you have permission to read the file?
- Is CLIENT and your PC holding same OS?
If different OS (like linux and windows) the sas datasets are of different format and you might need
use PROC CPORT on client and PROC CIMPORT on your PC or use SAS CONNECT.
- Was the sas dataset created in same sas version as you use on your PC ?
- Maybe the file is corrupted ?
What OS you use and in what OS was the sas dataset created ?
What sas version are you using? and with what sas varsion was the sas dataset created ?
thanks for the response. So I have managed to be able to view it in the table. Everything seems great. Now my question is how do I use it to code? I beleive I use libname and set statement. But how would that look?
Thanks
If you can view the table than you can also see the variable names and their attributes, or
you can use PROC CONTENTS to see that information.
Then use:
data new;
set <libname>.<dataset name>;
... any sas code relating to variable ...
run;
/* === OR === */
proc print data=<libname>.<dataset name>;
... any print options or none ...
run;
Awesome! Thank you! This helps a lot!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.