Suggest that the OP back up and reply to this post with detailed information about what is to be accomplished, for the most accurate input and thread discussion. Providing an example of both INPUT and desired OUTPUT would be most helpful.
I am creating a data set for each month of the year. Instead of creating 12 data sets in a list, I want to use a loop and name the data sets Month1 -
Inside the data set I want to use a macro variable array that has date parameters. For example, Month_ST(1) = '01Jan2008'd....This way I can test to see if something happened during the proper time period for a particular month.
I hope that makes things a bit clearer. Thanks for everyones help.
Okay - you want to create MONTH1 through MONTH12 SAS files - separate with each file only having the specific MONTH value which would be derived from a SAS DATE variable?
You can do this with SAS macro language as was mentioned in the previous post-reply. The macro code will however also need to generate the SAS DATA step IF/THEN/OUTPUT statements and the IF portion will need to use the MONTH function to test against some SAS DATE variable and use OUTPUT to the particular MONTHn-MONTHnn file.
Or, manually code the DATA step with your 12 output files, a SET statement for your single input file, and then handcode the IF/THEN/OUTPUT/ELSE.... to use the MONTH() function and direct the observation to the appropriate/desired output file.
The SAS support website http://support.sas.com/ provides SAS-hosted product documentation and also supplemental technical and conference topic papers - a few of which I found and have pasted below for reference.