<?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 Reg:Dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Dates/m-p/14427#M2300</link>
    <description>HI i am having differnt months and year if the reporting month is mar10 then i should create new variable called mar_diff and it should minus from the last two months jan10-feb10 and if reporting month is jan10 it should minus from nov-09-dec-09 and i should create new variable jan10_diff  like that&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
input oct09 nov09 dec09 jan10 feb10 mar10;&lt;BR /&gt;
cards;&lt;BR /&gt;
10 11 12 13 14 15 16&lt;BR /&gt;
run;</description>
    <pubDate>Tue, 22 Feb 2011 05:02:49 GMT</pubDate>
    <dc:creator>R_Win</dc:creator>
    <dc:date>2011-02-22T05:02:49Z</dc:date>
    <item>
      <title>Reg:Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Dates/m-p/14427#M2300</link>
      <description>HI i am having differnt months and year if the reporting month is mar10 then i should create new variable called mar_diff and it should minus from the last two months jan10-feb10 and if reporting month is jan10 it should minus from nov-09-dec-09 and i should create new variable jan10_diff  like that&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
input oct09 nov09 dec09 jan10 feb10 mar10;&lt;BR /&gt;
cards;&lt;BR /&gt;
10 11 12 13 14 15 16&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 22 Feb 2011 05:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Dates/m-p/14427#M2300</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2011-02-22T05:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Dates/m-p/14428#M2301</link>
      <description>Hi.&lt;BR /&gt;
Your data structure is not look good. So I change it .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input oct09 nov09 dec09 jan10 feb10 mar10;&lt;BR /&gt;
cards;&lt;BR /&gt;
10 12 12 13 14 15 16&lt;BR /&gt;
20 21 22 22 24 24 26&lt;BR /&gt;
;&lt;BR /&gt;
run; &lt;BR /&gt;
data op(keep=_count count val var);&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 count+1; &lt;BR /&gt;
 array month{*} _numeric_;&lt;BR /&gt;
 do i=1 to dim(month);&lt;BR /&gt;
  var=vname(month{i});&lt;BR /&gt;
  val=month{i}; &lt;BR /&gt;
  _count+1;&lt;BR /&gt;
  output;&lt;BR /&gt;
 end; &lt;BR /&gt;
 call missing (_count);&lt;BR /&gt;
run;&lt;BR /&gt;
data opp;&lt;BR /&gt;
 set op;&lt;BR /&gt;
 output;&lt;BR /&gt;
 var=cats(var,'_diff');&lt;BR /&gt;
 val=lag2(val)-lag(val);&lt;BR /&gt;
 if _count in (1 2) then call missing(val);&lt;BR /&gt;
 output;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
proc transpose data=opp out=want(drop=_name_ count:);&lt;BR /&gt;
 by count;&lt;BR /&gt;
 id var;&lt;BR /&gt;
 var val;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Ksharp&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Tue, 22 Feb 2011 08:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Dates/m-p/14428#M2301</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-22T08:50:33Z</dc:date>
    </item>
  </channel>
</rss>

