<?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: Macros for YYMMN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376877#M276622</link>
    <description>The output for effect_date is showing as 11M03, 10M12, 11M03....Not getting in YearMonth (201409)</description>
    <pubDate>Tue, 18 Jul 2017 06:57:05 GMT</pubDate>
    <dc:creator>Nethra</dc:creator>
    <dc:date>2017-07-18T06:57:05Z</dc:date>
    <item>
      <title>Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376442#M276618</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me to write the macors for 6 months prior to YYYYMM date in YYMMN format&amp;nbsp;which is already there in Temp dataset as shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region&amp;nbsp;&amp;nbsp;&amp;nbsp; YYYYMM&lt;/P&gt;&lt;P&gt;2205500483&amp;nbsp;&amp;nbsp;&amp;nbsp; 3742&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201503&lt;/P&gt;&lt;P&gt;1105661211&amp;nbsp;&amp;nbsp;&amp;nbsp; 3411&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201410&lt;/P&gt;&lt;P&gt;2010452387&amp;nbsp;&amp;nbsp;&amp;nbsp; 4605&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201501&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Hist'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"'"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, YYYYMM, -&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;), &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;YYMMN.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"'"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;Hist.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id, Region, YYYYMM, &amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;Hist.&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Effect_date&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Temp&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;order&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;This step is not working.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 09:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376442#M276618</guid>
      <dc:creator>Nethra</dc:creator>
      <dc:date>2017-07-17T09:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376448#M276619</link>
      <description>&lt;P&gt;You appear to be using Macro (a text generation tool) for what should be a datastep process:&lt;/P&gt;
&lt;PRE&gt;data test;
  set temp;
  effect_date=intnx('month',yymm,-6);
  format effect_date yymm6.;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2017 10:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376448#M276619</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-17T10:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376471#M276620</link>
      <description>Thanks for the prompt reply!!!&lt;BR /&gt;&lt;BR /&gt;But i get the result in numeric format as 251103, 251012, 251012 even though format is used.&lt;BR /&gt;&lt;BR /&gt;Thanks !!</description>
      <pubDate>Mon, 17 Jul 2017 10:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376471#M276620</guid>
      <dc:creator>Nethra</dc:creator>
      <dc:date>2017-07-17T10:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376487#M276621</link>
      <description>&lt;P&gt;Dates and times are numeric. &amp;nbsp;Dates are number of days since Jan1960 for example. &amp;nbsp;How you display them is by using the apropriate format, e.g. yymm. &amp;nbsp;If you need a character varaible - i.e. it is no longer a date - then you use put() function:&lt;/P&gt;
&lt;PRE&gt;data test;
  set temp;
  effect_date=put(intnx('month',yymm,-6),yymm6.);
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2017 11:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376487#M276621</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-17T11:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376877#M276622</link>
      <description>The output for effect_date is showing as 11M03, 10M12, 11M03....Not getting in YearMonth (201409)</description>
      <pubDate>Tue, 18 Jul 2017 06:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376877#M276622</guid>
      <dc:creator>Nethra</dc:creator>
      <dc:date>2017-07-18T06:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376887#M276623</link>
      <description>&lt;P&gt;I would suggest do some reading on formats, a minor change to the format is all that is required, however you should know how to display data using formats, its a key item:&lt;/P&gt;
&lt;PRE&gt;data test;
  yymm="12Aug2011"d;
  effect_date=put(intnx('month',yymm,-6),yymmn6.);
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jul 2017 07:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376887#M276623</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-18T07:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376935#M276624</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153413"&gt;@Nethra&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Read very carefully everything under this link:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n0q9ylcaccjgjrn19hvqnd9cte8p.htm&amp;nbsp;" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n0q9ylcaccjgjrn19hvqnd9cte8p.htm&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is very important that you fully understand this and it will make your SAS coding life quite a bit easier if you do so,&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 11:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/376935#M276624</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-07-18T11:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macros for YYMMN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/377669#M276625</link>
      <description>Thank you all for helping me !!!! The link is useful one.</description>
      <pubDate>Thu, 20 Jul 2017 08:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-for-YYMMN/m-p/377669#M276625</guid>
      <dc:creator>Nethra</dc:creator>
      <dc:date>2017-07-20T08:16:53Z</dc:date>
    </item>
  </channel>
</rss>

