<?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 DO LOOP UNIQUE START/STOP in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8164#M317</link>
    <description>Could anyone point me in the right direction. I want to perfom a do loop for a range within the loop.&lt;BR /&gt;
&lt;BR /&gt;
********************************************************;&lt;BR /&gt;
DATA MILL ;&lt;BR /&gt;
SET MILL1;&lt;BR /&gt;
BY CNTY SR SEG BEG_OFF;&lt;BR /&gt;
ARRAY DPT{29} LAY_DT1-LAY_DT29;&lt;BR /&gt;
ARRAY PAV{29} PAV_ST1-PAV_ST29;&lt;BR /&gt;
ARRAY RMS{29} RMS_CD1-RMS_CD29;&lt;BR /&gt;
&lt;BR /&gt;
DEPTH=0;&lt;BR /&gt;
CODE=0;&lt;BR /&gt;
&lt;BR /&gt;
OFF_LEN=END_OFF-BEG_OFF;&lt;BR /&gt;
IF LAY_CD1='BRDK' OR LAY_CD2='BRDK' THEN DELETE;&lt;BR /&gt;
&lt;BR /&gt;
DO I=1 TO 29 BY 1 UNTIL (CODE=21.2);&lt;BR /&gt;
&lt;BR /&gt;
 IF PAV{i} NE 'W' THEN DO; &lt;BR /&gt;
DEPTH=DPT{i}; CODE=RMS{i};&lt;BR /&gt;
output; &lt;BR /&gt;
END;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
*******************************************************;&lt;BR /&gt;
&lt;BR /&gt;
I am looking to have I=1 equal (CODE=21.1) so that I get the range between (CODE=21.1) and (CODE=21.2). The particular code is at different I throughout the data so i can set it I=6 to 29 BY 1 UNTIL (CODE=21.2);</description>
    <pubDate>Thu, 22 Apr 2010 15:31:14 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-22T15:31:14Z</dc:date>
    <item>
      <title>DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8164#M317</link>
      <description>Could anyone point me in the right direction. I want to perfom a do loop for a range within the loop.&lt;BR /&gt;
&lt;BR /&gt;
********************************************************;&lt;BR /&gt;
DATA MILL ;&lt;BR /&gt;
SET MILL1;&lt;BR /&gt;
BY CNTY SR SEG BEG_OFF;&lt;BR /&gt;
ARRAY DPT{29} LAY_DT1-LAY_DT29;&lt;BR /&gt;
ARRAY PAV{29} PAV_ST1-PAV_ST29;&lt;BR /&gt;
ARRAY RMS{29} RMS_CD1-RMS_CD29;&lt;BR /&gt;
&lt;BR /&gt;
DEPTH=0;&lt;BR /&gt;
CODE=0;&lt;BR /&gt;
&lt;BR /&gt;
OFF_LEN=END_OFF-BEG_OFF;&lt;BR /&gt;
IF LAY_CD1='BRDK' OR LAY_CD2='BRDK' THEN DELETE;&lt;BR /&gt;
&lt;BR /&gt;
DO I=1 TO 29 BY 1 UNTIL (CODE=21.2);&lt;BR /&gt;
&lt;BR /&gt;
 IF PAV{i} NE 'W' THEN DO; &lt;BR /&gt;
DEPTH=DPT{i}; CODE=RMS{i};&lt;BR /&gt;
output; &lt;BR /&gt;
END;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
*******************************************************;&lt;BR /&gt;
&lt;BR /&gt;
I am looking to have I=1 equal (CODE=21.1) so that I get the range between (CODE=21.1) and (CODE=21.2). The particular code is at different I throughout the data so i can set it I=6 to 29 BY 1 UNTIL (CODE=21.2);</description>
      <pubDate>Thu, 22 Apr 2010 15:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8164#M317</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-22T15:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8165#M318</link>
      <description>Honestly, your question or problem is unclear, at least to me.&lt;BR /&gt;
&lt;BR /&gt;
Suggest if you are having difficulty diagnosing the problem, consider adding a PUTLOG command, such as the one below at different locations (and change "nn" to some unique value for each PUTLOG occurence):&lt;BR /&gt;
&lt;BR /&gt;
PUTLOG "&amp;gt;DIAG-nn&amp;gt; " /  _ALL_;&lt;BR /&gt;
&lt;BR /&gt;
This additional code will help you detect the different variable conditions (along with SAS maintained automatic variables like _N_) as you are processing.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 22 Apr 2010 20:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8165#M318</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-22T20:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8166#M319</link>
      <description>&lt;U&gt;RMS_CD2&lt;/U&gt;	LAY_DT2	&lt;U&gt;RMS_CD3&lt;/U&gt;	LAY_DT3	&lt;U&gt;RMS_CD4&lt;/U&gt;	LAY_DT4	&lt;U&gt;RMS_CD5&lt;/U&gt;	LAY_DT5	&lt;U&gt;RMS_CD6&lt;/U&gt;	LAY_DT6	&lt;U&gt;RMS_CD7&lt;/U&gt;	LAY_DT7&lt;BR /&gt;
  &lt;U&gt;20&lt;/U&gt;	0.75	&lt;U&gt;21.1&lt;/U&gt;	-2.25	  &lt;U&gt;08&lt;/U&gt;	1.50	&lt;U&gt;21.2&lt;/U&gt;	-1.50	  &lt;U&gt;08&lt;/U&gt;	1.50	  &lt;U&gt;12&lt;/U&gt;	2.00&lt;BR /&gt;
&lt;BR /&gt;
this is how the data looks. I only want the do loop to select the fields from &lt;U&gt;RMS_CD3&lt;/U&gt; to &lt;U&gt;RMS_CD5&lt;/U&gt;.</description>
      <pubDate>Fri, 23 Apr 2010 11:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8166#M319</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-23T11:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8167#M320</link>
      <description>If I understand you right setting a start point flag should help.&lt;BR /&gt;
&lt;BR /&gt;
flag = 0;  /* Reset flag *'&lt;BR /&gt;
IF LAY_CD1='BRDK' OR LAY_CD2='BRDK' THEN DELETE;&lt;BR /&gt;
&lt;BR /&gt;
DO I=1 TO 29 BY 1 UNTIL (CODE=21.2);&lt;BR /&gt;
if RMS{i}=21.1 then flag = 1; &lt;BR /&gt;
&lt;BR /&gt;
IF PAV{i} NE 'W' and flag = 1 THEN DO; /*Starts processing after flag is set */&lt;BR /&gt;
DEPTH=DPT{i}; CODE=RMS{i};&lt;BR /&gt;
output; &lt;BR /&gt;
END;&lt;BR /&gt;
END;</description>
      <pubDate>Fri, 23 Apr 2010 12:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8167#M320</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2010-04-23T12:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8168#M321</link>
      <description>Thank you very much that is exactly what i needed.</description>
      <pubDate>Fri, 23 Apr 2010 12:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8168#M321</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-23T12:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: DO LOOP UNIQUE START/STOP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8169#M322</link>
      <description>Maybe you could help me with my next problem. I need to manipulate the data generated from the output that you helped with.  RMS{i}=21.1 is a code associated with a negative number (i.e. - 2.75). I need to subtract that number from the codes below.&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;Code&lt;/U&gt;&lt;BR /&gt;
21.1 = Milling         (Always Subtracted)&lt;BR /&gt;
06    = Pavement    (Always Added)&lt;BR /&gt;
08    = Pavement    (Always Added)&lt;BR /&gt;
40    = Base           (Ignored except when below milling)&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;Senario 1&lt;/U&gt;&lt;BR /&gt;
&lt;B&gt;Instance&lt;/B&gt;     &lt;U&gt;Code&lt;/U&gt;      &lt;I&gt;Depth&lt;/I&gt;&lt;BR /&gt;
&lt;B&gt;1               &lt;/B&gt;&lt;U&gt; 21.1      &lt;/U&gt; &lt;I&gt;-2.75 &lt;/I&gt; &lt;BR /&gt;
&lt;B&gt;2               &lt;/B&gt;&lt;U&gt; 08          &lt;/U&gt; &lt;I&gt;1.00&lt;/I&gt;     2.1=sum(1:2)       -1.75&lt;BR /&gt;
&lt;B&gt;3               &lt;/B&gt;&lt;U&gt; 40          &lt;/U&gt; &lt;I&gt;1.00&lt;/I&gt;     3.1=sum(2.1:3)    -0.75&lt;BR /&gt;
&lt;B&gt;4               &lt;/B&gt;&lt;U&gt; 06          &lt;/U&gt; &lt;I&gt;0.50&lt;/I&gt;     4.1=sum(3.1:4)    -0.25&lt;BR /&gt;
&lt;B&gt;5               &lt;/B&gt;&lt;U&gt; 08          &lt;/U&gt; &lt;I&gt;0.75&lt;/I&gt;     5.1=sum(4.1:5)     0.50&lt;BR /&gt;
&lt;B&gt;6               &lt;/B&gt;&lt;U&gt; 40          &lt;/U&gt; &lt;I&gt;6.00&lt;/I&gt;     6.1=sum(5.1:6)     0.50&lt;BR /&gt;
&lt;B&gt;7               &lt;/B&gt;&lt;U&gt; 08         &lt;/U&gt; &lt;I&gt;2.75&lt;/I&gt;     7.1=sum(6.1:7)     3.25  &lt;BR /&gt;
&lt;BR /&gt;
Output = 3.50 Total Depth</description>
      <pubDate>Fri, 23 Apr 2010 13:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-LOOP-UNIQUE-START-STOP/m-p/8169#M322</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-23T13:34:35Z</dc:date>
    </item>
  </channel>
</rss>

