Hello!
I am trying to use a compute statement in my proc report and keep getting the error that the variable error_count is uninitialized, even when included in the proc report. Additionally, my other variables in my compute statements are not changing background in my proc report even if the condition is met. Am I missing something? Thanks so much!
COLUMN
VFC_PIN REGION FACILITY_NAME FACILITY_TYPE ERROR_COUNT DTAP EXPECTED_DTAP HEPA EXPECTED_HEPA HIB EXPECTED_HIB POLIO EXPECTED_IPV MMR EXPECTED_MMR PCV EXPECTED_PCV RTV EXPECTED_RTV VARICELLA EXPECTED_VAR ERROR1 ERROR2 ERROR3 ERROR4 ERROR5 ERROR6 ERROR7 ERROR8;
DEFINE VFC_PIN / CENTER "VFC PIN" STYLE(COLUMN)=[BACKGROUND=WHITE] STYLE={TAGATTR='FORMAT:@'};; DEFINE REGION / CENTER "REGION" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE FACILITY_NAME / CENTER "FACILITY NAME" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE FACILITY_TYPE / CENTER "FACILITY TYPE" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE ERROR_COUNT / CENTER "# INCORRECT VACCINES" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE DTAP / CENTER "DTP USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_DTAP / CENTER "DTP EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE HEPA / CENTER "HAV USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_HEPA / CENTER "HAV EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE HIB / CENTER "HIB USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_HIB / CENTER "HIB EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE POLIO / CENTER "POLIO USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_IPV / CENTER "POLIO EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE MMR / CENTER "MMR USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_MMR / CENTER "MMR EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE PCV / CENTER "PCV USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_PCV / CENTER "PCV EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE RTV / CENTER "RTV USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_RTV / CENTER "RTV EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE VARICELLA / CENTER "VAR USED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE EXPECTED_VAR / CENTER "VAR EXPECTED" STYLE(COLUMN)=[BACKGROUND=WHITE]; DEFINE ERROR1 / NOPRINT; DEFINE ERROR2 / NOPRINT; DEFINE ERROR3 / NOPRINT; DEFINE ERROR4 / NOPRINT; DEFINE ERROR5 / NOPRINT; DEFINE ERROR6 / NOPRINT; DEFINE ERROR7 / NOPRINT; DEFINE ERROR8 / NOPRINT;
compute error_count; if error_count=7 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute dtap; if error1=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute hepa; if error2=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute hib; if error3=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute polio; if error4=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute mmr; if error5=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute pcv; if error6=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute rtv; if error7=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp;
compute varicella; if error8=1 then call define(_col_,'style','style={background=LIGHTRED}'); endcomp; run;
ODS TAGSETS.EXCELXP CLOSE;
... View more