'creating new variables in sas
I am trying to create 3 new variables and have used this code however keep getting an error in my log, I am not sure what this issue is:
Data birthdata
SET birthdata;
native=.;
if race=3 THEN native=1;
if race=1 THEN native=0;
aarace=.;
if race=2 then aarace=1;
if race=1 then aarace=0;
nonwhite=.;
if (1<race=.) then nonwhite=1;
if race=1 then nonwhite=0;
label native = "Maternal race"
aarace = "Maternal race"
nonwhite = "Maternal race";
FORMAT native native. aarace aarace. nonwhite nonwhite.;
run;
`
Solution 1:[1]
You missed ; in first line of data step.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Manoharan |
