<?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: SAS Data Integration: Lag Function in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509512#M15784</link>
    <description>&lt;P&gt;Lag will not work there, nor will it work that way in base SAS.&amp;nbsp; What you would do in Base is retain a value, then populate the other on that if its missing, e.g&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain lst_date;
  if date ne . then lst_date=date;
  else date=lst_date;
run;
&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Nov 2018 13:58:22 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-11-01T13:58:22Z</dc:date>
    <item>
      <title>SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509508#M15782</link>
      <description>&lt;P&gt;Good morning, I am writing to illustrate a problem that I just can not solve.&lt;/P&gt;&lt;P&gt;this is the data set in question (see attachment).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the Data variable has missing values, and I should fill in those values by taking what is above.&lt;BR /&gt;For example, if the date corresponds to June 30 in the first line, then also the next two lines must contain June 30th.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aware that using the LAG1 and LAG2 function I could solve the problem (as I did in SAS base 9.4). I would like to be able to reproduce this in SAS Data Integration, but I have many difficulties.&lt;BR /&gt;Could I kindly have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 13:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509508#M15782</guid>
      <dc:creator>Squack</dc:creator>
      <dc:date>2018-11-01T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509512#M15784</link>
      <description>&lt;P&gt;Lag will not work there, nor will it work that way in base SAS.&amp;nbsp; What you would do in Base is retain a value, then populate the other on that if its missing, e.g&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  retain lst_date;
  if date ne . then lst_date=date;
  else date=lst_date;
run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Nov 2018 13:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509512#M15784</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-01T13:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509516#M15786</link>
      <description>&lt;P&gt;First of all, I thank you for the help you are giving me! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Ok, I'll try this code in SAS base but what you say makes sense.&lt;/P&gt;&lt;P&gt;Can you help me in Data Integration? More than anything else I would like to understand what nodes to use to reproduce this code...&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 14:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509516#M15786</guid>
      <dc:creator>Squack</dc:creator>
      <dc:date>2018-11-01T14:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509523#M15787</link>
      <description>&lt;P&gt;I am afraid I know nothing about DIS, perhaps someone else from the community will be able to assist.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 14:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509523#M15787</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-01T14:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509525#M15788</link>
      <description>Thanks anyway for answering for SAS 9.4 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 01 Nov 2018 14:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509525#M15788</guid>
      <dc:creator>Squack</dc:creator>
      <dc:date>2018-11-01T14:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509562#M15794</link>
      <description>&lt;P&gt;For DI Studio, you need to create a User Written code transformation.&lt;/P&gt;
&lt;P&gt;Or if you think you can write reusable code, a User Written Transformation.&lt;/P&gt;
&lt;P&gt;If you need further help, specify what you need help with.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 15:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509562#M15794</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-11-01T15:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509570#M15795</link>
      <description>&lt;P&gt;Thanks for the reply LinusH!&lt;BR /&gt;I had also thought about using the User Written code transformation...&lt;BR /&gt;It is very recently that I use DI and this particular node creates many problems ..&lt;BR /&gt;The main thing is that it almost never finds the dataset I'm using.&lt;BR /&gt;Maybe I'm wrong ...&lt;BR /&gt;Can you tell me the correct procedure to use it?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 15:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509570#M15795</guid>
      <dc:creator>Squack</dc:creator>
      <dc:date>2018-11-01T15:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Data Integration: Lag Function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509585#M15796</link>
      <description>&lt;P&gt;Can you clarify what you mean by "it almost never finds the data set I'm using"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Writing efficient and roubust DI code is craftsmanship, and there's papers and documentation available.&lt;/P&gt;
&lt;P&gt;Short, you need to use the DI Studio macro variables for input and output data set, that is the baseline. In this way, any linked table will be automatically "found", given that the rest of the job and the environment as such is stable and maintained in the correct way.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-Data-Integration-Lag-Function/m-p/509585#M15796</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-11-01T16:06:50Z</dc:date>
    </item>
  </channel>
</rss>

