<?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 until error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/do-until-error/m-p/788265#M251991</link>
    <description>&lt;P&gt;Since you are just repeatedly adding to daten, the value of result is always constant.&lt;BR /&gt;I think you should put the initial value at the beginning and add it to the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data date2;
  set date;
  result=daten;/* add this statement */
  do until (result ge &amp;amp;dt.) ;
    result = result + (40*60) ;/* change variables from daten to result*/
    output;
  end;
  format result datetime18.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 13:20:33 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-01-04T13:20:33Z</dc:date>
    <item>
      <title>do until error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-until-error/m-p/787741#M251753</link>
      <description>&lt;P&gt;&lt;BR /&gt;Below is the input dataset date.&lt;/P&gt;&lt;P&gt;I wanted output with adding up 40 minutes to the variable 'date' until it is equal or greater than 'final' variable. (wanted to create new 'result' variable for this)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but facing error while creating date2 dataset.&lt;/P&gt;&lt;P&gt;could someone please help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data date (drop = date final);&lt;BR /&gt;date = "12Jan21:06:30:00";&lt;BR /&gt;final = "12Jan21:22:30:00";&lt;BR /&gt;&lt;BR /&gt;daten = input(date,datetime18.);&lt;BR /&gt;finaln = input(final,datetime18.);&lt;BR /&gt;&lt;BR /&gt;dt = finaln;&lt;/P&gt;&lt;P&gt;format daten finaln datetime18.;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let dt = %eval(1926109800);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data date2;&lt;BR /&gt;set date;&lt;BR /&gt;do until (result ge &amp;amp;dt.) ;&lt;BR /&gt;result = daten + (40*60) ;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;format result datetime18.;&lt;BR /&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 08:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-until-error/m-p/787741#M251753</guid>
      <dc:creator>abhinayingole</dc:creator>
      <dc:date>2021-12-30T08:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: do until error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-until-error/m-p/788265#M251991</link>
      <description>&lt;P&gt;Since you are just repeatedly adding to daten, the value of result is always constant.&lt;BR /&gt;I think you should put the initial value at the beginning and add it to the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data date2;
  set date;
  result=daten;/* add this statement */
  do until (result ge &amp;amp;dt.) ;
    result = result + (40*60) ;/* change variables from daten to result*/
    output;
  end;
  format result datetime18.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 13:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-until-error/m-p/788265#M251991</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-01-04T13:20:33Z</dc:date>
    </item>
  </channel>
</rss>

