<?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: Loop in SAS (continued) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38478#M7723</link>
    <description>You have a basic SAS DATA step syntax error in your DATA statement (to start).  Explain what it is you want to accomplish with the {i} coding technique.  Also, for incrementing/decrementing SAS DATE, TIME, and DATETIME (numeric) variables, investigate using the INTNX function in the SAS DATA step.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Fri, 29 May 2009 12:11:51 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-05-29T12:11:51Z</dc:date>
    <item>
      <title>Loop in SAS (continued)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38477#M7722</link>
      <description>Sorry This post is continuation of the previous post (Loop in SAS) .Thanks&lt;BR /&gt;
&lt;BR /&gt;
NOTE: I am also not sure about this line in the code too:    where myTIME lt '14:05:00't + minute{i};&lt;BR /&gt;
&lt;BR /&gt;
I am trying to put a limit to tell SAS where I want it to end each day and to increment that ending time by 1 minute each time.&lt;BR /&gt;
&lt;BR /&gt;
data work.{i}test;&lt;BR /&gt;
   set work.source;&lt;BR /&gt;
   by myDay;&lt;BR /&gt;
   retain ORIGINDatetime;&lt;BR /&gt;
   FIRSTOBS = first.myDay;&lt;BR /&gt;
   if FIRSTOBS then do;&lt;BR /&gt;
      ORIGINDatetime = myDateTime + (60 * {i});&lt;BR /&gt;
   end;&lt;BR /&gt;
   format ORIGINDatetime datetime.;&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 data work.{i}test01;&lt;BR /&gt;
   set work.{i}test;&lt;BR /&gt;
   where myTIME lt '14:05:00't + minute{i};&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
 proc sql;&lt;BR /&gt;
     create table work.{i}test02 as&lt;BR /&gt;
    select myDay,mean(price) as avg_price&lt;BR /&gt;
         from work.{i}test01&lt;BR /&gt;
     group by myDay;&lt;BR /&gt;
 quit;</description>
      <pubDate>Fri, 29 May 2009 06:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38477#M7722</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T06:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Loop in SAS (continued)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38478#M7723</link>
      <description>You have a basic SAS DATA step syntax error in your DATA statement (to start).  Explain what it is you want to accomplish with the {i} coding technique.  Also, for incrementing/decrementing SAS DATE, TIME, and DATETIME (numeric) variables, investigate using the INTNX function in the SAS DATA step.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 29 May 2009 12:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38478#M7723</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T12:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Loop in SAS (continued)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38479#M7724</link>
      <description>If you need to execute a set of SAS code iteratively, substituting a value like {i}, you will need to investigate using the SAS MACRO language %DO / %END and substituting a macro variable used in the %DO loop processing.  The macro would generate, compile and execute a series of SAS DATA/PROC steps based on your macro logic.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Google advanced search argument for reference topics/DOC/papers:&lt;BR /&gt;
&lt;BR /&gt;
macro language iterative do processing site:sas.com</description>
      <pubDate>Fri, 29 May 2009 12:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-in-SAS-continued/m-p/38479#M7724</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T12:24:13Z</dc:date>
    </item>
  </channel>
</rss>

