<?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: Data set manipulations in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4051#M1698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rossu12, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have put some code below which should answer your query. If anything is not clear let me know.&lt;/P&gt;&lt;P&gt;All the best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Example dataset based on the information you gave;&lt;/P&gt;&lt;P&gt;DATA original;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DO base= 1 TO 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTPUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Create new variable 'new' based on variable 'base', _N_ is the automatic macro variable which hold the value of observation number that is being processed from &lt;/P&gt;&lt;P&gt;&amp;nbsp; input dataset (original), It can be used to count observation number as well;&lt;/P&gt;&lt;P&gt;DATA newds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET original;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new = (base*(_N_+1)) *&amp;nbsp; (base*(_N_));&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2014 09:37:17 GMT</pubDate>
    <dc:creator>RafiRahi</dc:creator>
    <dc:date>2014-05-16T09:37:17Z</dc:date>
    <item>
      <title>Data set manipulations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4049#M1696</link>
      <description>My question is probably very naive as I am a newbie:&lt;BR /&gt;
&lt;BR /&gt;
Say I have a data set with one variable and 10 observations - call this variable a "base". I want to create a new variable based on the existing data set call this variable "new". Observations in "new" should be calculated from "base" - say "new" = "base" (observation i+1) * "base" (observation i).&lt;BR /&gt;
&lt;BR /&gt;
Another question is how to create a new variable that will include all the observations from the base starting with observation i from "base" ?</description>
      <pubDate>Fri, 03 Aug 2007 17:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4049#M1696</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-03T17:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data set manipulations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4050#M1697</link>
      <description>Found the answer in different Forum/Category&lt;BR /&gt;
&lt;BR /&gt;
here is the link to Cynthia@SAS post:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?threadID=1400&amp;amp;tstart=90" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?threadID=1400&amp;amp;tstart=90&lt;/A&gt;</description>
      <pubDate>Fri, 03 Aug 2007 19:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4050#M1697</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-03T19:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data set manipulations</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4051#M1698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rossu12, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have put some code below which should answer your query. If anything is not clear let me know.&lt;/P&gt;&lt;P&gt;All the best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rafi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Example dataset based on the information you gave;&lt;/P&gt;&lt;P&gt;DATA original;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DO base= 1 TO 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTPUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Create new variable 'new' based on variable 'base', _N_ is the automatic macro variable which hold the value of observation number that is being processed from &lt;/P&gt;&lt;P&gt;&amp;nbsp; input dataset (original), It can be used to count observation number as well;&lt;/P&gt;&lt;P&gt;DATA newds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET original;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new = (base*(_N_+1)) *&amp;nbsp; (base*(_N_));&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 09:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Data-set-manipulations/m-p/4051#M1698</guid>
      <dc:creator>RafiRahi</dc:creator>
      <dc:date>2014-05-16T09:37:17Z</dc:date>
    </item>
  </channel>
</rss>

