BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jsjoden
Obsidian | Level 7

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

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;

View solution in original post

5 REPLIES 5
jsjoden
Obsidian | Level 7
 
Shmuel
Garnet | Level 18

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 ?

  

jsjoden
Obsidian | Level 7

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

Shmuel
Garnet | Level 18

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;
jsjoden
Obsidian | Level 7

Awesome! Thank you! This helps a lot!

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
  • 2325 views
  • 0 likes
  • 2 in conversation