03-07-2018 09:23 PM
I want to update all observations in dataset with M or F. Prefer to use modify statement but sql works too. Just wan to get the below data step working. It only updates the first obs
if gndr_cd = '1' then gndr_cd ='M'; replace;
if gndr_cd = '2' then gndr_cd = 'F'; replace;
ERROR: No matching observation was found in MASTER data set.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 1 observations read from the data set ETL.INP_CLAIMS_LDS2013_2016.
NOTE: The data set ETL.INP_CLAIMS_LDS2013_2016 has been updated. There were 1 observations rewritten, 0 observations
added and 0 observations deleted.
03-07-2018 10:17 PM
Did you mean to do this?
if gndr_cd = '1' then do; gndr_cd ='M'; replace; end;
if gndr_cd = '2' then do; gndr_cd = 'F'; replace; end;
03-07-2018 10:29 PM
Need further help from the community? Please ask a new question.