<?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: Sampling month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740044#M231100</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input  ID  Month : monyy7.       JAN20   FEB20   MAR20  APR20   MAY20  JUN20;
format Month  monyy7. ;
cards;
1    May20       161       105          90           111         10            99
2   Jun20         38         75           108          95         151           66
3   May20         200       80          225          22          51            99
4   Apr20          101    109         15            65            88             50
;

data want;
 set have;
 t1=vvaluex(put(intnx('month',month,-3),monyy5. -l));
 t2=vvaluex(put(intnx('month',month,-2),monyy5. -l));
 t3=vvaluex(put(intnx('month',month,-1),monyy5. -l));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 09 May 2021 12:21:04 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2021-05-09T12:21:04Z</dc:date>
    <item>
      <title>Sampling month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740041#M231097</link>
      <description>&lt;P&gt;input table&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; Month&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JAN20&amp;nbsp; &amp;nbsp;FEB20&amp;nbsp; &amp;nbsp;MAR 20&amp;nbsp; ARP20&amp;nbsp; &amp;nbsp;MAY20&amp;nbsp; JUN20&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; May20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;161&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;105&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 90&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;111&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 99&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;Jun 20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;38&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;75&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;108&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 95&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;151&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;66&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp;May20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 225&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 51&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 99&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp;Apr20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 101&amp;nbsp; &amp;nbsp; 109&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 65&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 88&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp;Month&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;T2&amp;nbsp; &amp;nbsp; &amp;nbsp; T3&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; May20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 105&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;95&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;111&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp;Jun 20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;108&amp;nbsp; &amp;nbsp; &amp;nbsp; 95&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;151&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; May20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;225&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; Apr&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;101&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;109&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the random sampling some , get last three month&amp;nbsp; sore to respective player id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for e. g for id =1 , MAY 20 should give&amp;nbsp; last 3 score of&amp;nbsp; FEB20,MAR20,APR20&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 11:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740041#M231097</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2021-05-09T11:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sampling month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740044#M231100</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input  ID  Month : monyy7.       JAN20   FEB20   MAR20  APR20   MAY20  JUN20;
format Month  monyy7. ;
cards;
1    May20       161       105          90           111         10            99
2   Jun20         38         75           108          95         151           66
3   May20         200       80          225          22          51            99
4   Apr20          101    109         15            65            88             50
;

data want;
 set have;
 t1=vvaluex(put(intnx('month',month,-3),monyy5. -l));
 t2=vvaluex(put(intnx('month',month,-2),monyy5. -l));
 t3=vvaluex(put(intnx('month',month,-1),monyy5. -l));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 May 2021 12:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740044#M231100</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-05-09T12:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sampling month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740045#M231101</link>
      <description>&lt;P&gt;This might be a good case for arrays, especially as the number of available or desired months increases:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input  ID  Month : monyy7.       JAN20   FEB20   MAR20  APR20   MAY20  JUN20;
format Month  monyy7. ;
cards;
1    May20       161       105          90           111         10            99
2   Jun20         38         75           108          95         151           66
3   May20         200       80          225          22          51            99
4   Apr20          101    109         15            65            88             50
;

data want (drop=i);
 set have;
 array cutoff {6} _temporary_ ("01jan2020"d,"01feb2020"d,"01mar2020"d,"01apr2020"d,"01may2020"d,"01jun2020"d );
 array months{6} JAN20--JUN20;
 array t {3};

 do i=1 to 3;
   t{i}= months{whichn(month,of cutoff{*})-4+i};
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 May 2021 13:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sampling-month/m-p/740045#M231101</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-05-09T13:05:17Z</dc:date>
    </item>
  </channel>
</rss>

