02-11-2017 10:15 PM
I have got one requirement in which I need to fetch the data from the oracle tables.
Lets suppose I have 5 years of data in the table.
A loop will run for 5 years and when the loop continues for a year ,the subloop will run for 12 months and during the inner loop run ,month and year condition will be applied to the table (under proc sql) filter condition.
Any example ,how to do this
02-12-2017 02:30 AM
See the examples in the Macro Appendix, Example 11 is a starter.
Also, look into CALL EXECUTE
02-13-2017 01:02 AM
You will need to be more specific in what you have and what you need in order for us to give you a detailed answer.
On a high level: I'd probably consider to generate the SQL with all the filter conditions and then query the Oracle table only once. If you're going for some looping approach then make sure that your date variables in the filter condition are indexed as else you're heading for 5*12 full table scans which can lead to a very poor query performance.