<?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 array and lead function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269407#M55163</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to use lead function to create many variables, so I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data reptrade.than1b;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set reptrade.goc1;&lt;BR /&gt;array rett [10] rett1-rett10;&lt;BR /&gt;array eof [10];&lt;BR /&gt;do i=1 to dim(rett);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if eof[i]= 0 then set reptrade.goc (firstobs= i+1 keep=ret rename=(ret=rett[i])) end=eof[i];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else rett [i]=0;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it doesn't work. the log file shows that the firstobs is wrong and lead[ is also wrong. anyone can help me?&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2016 13:05:58 GMT</pubDate>
    <dc:creator>HaTruong</dc:creator>
    <dc:date>2016-05-10T13:05:58Z</dc:date>
    <item>
      <title>array and lead function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269407#M55163</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to use lead function to create many variables, so I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data reptrade.than1b;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set reptrade.goc1;&lt;BR /&gt;array rett [10] rett1-rett10;&lt;BR /&gt;array eof [10];&lt;BR /&gt;do i=1 to dim(rett);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if eof[i]= 0 then set reptrade.goc (firstobs= i+1 keep=ret rename=(ret=rett[i])) end=eof[i];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else rett [i]=0;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it doesn't work. the log file shows that the firstobs is wrong and lead[ is also wrong. anyone can help me?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 13:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269407#M55163</guid>
      <dc:creator>HaTruong</dc:creator>
      <dc:date>2016-05-10T13:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: array and lead function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269414#M55164</link>
      <description>&lt;P&gt;Is this your intention?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Observations 1 through 61 contrihute to the first observation in the new data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Observations 2 through 62 contribute to the second observation in the new data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Follow the pattern, but zero-fill if you run out of observations.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 13:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269414#M55164</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-05-10T13:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: array and lead function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269439#M55165</link>
      <description>&lt;P&gt;When you have errors it helps to show the code and error or other messages&amp;nbsp;from the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Doesn't work" is kind of a vague description of what happens. Is the data set not created? Errors? Unexpected or incomplete data?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 14:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/array-and-lead-function/m-p/269439#M55165</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-10T14:07:04Z</dc:date>
    </item>
  </channel>
</rss>

