I have no issues running these codes below . But it seems I didn’t create the “antibiotics_flag" variable in my data, I just have the label, so every time I will have to re-run the whole codes (I have 20 codes blocks like this). Is there a way to save the “antibiotics_flag" as a permanent variable in my datasets?
data kid2012;
set Kid_2012_core;
array diagvar $ dx1-dx25;
label antibiotics_flag = "Diagnosis code for antibiotics ADE";
antibiotics_flag = 0;
do over diagvar;
if diagvar ="76074" or "9600 "=<diagvar<= "9609 " or diagvar="E856 " or "E9300 "=<diagvar<= "E9306 " or "E9308 "=<diagvar<= "E9309 "
or diagvar= "E9310 " or diagvar= "E9313 "
then antibiotics_flag = 1;
end;
PROC SURVEYFREQ DATA=kid2012;
WEIGHT DISCWT;
CLUSTER HOSP_KID ;
STRATA KID_STRATUM ;
table antibiotics_flag;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.