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