<?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 loop intnck first row deleted in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285911#M58562</link>
    <description>&lt;P&gt;If you want both d and the new date in your output, you need two variables, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data B;
set A;
do i = 0 to N;
	newD = INTNX('month', d, i, 'END');
	m =...;
	output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Jul 2016 17:42:41 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-07-20T17:42:41Z</dc:date>
    <item>
      <title>do loop intnck first row deleted</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285851#M58523</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table A and I want to duplicate each row into a table B, N times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In table A Ifor each row have:&lt;/P&gt;&lt;P&gt;a date d&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In table B i would like:&lt;/P&gt;&lt;P&gt;the date d + 1 month for each new row&lt;/P&gt;&lt;P&gt;a number m, calculated according to new date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I do something like&lt;/P&gt;&lt;PRE&gt;data B;
set A;
do i=0 to N;
d = INTNX('month', d, +1, 'e');
m =...;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;But the issue with this, is that the original record from A is deleted and we have only date d+1 to d+n and no longer d.&lt;/P&gt;&lt;P&gt;I would like the programm to understand it need to keep the initial date too, and to calculate for this date the number m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 15:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285851#M58523</guid>
      <dc:creator>fabdu92</dc:creator>
      <dc:date>2016-07-20T15:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: do loop intnck first row deleted</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285856#M58525</link>
      <description>&lt;P&gt;There should be a variety of ways to make this happen.&amp;nbsp; Here's one possibility:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data B;&lt;/P&gt;
&lt;P&gt;set A;&lt;/P&gt;
&lt;P&gt;do i=0 to N;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; m=...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; d=...;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;m=...;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;***** EDITED to move the first OUTPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes that all else is working properly, except for getting that first calculation into the output.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 16:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285856#M58525</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-07-20T16:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: do loop intnck first row deleted</title>
      <link>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285911#M58562</link>
      <description>&lt;P&gt;If you want both d and the new date in your output, you need two variables, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data B;
set A;
do i = 0 to N;
	newD = INTNX('month', d, i, 'END');
	m =...;
	output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2016 17:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/do-loop-intnck-first-row-deleted/m-p/285911#M58562</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-07-20T17:42:41Z</dc:date>
    </item>
  </channel>
</rss>

