HI All,
i have below mentioned data.
data tab1;
input custid$ @6 saledate mmddyy10. @17 variety $9. @26 quantity ;
format saledate mmddyy10.;
datalines;
240w 02-07-2003 ginger 120
240w 02-07-2003 protea 180
356w 02-08-2003 heliconia 60
356w 02-08-2003 anthurium 300
188r 02-11-2003 ginger 24
188r 02-11-2003 anthurium 24
240w 02-12-2003 heliconia 48
240w 02-12-2003 protea 48
356w 02-12-2003 'ginger' 240
;
run;
i made below macro for same.
%macro new (flowertype=);
proc print data=tab1;
where variety ="&flowertype" & custid="&id";
run;
%mend;
%new (flowertype=ginger);
Can anyone tell me how to make macro of dates. Like i make flowertype and its ginger when i will mention any flowertype in macro then it will give me print. Same way i want to make macro of Date. if i will mention particular date then macro will show me the result of that date only.
Like this?
%macro new (date=);
proc print data=tab1;
where saledate ="&date"d ;
run;
%mend;
%new (date=07feb2003);
Yes.
Thanks alot
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.