data ClaimsByQuarter2;
set work.Claims;
if MOS = 'January' then Quarter = '1';
run;
I can't figure out why I am getting on observation returned when I should have many that qualify. Advice is appreciated.
I cannot attach the data set; its too large.
or leading blanks/ case sensitivity issue perhaps?
Try
if strip(upcase(MOS))='JANUARY' then quarter='1';
Tried this. Same result: one line with missing values
lets debug
proc sql;
select distinct mos
from have;
quit;
Let us know the above report
@AMMAN wrote:
data ClaimsByQuarter2; set work.Claims; if MOS = 'January' then Quarter = '1'; run;
I can't figure out why I am getting on observation returned when I should have many that qualify. Advice is appreciated.
I cannot attach the data set; its too large.
Post the log entery generated when that executes.
It should have something about number of observations read and written to the output data set. If there is not indication of any read then you didn't start with a data set. If the number of observations read was 0 then the starting data set has no observations and likely have something that went wrong prior if you expect many records.
Attached is the log. Uninitialized
So likely no variable by the name MOS in your input dataset
verify
proc contents data=input;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.