I have a file which has date fields(data is in text format eg:'20090112')
for eg fromdate1,fromdate2,fromdate3, thrudate1 thrudate2 thrudate3.
I wanted to run a proc freq on these date fileds,is it possible to include the proc freq in a do loop with in a macro?
Sure, you use DICTIONARY.COLUMNS with PROC SQL to generate a list of the macro variables you want to process, and within a SAS macro, you iterate through the macro variable list through substituting each variable on the TABLES statement.
There are references in the archives as well as topic-related reference papers / material available at the SAS support http://support.sas.com/ website.
Suggested Google advanced search argument, this topic / post:
Another possibility. Let's say you have a dataset called WORK.MYDATA, then you could do this...without needing a macro program. Because you are using the colon modifier to keep any variable that starts "fromdate" or "thrudate" (assuming they are character variables), then using the _character_ special variable reference will ONLY have proc freq create one table for each variable -- fromdate1 through fromdaten, and thrudate1 through thrudaten, etc.