<?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: Adding Month Year to Title Base on the Month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485649#M126197</link>
    <description>&lt;P&gt;This code is totally&amp;nbsp;invalid.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF &amp;amp;pmo1 IN ("January","February","March") OR &amp;amp;pmo2 in ("January","February","March") THEN %let OCYR= %SYSFUNC(year(%SYSFUNC(INTNX(year,&amp;amp;today,+1))));
ELSE %let OCYR= %sysfunc(year(&amp;amp;today));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;1. %let cannot be controlled by if then&lt;/P&gt;
&lt;P&gt;2. macro variable pmo1 contains no quotes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This shows a lack of understanding of the basic concepts.&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;said, stick to a data step. You can use the macro language when your SAS skills are more advanced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 04:07:29 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-08-10T04:07:29Z</dc:date>
    <item>
      <title>Adding Month Year to Title Base on the Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485629#M126189</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure if this is the right way of doing it.&amp;nbsp; I would like to add month and year to the title based on what month it is.&amp;nbsp; I need to add one year, if month is January, February, and March, otherwise leave year as the current year.&amp;nbsp; Below is my codes.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; today = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(today());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; pmo1= &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(putn(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(month,&amp;amp;today,+3)),monname));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; pmo2= &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(putn(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(intnx(month,&amp;amp;today,+5)),monname));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF &amp;amp;pmo1 IN ("January","February","March")&amp;nbsp; OR &amp;amp;pmo2 in ("January","February","March") THEN&lt;/P&gt;&lt;P&gt;%let OCYR= %SYSFUNC(year(%SYSFUNC(INTNX(year,&amp;amp;today,+1))));&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;%let OCYR= %sysfunc(year(&amp;amp;today));&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;title1 "Testing &amp;amp;pmo1 &amp;amp;ocyr &amp;amp;pmo2 &amp;amp;ocyr";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Result:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp; &amp;nbsp;Testing November 2018 January 2019.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Thank you.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 23:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485629#M126189</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-08-09T23:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Month Year to Title Base on the Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485643#M126194</link>
      <description>&lt;P&gt;Second chance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will find this much easier if you just use a DATA step to compute the values.&amp;nbsp; Then use CALL SYMPUTX to transfer the DATA step values to macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Certainly you will need two YEAR variabels.&amp;nbsp; You can't refer to the same macro variable in two spots and have it switch from 2018 to 2019.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So start with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;today = today();&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 02:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485643#M126194</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-10T02:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Month Year to Title Base on the Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485649#M126197</link>
      <description>&lt;P&gt;This code is totally&amp;nbsp;invalid.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF &amp;amp;pmo1 IN ("January","February","March") OR &amp;amp;pmo2 in ("January","February","March") THEN %let OCYR= %SYSFUNC(year(%SYSFUNC(INTNX(year,&amp;amp;today,+1))));
ELSE %let OCYR= %sysfunc(year(&amp;amp;today));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;1. %let cannot be controlled by if then&lt;/P&gt;
&lt;P&gt;2. macro variable pmo1 contains no quotes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This shows a lack of understanding of the basic concepts.&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;said, stick to a data step. You can use the macro language when your SAS skills are more advanced.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 04:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485649#M126197</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-08-10T04:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Month Year to Title Base on the Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485807#M126263</link>
      <description>Thank you for your response and offer the solution Astounding.</description>
      <pubDate>Fri, 10 Aug 2018 15:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Month-Year-to-Title-Base-on-the-Month/m-p/485807#M126263</guid>
      <dc:creator>BonnaryW</dc:creator>
      <dc:date>2018-08-10T15:04:51Z</dc:date>
    </item>
  </channel>
</rss>

