Dear team, I I have been stuck to find a solution to provide the output results for the 3 months. The solution does not work if I add months 04 and 05.
What is the best way to display the data for the condition WHERE Check = 0 and month = 03 04 05?
proc print data=Oth (obs=1000);
where Check=0 and month = 03;
run;
If month is numeric:
month in (3 4 5)
or if month is character:
month in ('03' '04' '05')
B.
If month is numeric:
month in (3 4 5)
or if month is character:
month in ('03' '04' '05')
B.
it is numeric, so
the code is the next:
proc print data=Ret_oth (obs=1000);
where Check=0 and reporting_month in (03 04 05);
run;
But still the results only provide 03 data
The following:
data Ret_oth;
do reporting_month = 1 to 5;
Check=0; output;
Check=1; output;
end;
run;
proc print data=Ret_oth (obs=1000);
where Check=0 and reporting_month in (03 04 05);
run;
works as expected.
Check you data (Maxim 3), maybe months 4 and 5 are after obs=1000?
Bart
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.