<?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: do in a data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36544#M7197</link>
    <description>Not totally sure of the question, possibly interested in a SAS coding technique requiring fewer lines to accomplish the objective?  &lt;BR /&gt;
&lt;BR /&gt;
If yes, then using a SAS ARRAY to declare the two sets of SAS variables is a technique I use often when there are repeating variable groups to assign -- sample code below, given the poster's submission:&lt;BR /&gt;
&lt;BR /&gt;
data final4 (drop=_label_);&lt;BR /&gt;
set final3;&lt;BR /&gt;
array acol (*) col1b col2b col3b col4b col5b;&lt;BR /&gt;
array aseq (*) seq1-seq5;&lt;BR /&gt;
do i=1 to dim(acol);&lt;BR /&gt;
  acol(i) = lag(aseq(i))&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 06 Aug 2008 19:03:35 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2008-08-06T19:03:35Z</dc:date>
    <item>
      <title>do in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36543#M7196</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
How to do the same thing that below (ie the same column names) with a boucle do?&lt;BR /&gt;
&lt;BR /&gt;
data final4 (drop=_label_);&lt;BR /&gt;
set final3;&lt;BR /&gt;
COL1b=lag(seq1);&lt;BR /&gt;
COL2b=lag(seq2);&lt;BR /&gt;
COL3b=lag(seq3);&lt;BR /&gt;
COL4b=lag(seq4);&lt;BR /&gt;
COL5b=lag(seq5);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
thanks by advance</description>
      <pubDate>Wed, 06 Aug 2008 16:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36543#M7196</guid>
      <dc:creator>Cyril_FR</dc:creator>
      <dc:date>2008-08-06T16:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: do in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36544#M7197</link>
      <description>Not totally sure of the question, possibly interested in a SAS coding technique requiring fewer lines to accomplish the objective?  &lt;BR /&gt;
&lt;BR /&gt;
If yes, then using a SAS ARRAY to declare the two sets of SAS variables is a technique I use often when there are repeating variable groups to assign -- sample code below, given the poster's submission:&lt;BR /&gt;
&lt;BR /&gt;
data final4 (drop=_label_);&lt;BR /&gt;
set final3;&lt;BR /&gt;
array acol (*) col1b col2b col3b col4b col5b;&lt;BR /&gt;
array aseq (*) seq1-seq5;&lt;BR /&gt;
do i=1 to dim(acol);&lt;BR /&gt;
  acol(i) = lag(aseq(i))&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 06 Aug 2008 19:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36544#M7197</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-06T19:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: do in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36545#M7198</link>
      <description>Thank you, it's exactly what i wanted to do.&lt;BR /&gt;
My programs will looks better!&lt;BR /&gt;
Cyril</description>
      <pubDate>Thu, 07 Aug 2008 09:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-in-a-data-step/m-p/36545#M7198</guid>
      <dc:creator>Cyril_FR</dc:creator>
      <dc:date>2008-08-07T09:08:53Z</dc:date>
    </item>
  </channel>
</rss>

