Hi, This is my code libname dat1 '~/Clinical'; %macro report(var); Proc freq data=dat1.adsl noprint ; tables &var*arm/ out=fsl; Proc freq data=dat1.adsl noprint ; tables &var/out=fsl2; run; data dsl; set fsl fsl2(in=inb); where percent ne .; pct=cats('(',put(percent/100, percent7.2),')'); comb=catx(' ', count, pct); if inb then arm='Total'; run; proc sort data=dsl out=dsl; by &var; run; options validvarname=v7; proc transpose data=dsl out=&var; by &var; var comb; id arm; run; %mend report; %report(sex) %report(ethnic) %report(race) %report(agegr1) data sex1; set sex; Array arm[8] GT0918_50_mg_day GT0918_100_mg_day GT0918_200_mg_day GT0918_300_mg_day GT0918_400_mg_day GT0918_500_mg_day GT0918_600_mg_day total; do i=1 to 8; arm[i]=cats('N=',substr(arm[i],1,2)); end; data sex; set sex1 sex; run; Proc means data=dat1.adsl noprint; var age; class arm; output out=arm; format age 4.1; run; Proc means data=dat1.adsl noprint Median; var age; class arm; output out=arm1 Median=median; format age 4.1; run; data arm; set arm arm1(rename=(median=age)) ; by arm; if _stat_='' then _stat_='MEDIAN'; if arm=' ' then arm='Total'; run; proc sort data=arm; by _stat_; Proc transpose data=arm out=age; by _stat_; var age; id arm; run; data age(drop=Total GT0918_600_mg_day GT0918_500_mg_day GT0918_50_mg_day GT0918_400_mg_day GT0918_300_mg_day GT0918_200_mg_day GT0918_100_mg_day); set age; total1=put(total, 5.1); g_100=put(GT0918_100_mg_day, 5.1); g_200=put(GT0918_200_mg_day, 5.1); g_300=put(GT0918_300_mg_day, 5.1); g_400=put(GT0918_400_mg_day, 5.1); g_50=put(GT0918_50_mg_day, 5.1); g_500=put(GT0918_500_mg_day, 5.1); g_600=put(GT0918_600_mg_day, 5.1); run; data rep(drop=_name_ sex ethnic race agegr1 i); length Parameter $25 Category $25 sex $4; set sex ethnic race age(rename=(total1=total g_100=GT0918_100_mg_day g_200=GT0918_200_mg_day g_300=GT0918_300_mg_day g_400=GT0918_400_mg_day g_50=GT0918_50_mg_day g_500=GT0918_500_mg_day g_600=GT0918_600_mg_day _label_=Parameter _stat_=Category)) agegr1; Array arm[7] GT0918_50_mg_day GT0918_100_mg_day GT0918_200_mg_day GT0918_300_mg_day GT0918_400_mg_day GT0918_500_mg_day GT0918_600_mg_day; do i=1 to 7; if arm[i]=' ' then arm[i]='0 (0.00%)'; end; if sex='M' then sex='Male'; if sex ='Male' and _n_>1 then do; Parameter='Sex'; Category=sex; end; if ethnic ne ' ' then do; Parameter='Ethnicity'; Category=ethnic; end; if race ne ' ' then do; Parameter='Race'; Category=race; end; if agegr1 ne ' ' then do; Parameter='Age Group (Years)'; Category=agegr1; end; if Parameter='Age' then Parameter='Age (Years)'; run; Title 'Table 12.1.2.1.1'; Title2 'Demographic Characteristics'; Title3 'Safety Analysis Set'; proc report data=rep split='~' missing ; columns (Parameter Category ('Escalation Cohort' GT0918_50_mg_day GT0918_100_mg_day GT0918_200_mg_day GT0918_300_mg_day GT0918_400_mg_day GT0918_500_mg_day GT0918_600_mg_day)('Total' Total)); Define Parameter/group order=data 'Parameter' ; Define Category/group 'Category/~Statistic' left; Define GT0918_50_mg_day / 'GT0918~50 mg/day' center ; Define GT0918_100_mg_day/ 'GT0918~100 mg/day' center; Define GT0918_200_mg_day/ 'GT0918~200 mg/day' center; Define GT0918_300_mg_day/ 'GT0918~300 mg/day' center; Define GT0918_400_mg_day/ 'GT0918~400 mg/day' center; Define GT0918_500_mg_day/ 'GT0918~500 mg/day' center; Define GT0918_600_mg_day/ 'GT0918~600 mg/day' center; Define Total/'' center; compute after Parameter; line ' '; Endcomp; run; In the output window the results are in tabular format and the headings appear in blue. I need to get rid of all that. FYI: I am using SAS Studio.
... View more