Trying to figure out why my SAS studio and my SAS 9.4 at work are giving me different results on the same data.
basically, I have the same excel file of data uploaded to both, same code renaming variables and subsetting the information, same everything except the SAS platform. Yet the resulting data subset in SAS 9.4 is 1571 observations, and in studio 1576.
has anyone else run into this? the only thing I can think of is you can't use the same code language in both....?
Can you post the code and different logs that you're seeing?
Any chance that the import settings are different so you have a different number of records to start with?
Check also system options that affect overall behavior, like VALIDVARNAME.
of course.
Here's the code for the subsetting, where STItestALL is a dichotomous variable (made sure there's no missing) and then I don't want any observations with a missing entry for the variable of sex.
data DRsubset;
set DRdata;
if STItestALL = "Yes" or STItestALL = "No";
if sex ^= .;
run;
the log for 9.4 is the following:
434
435 data DRsubset;
436 set DRdata;
437 if STItestALL = "Yes" or STItestALL = "No";
438 if sex ^= .;
439 run;
NOTE: There were 1602 observations read from the data set WORK.DRDATA.
NOTE: The data set WORK.DRSUBSET has 1571 observations and 365 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds
and the log for studio is the following:
Now I'm suspicious of the methods of import. Both using PROC IMPORT? And the same DBMS= method (I recommend DBMS=XLSX)?
I would first try to find where the three extra variables came from.
Usually that is sign of a misspelled variable name or missing semi-colon that causes the code result in new variables being created.
What's the earliest stage where the results differ?
Check the Import first and work down from there....or start in the middle if they match move down the code.
SAS Studio (at least UE) seems a bit weird with how it imports Excel files and the names, it doesn't list them in the viewer if it's using VALIDVARNAME=ANY so I generally change that to V7 myself. I think yesterday was the first time I came across this so far though.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.