sas macro - SAS put variable format in title -
I have a variable agegroup
, which many categories, such as: 1 = "0- 5 "2 =" 6-10 "etc.
If I agegroup
I am by making a macro to print data and to age group format in the title, so how can I do it?
% macro Apiprint (Age Grade = 1); Proc print data = age; Title "Age Group and Age Grade"; Run; % improvement;
If I run this macro am I like the title "age group may be printed as" age group 0-5 "instead of" 1.
Is there any sign?
Thank you!
You can also use the # byval (age) option, assuming it is formatted in the title:
proc format; Let grpformat 0 - 12 = '0 - 12' 12 - 14 = '12 - 14 'Other = "Other"; Run; Proc sort data = sashelp.class = class; by age; Run; Proc print data = square; by age; Format age grpformat.; Title "Age Group # Beewell (Age)"; Run;
You can still use the same method if you need a macro to control that where the output is going for example:
% macro ageprint (agegrp = 1); Proc print data = age; By Agegrp; Title "Age Group # byval (agegrp)"; Run; % improvement;
Comments
Post a Comment