<?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 Re: Trying to get the good starting date based on the type of report in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420172#M27021</link>
    <description>&lt;P&gt;%I CaNTRea% th&lt;/P&gt;
&lt;P&gt;IS code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try looking at other questions posted here for how to format code and use the {i} code window above the post are to show code with formatting preserved.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let motifrap=FINANCIER;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt; if "&amp;amp;motifrap."="FINANCIER" then &lt;BR /&gt; call symput('debut',put(nwkdom(1,2,1,year(today())),date9.));&lt;BR /&gt; else call symput('debut',cats("31OCT",year(today())));&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;debut.;&lt;/PRE&gt;
&lt;P&gt;Would be one example of simplifying that code.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2017 16:17:56 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-12-11T16:17:56Z</dc:date>
    <item>
      <title>Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420166#M27020</link>
      <description>&lt;P&gt;Hello, based on the type of report (operational or financial) I am trying to get the good starting date (see below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For an operational report, the starting date (debut) should be equal to '02jan2017'd;&lt;/P&gt;&lt;P&gt;For a financial report, the starting date (Debut) should be equal to '31oct2016'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code below but It does work and I don’t know Why.&lt;/P&gt;&lt;P&gt;Does someone could help me with that issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let motifrap=FINANCIER;&lt;BR /&gt;*%let MotifRap=OPERATIONNEL;&lt;BR /&gt;%let sysyear= %sysfunc(year("&amp;amp;sysdate"d));&lt;BR /&gt;%MACRO MotifRap;&lt;BR /&gt;%if &amp;amp;motifrap EQ "FINANCIER" %THEN&lt;BR /&gt;%DO;&lt;/P&gt;&lt;P&gt;%let Annee=&amp;amp;sysyear;&lt;BR /&gt;%let FirstWDay=%sysfunc(NWKDOM(1,2,1,&amp;amp;Annee));&lt;BR /&gt;%let FirstWorkingDay=%sysfunc(inputn(&amp;amp;FirstWDay, z8.), date9.);&lt;BR /&gt;%let Debut=%sysfunc(compress(%bquote('&amp;amp;FirstWorkingDay'd)));&lt;BR /&gt;%END;&lt;BR /&gt;%ELSE&lt;BR /&gt;%DO;&lt;BR /&gt;%let Annee=%eval(&amp;amp;sysyear-1);&lt;BR /&gt;%let Debut=%sysfunc(compress(%BQUOTE('31OCT&amp;amp;Annee.'D)));&lt;BR /&gt;%END;&lt;BR /&gt;RUN;&lt;BR /&gt;%mend MotifRap;&lt;BR /&gt;%MotifRap;&lt;BR /&gt;%put &amp;amp;Annee;&lt;BR /&gt;%put &amp;amp;FirstWDay;&lt;BR /&gt;%put &amp;amp;FirstWorkingDay;&lt;BR /&gt;%put &amp;amp;Debut;&lt;BR /&gt;%put &amp;amp;motifrap;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 16:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420166#M27020</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2017-12-11T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420172#M27021</link>
      <description>&lt;P&gt;%I CaNTRea% th&lt;/P&gt;
&lt;P&gt;IS code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try looking at other questions posted here for how to format code and use the {i} code window above the post are to show code with formatting preserved.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let motifrap=FINANCIER;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt; if "&amp;amp;motifrap."="FINANCIER" then &lt;BR /&gt; call symput('debut',put(nwkdom(1,2,1,year(today())),date9.));&lt;BR /&gt; else call symput('debut',cats("31OCT",year(today())));&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;debut.;&lt;/PRE&gt;
&lt;P&gt;Would be one example of simplifying that code.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 16:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420172#M27021</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-11T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420174#M27022</link>
      <description>&lt;P&gt;One reason is in your %if/%then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;motifrap EQ "FINANCIER" %THEN&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;amp;motifrap = FINANCIER (without quotes), not "FINANCIER" (with quotes). So you need either:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&amp;amp;motifrap" eq "FINANCIER, or &amp;amp;motifrap = FINANCIER.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 16:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420174#M27022</guid>
      <dc:creator>bstarr</dc:creator>
      <dc:date>2017-12-11T16:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420199#M27024</link>
      <description>&lt;P&gt;I have tried both but it seems that it does not recognize:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let FirstWDay=%sysfunc(NWKDOM(1,2,1,&amp;amp;Annee));&lt;BR /&gt;%let FirstWorkingDay=%sysfunc(inputn(&amp;amp;FirstWDay, z8.), date9.);&lt;BR /&gt;%let Debut=%sysfunc(compress(%bquote('&amp;amp;FirstWorkingDay'd)));&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 17:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420199#M27024</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2017-12-11T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420278#M27025</link>
      <description>&lt;P&gt;Perhaps it is time to set&lt;/P&gt;
&lt;P&gt;options mprint symbolgen;&lt;/P&gt;
&lt;P&gt;run the code and post the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 20:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420278#M27025</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-11T20:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to get the good starting date based on the type of report</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420459#M27029</link>
      <description>&lt;P&gt;I have found a solution...&lt;/P&gt;&lt;P&gt;Here's the code that is working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*options mprint symbolgen;*/&lt;/P&gt;&lt;P&gt;%MACRO MotifRap;&lt;BR /&gt;%global Annee FirstWday FirstWorkingDay Debut;&lt;BR /&gt;%let sysyear= %sysfunc(year("&amp;amp;sysdate"d));&lt;BR /&gt;%if &amp;amp;MotifRapport EQ FINANCIER %THEN&lt;BR /&gt;%DO;&lt;BR /&gt;%let Annee=&amp;amp;sysyear;&lt;BR /&gt;%let FirstWDay=%sysfunc(NWKDOM(1,2,1,&amp;amp;Annee));&lt;BR /&gt;%let FirstWorkingDay=%sysfunc(inputn(&amp;amp;FirstWDay, z8.), date9.);&lt;BR /&gt;%let Debut=%sysfunc(compress(%bquote('&amp;amp;FirstWorkingDay'd)));&lt;BR /&gt;%END;&lt;BR /&gt;%ELSE&lt;BR /&gt;%DO;&lt;BR /&gt;%let Annee=%eval(&amp;amp;sysyear-1);&lt;BR /&gt;%let Debut=%sysfunc(compress(%BQUOTE('31OCT&amp;amp;Annee.'D)));&lt;BR /&gt;%END;&lt;BR /&gt;RUN;&lt;BR /&gt;%mend MotifRap;&lt;/P&gt;&lt;P&gt;%let MotifRapport = FINANCIER;&lt;BR /&gt;%put &amp;amp;MotifRapport;&lt;BR /&gt;%MotifRap;&lt;BR /&gt;%put &amp;amp;Annee &amp;amp;FirstWDay &amp;amp;FirstWorkingDay &amp;amp;Debut;&lt;/P&gt;&lt;P&gt;%let MotifRapport = OPERATIONAL;&lt;BR /&gt;%put &amp;amp;MotifRapport;&lt;BR /&gt;%MotifRap;&lt;BR /&gt;%put &amp;amp;Annee &amp;amp;Debut;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Trying-to-get-the-good-starting-date-based-on-the-type-of-report/m-p/420459#M27029</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2017-12-12T13:46:28Z</dc:date>
    </item>
  </channel>
</rss>

