BookmarkSubscribeRSS Feed
rmg1995
Calcite | Level 5

I'm trying to get the fist variable to show. According to the code book it should all be numbers but indicating it's a character seems to be the only way to get this to show (if I leave out the $ then it just shows a . for a missing value). Can anyone tell me what I'm doing wrong? I'm using SAS On Demand for Academics.

 

I attached my code and the output. 

 

Just a few notes about my code: I used Var1 as my variable name but I plan to change that to CaseID and I do plan on doing more variables I'm just trying to get it together little by little. 

 

Thanks in advance. 

 

SAS Code 2.jpegSAS Output 1.jpeg

3 REPLIES 3
ballardw
Super User

If a file is a SAS7BDAT then it is already a SAS data set an should not be "input".

You would use it by using the Libname.dataset syntax.

Such as

Proc Print data=work.dhs;
run;

Or maybe sasuser.dhs, I don't use SAS On Demand so the pictures don't mean much to me.

 

Infile and Input are used to read TEXT files into SAS data sets. These would typically have extensions like TXT, CSV, TAB, sometimes DAT but the extension you have is a SAS data set.

rmg1995
Calcite | Level 5

When I do it without the 'infile' statement it won't work properly and without the 'input' statement it is throwing an error saying it doesn't have any columns. It also tells me that work.dhs doesn't exist. 

ballardw
Super User

You also have  CASE problem with naming your set. SAS On Demand runs in a UNIX environment and you really want to use lower case for library and dataset names.

 

Try using capstone.dhs in your print. (define the library with lower case capstone).

If there is a problem copy the text from the log with the CODE and any messages. On the forum open a text box using the </> icon above the message window and paste the text.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 289 views
  • 0 likes
  • 2 in conversation