Hi I need some help to figure out this puzzle, I am QAing my own work, and found an error:
I have this dataset called , with a calculated column called 'week', which, from both proc freq and my eye ball checking, has values from 0 -41.But, I try to print out some extreme values, like 41, log keeps telling me 'no rows were selected'.....
proc freq data=numerator2_full;
tables week;
run;
I know this probably looks very stupid, but this has drive me crazy....
Thank you for your help!
Perhaps it is not exactly 41?
where round(week,1)=41 ;
Or perhaps you have a format attached?
data want;
set have ;
if strip(vvalue(week))='41';
run;
Please post you full log, i.e., including the part where you ran the proc freq.
Art, CEO, AnalystFinder.com
Perhaps it is not exactly 41?
where round(week,1)=41 ;
Or perhaps you have a format attached?
data want;
set have ;
if strip(vvalue(week))='41';
run;
good point @Tom, this week variable is calculated. I calculated as (Vaccine_Day - Pre_day)/7 = week format 8.0
Now I am curious to see how my
Ah, yes, you definitely have decimal points then. If you want it actually rounded then round the value.
round((Vaccine_Day - Pre_day)/7, 1) format = 8.0
Run a PROC CONTENTS on your dataset and check the format and type.
How did you calculate the variable WEEK?
@LisaYIN9309 wrote:
I calculated as (Vaccine_Day - Pre_start_day)/7 = week format 8.0
week is supposed to be 'at which week at pregnant a lady got her vaccine'.
Attaching a format to a variable will change how the variable is printed, but it does not change the value. If you want WEEK to be an integer then use ROUND() or INT() function.
I am also curious as to why you picked 8.0 as the format to attach. Did you really expect to have WEEK counts as high as 99 Million?
you can try using int(week)=41, that should help.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.