Hi,
David is right. This does look like a homework problem. However, as a teacher, I am willing to offer the following suggestions:
1) have a working SAS program that reads one or more of the 12 monthly files using hard-coded input and output file names;
1a) After the program is working for 1 or 2 files, modify this program to read all 12 files (perhaps consider using a macro %do loop or the FILEVAR/FILENAME combination to read the 12 files)
2) have a working SAS program that reads the Product Info file using hard-coded input and output file names;
3) have a working SAS program that merges that output file from #1 with the Product file from #2 (decide whether you will use a merge or an sql join to get your resulting file)
4) At some point, in this process, use a where clause with hardcoded from and to dates to make sure that you can select the correct date range from either the file you create in #1 or as you do the merge or the join in #3. (I would probably include the where selection in the #3 program.
5) Now, go back and start to "macro-ize" the programs. Use %let statements for setting values like the from and to dates. Depending on how you write the program for #1, you might consider using numbered macro variables for each monthly file.
6) After you have the "macro-ized" program working with hard-coded %LET statements, create a macro program or "set" of macro programs. Perhaps you would turn program #1 into a single macro program called %readdata -- you will probably set macro parameters that will take the place of the %LET statements. It is in this macro program that you will add any macro condition logic, like %IF or add %DO loops.
7) then you might combine programs #2 and #3 into another macro program called %seldata -- again you will probably set your macro parameters for from and to dates here.
8) Test your macro programs. This options statement will help you debug any errors you get:
[pre]
options mprint mlogic symbolgen;
[/pre]
Finally, continue refining your program until the final output is the output you want.
Designing a macro program of this complexity is an iterative process. No matter what you do, you MUST have working SAS programs to start with. .
cynthia
corrected %let in #5...thanks, david!
Message was edited by: Cynthia@sas