I am creating a output using proc report, and below is the codes. I have 20 variables, for which i have to repeat the same step (compute block).
proc report data = final_lab; column subject RFSTDAT_DER_RAW SCREEN C1D1 C1D3 C1D8 C1D15 C1D22 C1D29 C1D36 C2D1 C2D3 C2D8 C2D15 C2D22 C2D29 C2D36 C3D1 C3D8 C3D15 C3D22 C4D1 C4D8 C4D15 C4D22 C5D1 C6D1 C7D1 C8D1 C9D1 C10D1 CXD1 ;
define Subject / Display 'Subject' ; Define RFSTDAT_DER_RAW / Display 'First Dose Date'; Define Screen / Display 'Screening'; Define C1D1 / Display 'Cycle 1 Day1' ; compute C1D1;
if C1D1 = 'ND' then call define('C1D1 ', "style", "style=[background=grey]"); else if C1D1 LE 1 then call define('C1D1 ', "style", "style=[background=lightyellow]"); else if C1D1 >= 1 and C1D1 =<2 then call define('C1D1 ', "style", "style=[background=lightgreen]"); else if C1D1 >= 3 and C1D1 < 6then call define('C1D1 ', "style", "style=[background=orange]"); else if C1D1 >= 6 and C1D1 < 8 then call define('C1D1 ', "style", "style=[background=lightblue]"); else if C1D1 >= 8 then call define('C1D1 ', "style", "style=[background=red]"); endcomp;
run;
this compute block must be repeated for all the rest of the variable (C1D3 C1D8 C1D15 C1D22 C1D29 C1D36 C2D1 C2D3 C2D8 C2D15 C2D22 C2D29 C2D36 C3D1 C3D8 C3D15 C3D22 C4D1 C4D8 C4D15 C4D22 C5D1 C6D1 C7D1 C8D1 C9D1 C10D1 CXD1 ) ,tried doing do loop but the variable name is not in sequence order so I was unbale to do so.
is there a way to automate this for the reminder of the variable?
... View more