<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How Do I Create a Conditional scheduling Query for my SAS Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Create-a-Conditional-scheduling-Query-for-my-SAS-Report/m-p/794085#M254589</link>
    <description>&lt;P&gt;I have an existing report and need&amp;nbsp; to write a conditional scheduling for the report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional Information:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; 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.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conditions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If data/variable "A" is available in table A on end of previous Month for instance 31st January 2022 then publish.&lt;/P&gt;&lt;P&gt;and&amp;nbsp;If data/variable "B" is available in table B on end of previous Month for instance 31st January 2022, then publish/generate&amp;nbsp; the report&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that is; If the two conditions above are TRUE then publish / generate the report else wait till the next day and check again.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;variable&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2022&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29/01/2022&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Variable&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 19:15:09 GMT</pubDate>
    <dc:creator>tnachis</dc:creator>
    <dc:date>2022-02-02T19:15:09Z</dc:date>
    <item>
      <title>How Do I Create a Conditional scheduling Query for my SAS Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Create-a-Conditional-scheduling-Query-for-my-SAS-Report/m-p/794085#M254589</link>
      <description>&lt;P&gt;I have an existing report and need&amp;nbsp; to write a conditional scheduling for the report.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional Information:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; 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.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Conditions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If data/variable "A" is available in table A on end of previous Month for instance 31st January 2022 then publish.&lt;/P&gt;&lt;P&gt;and&amp;nbsp;If data/variable "B" is available in table B on end of previous Month for instance 31st January 2022, then publish/generate&amp;nbsp; the report&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that is; If the two conditions above are TRUE then publish / generate the report else wait till the next day and check again.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;variable&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2022&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/01/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29/01/2022&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Date&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Variable&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29/01/2022&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 19:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Create-a-Conditional-scheduling-Query-for-my-SAS-Report/m-p/794085#M254589</guid>
      <dc:creator>tnachis</dc:creator>
      <dc:date>2022-02-02T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Create a Conditional scheduling Query for my SAS Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Create-a-Conditional-scheduling-Query-for-my-SAS-Report/m-p/794103#M254597</link>
      <description>What tools are you using? What have you done so far?</description>
      <pubDate>Wed, 02 Feb 2022 20:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Do-I-Create-a-Conditional-scheduling-Query-for-my-SAS-Report/m-p/794103#M254597</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-02T20:41:50Z</dc:date>
    </item>
  </channel>
</rss>

