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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1822 views
  • 0 likes
  • 2 in conversation