<?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: Basic SAS Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576989#M163413</link>
    <description>&lt;P&gt;I have the data in SAS and want to calculate the sum of every 125 observations for the time period.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2019 17:07:07 GMT</pubDate>
    <dc:creator>NewtoSAS00</dc:creator>
    <dc:date>2019-07-26T17:07:07Z</dc:date>
    <item>
      <title>Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576888#M163366</link>
      <description>&lt;P&gt;Hi, I'm new to SAS and wondered if anyone can help. I have a dataset with 500 observations per year, over a 10 year period. I want to add observations 1-125, 126-250, 251-375, 376-500 for each year over the entire period. If there's any guidance you can provide, it'd be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576888#M163366</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T13:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576893#M163367</link>
      <description>&lt;P&gt;Per your description, you already have that dataset (5000 observations), so what do you want to add?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282967"&gt;@NewtoSAS00&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'm new to SAS and wondered if anyone can help. I have a dataset with 500 observations per year, over a 10 year period. I want to add observations 1-125, 126-250, 251-375, 376-500 for each year over the entire period. If there's any guidance you can provide, it'd be much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576893#M163367</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-26T13:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576898#M163369</link>
      <description>&lt;P&gt;Hi: Observations are not "numbered" in a SAS dataset in storage. So the question is do you need to CHANGE observations that are already there? If so, then that is a more complex solution. But if you only need to ADD observations that do not exist in the data, then all you need to do is concatenate or append the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you need for the observations to be in a certain order, you've got to pick something other than observation number, because that is just an added bit of information in PROC PRINT and other PROCS. Observation number can change based on the sorted order of the data rows. So observation 1-250 sorted by country, for example, will be different than observation 1-250 sorted by name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576898#M163369</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-26T13:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576933#M163385</link>
      <description>&lt;P&gt;Do you have your data in SAS already?&lt;/P&gt;
&lt;P&gt;or are you asking how to read the files you may have into SAS data sets?&lt;/P&gt;
&lt;P&gt;or how to combine existing SAS data sets?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576933#M163385</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-26T15:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576987#M163411</link>
      <description>&lt;P&gt;I want the sum of every 125 observations over the entire time period.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 17:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576987#M163411</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T17:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576988#M163412</link>
      <description>&lt;P&gt;I have the observations sorted and want to calculate the sum of every 125 observations throughout the time period.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 17:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576988#M163412</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576989#M163413</link>
      <description>&lt;P&gt;I have the data in SAS and want to calculate the sum of every 125 observations for the time period.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 17:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/576989#M163413</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T17:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577061#M163453</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282967"&gt;@NewtoSAS00&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;Since you don't show a subset of your sample data, I've mocked it up assuming that the value you want to sum up is called VALUE. This data set HAVE is intrinsically sorted, just as you say you file is; hence to get what you want, you can code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                           
  do year = 1 to 10 ;                 
    do value = 1 to 500 ;             
      output ;                        
    end ;                             
  end ;                               
run ;                                 
                                      
data want (drop = value) ;    
  do _n_ = 1 to 125 ;                 
    set have (keep = year value) ;                        
    sumvalue = sum (sumvalue, value) ;
  end ;                               
run ;                                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will give you 5000/125=40 records with the summary values. If you want to tag the summary values SUMVALUE to the original records, repeat the DOW loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;                           
  do _n_ = 1 to 125 ;                 
    set have (keep = value) ;                        
    sumvalue = sum (sumvalue, value) ;
  end ;                               
  do _n_ = 1 to 125 ;                 
    set have ;                        
    output ;                          
  end ;                               
run ;                                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577061#M163453</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-07-26T19:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577077#M163464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 20:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577077#M163464</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T20:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577082#M163469</link>
      <description>&lt;P&gt;Oh, that's what you meant by "add". Well, you got your answer, so all that ends well is well &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 20:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577082#M163469</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-26T20:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577092#M163479</link>
      <description>Thank you.</description>
      <pubDate>Fri, 26 Jul 2019 20:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577092#M163479</guid>
      <dc:creator>NewtoSAS00</dc:creator>
      <dc:date>2019-07-26T20:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Basic SAS Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577130#M163508</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282967"&gt;@NewtoSAS00&lt;/a&gt;&amp;nbsp;: Welcome.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 06:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-SAS-Help/m-p/577130#M163508</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-07-27T06:01:31Z</dc:date>
    </item>
  </channel>
</rss>

