<?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 Please correct my understanding of the datastep process in the code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158985#M263124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey SAS Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct my understanding of the PDV in the below code:&lt;/P&gt;&lt;P&gt;The program runs perfectly fine. &lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id $ date value holddate holdvalue lastdate lastvalue;&lt;/P&gt;&lt;P&gt;informat date holddate lastdate ddmmyy10.;&lt;/P&gt;&lt;P&gt;format date holddate lastdate ddmmyy10.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 7/10/2014 11840 7/10/2014 11840 4/10/2014 15280&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if date ne lastdate+1 then do date=lastdate+1 to holddate-1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=lastvalue;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; putlog _all_; /* I tried looking at the PDV details, still haven't understood though */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=holdvalue;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lastdate=date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lastvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where does it say in the program after the conditional do loop to get the &lt;SPAN style="text-decoration: underline;"&gt;date value to 7/10/2014 as it outputs exactly what is needed?&lt;/SPAN&gt;I.e My point is after the execution of the do loop, shouldn't date have the value of 6/10/2014 in the PDV? how did it correctly change to 7/10/2014 after i.e during the execution of 2nd output statement?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I am breaking my head for something simple, but your quick help would mean a lot to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Charlotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Dec 2014 12:34:33 GMT</pubDate>
    <dc:creator>CharlotteCain</dc:creator>
    <dc:date>2014-12-21T12:34:33Z</dc:date>
    <item>
      <title>Please correct my understanding of the datastep process in the code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158985#M263124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey SAS Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct my understanding of the PDV in the below code:&lt;/P&gt;&lt;P&gt;The program runs perfectly fine. &lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id $ date value holddate holdvalue lastdate lastvalue;&lt;/P&gt;&lt;P&gt;informat date holddate lastdate ddmmyy10.;&lt;/P&gt;&lt;P&gt;format date holddate lastdate ddmmyy10.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 7/10/2014 11840 7/10/2014 11840 4/10/2014 15280&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if date ne lastdate+1 then do date=lastdate+1 to holddate-1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=lastvalue;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; putlog _all_; /* I tried looking at the PDV details, still haven't understood though */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=holdvalue;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lastdate=date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; lastvalue=value;&lt;/P&gt;&lt;P&gt;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where does it say in the program after the conditional do loop to get the &lt;SPAN style="text-decoration: underline;"&gt;date value to 7/10/2014 as it outputs exactly what is needed?&lt;/SPAN&gt;I.e My point is after the execution of the do loop, shouldn't date have the value of 6/10/2014 in the PDV? how did it correctly change to 7/10/2014 after i.e during the execution of 2nd output statement?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I am breaking my head for something simple, but your quick help would mean a lot to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Charlotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 12:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158985#M263124</guid>
      <dc:creator>CharlotteCain</dc:creator>
      <dc:date>2014-12-21T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Please correct my understanding of the datastep process in the code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158986#M263125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very Interesting Question.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; do date=lastdate+1 to holddate-1;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;=&amp;gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; do date=lastdate+1 to holddate-1&amp;nbsp; by 1;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Maybe date will add one automatically&amp;nbsp; when it reach holddate-1 . therefore date actually would be holddate-1+1 = holddate .&lt;/P&gt;&lt;P&gt;Anyway it is good know this about SAS syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 13:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158986#M263125</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-21T13:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Please correct my understanding of the datastep process in the code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158987#M263126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this illustrates how it works more clearly than your example.&amp;nbsp; The index is incremented and then compared to stop leaving the value of I at 4 when the loop is finished.&amp;nbsp; You could use UNTIL to make it stop and leave the index eq to stop..&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_null_&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;4&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_null_&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(i eq &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; i=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;i=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 14:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-correct-my-understanding-of-the-datastep-process-in-the/m-p/158987#M263126</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-12-21T14:50:58Z</dc:date>
    </item>
  </channel>
</rss>

