I have an existing report and need to write a conditional scheduling for the report.
The report is a monthly report. For every new month we need to generate report for the previous Month ended. for instance in beginning of February 2022, we need to generate the report for EOM 31st January 2022.
Additional Information:
Step 1:
For every latest report published/generated, we need to save the Report date of the report in a table called the Config table; for instance, for December report 31/12/2021, we need to save the latest report date 31/12/2021 in a Config table. Hence for every Month we generate a report we need to update/refresh the report date saved in the Config table with the latest date. then, every Month, we need to compare the report date saved in the config table with the expected report Date (Previous Month date) the report was to be generated. If both dates matches then exit, else if both dates doesn't match then proceed to step2.
Step 2:
The query should check through Table A and Table B. If both conditions below are True, then generate/publish the report but if any of the condition is false we need to wait the next day to check the conditions again.
Conditions:
If data/variable "A" is available in table A on end of previous Month for instance 31st January 2022 then publish.
and If data/variable "B" is available in table B on end of previous Month for instance 31st January 2022, then publish/generate the report
that is; If the two conditions above are TRUE then publish / generate the report else wait till the next day and check again.
A | |
Date | variable |
31/01/2022 | A |
30/01/2022 | |
29/01/2022 | A |
B | |
Date | Variable |
31/01/2022 | B |
30/01/2022 | B |
29/01/2022 | B |
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.