%macro create_hacflags();
%macro temp; %mend temp;
data &output.;
	set &input.;

	&HAC_PREFIX.c01_flag = sum(of &HAC_PREFIX.c01:, 0) > 0;
	&HAC_PREFIX.c02_flag = sum(of &HAC_PREFIX.c02:, 0) > 0;
	&HAC_PREFIX.c03_flag = sum(of &HAC_PREFIX.c03:, 0) > 0;
	&HAC_PREFIX.c04_flag = sum(of &HAC_PREFIX.c04:, 0) > 0;
	&HAC_PREFIX.c05_flag = sum(of &HAC_PREFIX.c05:, 0) > 0;
	&HAC_PREFIX.c06_flag = sum(of &HAC_PREFIX.c06:, 0) > 0;
	&HAC_PREFIX.c07_flag = sum(of &HAC_PREFIX.c07:, 0) > 0;
	&HAC_PREFIX.c08_flag = sum(of &HAC_PREFIX.c08:, 0) > 0;
	&HAC_PREFIX.c09_flag = sum(of &HAC_PREFIX.c09:, 0) > 0;
	&HAC_PREFIX.c10_flag = sum(of &HAC_PREFIX.c10:, 0) > 0;
	&HAC_PREFIX.c11_flag = sum(of &HAC_PREFIX.c11:, 0) > 0;
	&HAC_PREFIX.c12_flag = sum(of &HAC_PREFIX.c12:, 0) > 0;
	&HAC_PREFIX.c13_flag = sum(of &HAC_PREFIX.c13:, 0) > 0;
	&HAC_PREFIX.c14_flag = sum(of &HAC_PREFIX.c14:, 0) > 0;
	&HAC_PREFIX.c15_flag = sum(of &HAC_PREFIX.c15:, 0) > 0;
	&HAC_PREFIX.c16_flag = sum(of &HAC_PREFIX.c16:, 0) > 0;
	&HAC_PREFIX.c15p02_flag = min(1, coalesce(&HAC_PREFIX.c15p02, 0));

	&HAC_PREFIX._flag = min(1, sum(of &HAC_PREFIX.c:));

run;
%mend create_hacflags;

%create_hacflags;
