<?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: Difference between columns in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Difference-between-columns/m-p/238073#M14824</link>
    <description>&lt;P&gt;Well, as I always suggest, don't put "data" items in columns headers. &amp;nbsp;A normalised data strucutre:&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp;YEAR &amp;nbsp; &amp;nbsp; &amp;nbsp;MONTH &amp;nbsp; VALUE&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will make your life so much easier to work with the data, and do manipulations. &amp;nbsp;Then if you need it transposed in the output, transpose it just before the report section. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, you can do this by using arrays, but you need to know how many columns there are (hence why the above strcuture is far more robust and usable):&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array cols{4} fico_2014_01 fico_2014_02...04; /* Note shortened */
  array diffs{3} 8.;
  do i=2 to 4;  /* no comparison on first */
    diff{i-1}=cols{i}-cols{i-1};
  end;
run;&lt;/PRE&gt;
&lt;P&gt;However, again, work with a usable strcuture and your life will be easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 14:51:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-12-07T14:51:37Z</dc:date>
    <item>
      <title>Difference between columns</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Difference-between-columns/m-p/238066#M14823</link>
      <description>&lt;PRE&gt;id       fico_2014_01	fico_2014_02	fico_2014_03	fico_2014_04	
15013	     668	     668	     668	     670	     







How to find the difference between two months:

 id       fico_2014_01	 fico_2014_02	diff1          fico_2014_03	diff2     fico_2014_04	diff3
15013	     668	     668	  0               668	          0          670	 2


here diff1 is diiference between fico_2014_01	 and fico_2014_02 
     diff2 is diiference between fico_2014_02	 and fico_2014_03  
     diff3 is diiference between fico_2014_03	 and fico_2014_04 


&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Dec 2015 14:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Difference-between-columns/m-p/238066#M14823</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2015-12-07T14:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between columns</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Difference-between-columns/m-p/238073#M14824</link>
      <description>&lt;P&gt;Well, as I always suggest, don't put "data" items in columns headers. &amp;nbsp;A normalised data strucutre:&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp;YEAR &amp;nbsp; &amp;nbsp; &amp;nbsp;MONTH &amp;nbsp; VALUE&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will make your life so much easier to work with the data, and do manipulations. &amp;nbsp;Then if you need it transposed in the output, transpose it just before the report section. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, you can do this by using arrays, but you need to know how many columns there are (hence why the above strcuture is far more robust and usable):&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  array cols{4} fico_2014_01 fico_2014_02...04; /* Note shortened */
  array diffs{3} 8.;
  do i=2 to 4;  /* no comparison on first */
    diff{i-1}=cols{i}-cols{i-1};
  end;
run;&lt;/PRE&gt;
&lt;P&gt;However, again, work with a usable strcuture and your life will be easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 14:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Difference-between-columns/m-p/238073#M14824</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-07T14:51:37Z</dc:date>
    </item>
  </channel>
</rss>

