<?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: addition data points in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/699986#M214163</link>
    <description>&lt;P&gt;I'm having some difficulties with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge
  have
  /* look-ahead: */
  have (
    firstobs=2
    keep=day interval
    rename=(day=_day interval=_int)
  )
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I do now have this, what goes wrong? I don't understand the want and having function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lot.datafile;
merge
  have lot.datafile-lot.datafile
  /* look-ahead: */
  have (
    firstobs=2
    keep=day interval
    rename=(day=_day interval=_int)
  )
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Nov 2020 20:46:41 GMT</pubDate>
    <dc:creator>Joostvanerp</dc:creator>
    <dc:date>2020-11-18T20:46:41Z</dc:date>
    <item>
      <title>addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/696675#M212831</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure out how to reach this; The interval value from my data ranges from 1 to 8. 1 starts at the beginning of each day.&lt;/P&gt;&lt;P&gt;When the interval value goes from 2 to 4, interval 3 is missing. I would like to make another line for this with the value of eat_sec, mcount and dmintake_g 0 and the value of the day the same as where the interval is supposed to be in.&lt;BR /&gt;Interval 1 is from 5:00:00 to 7:59:59 interval 2 from 8:00:00 to 10:59:59 etc. etc. interval 8 is 02:00:00 to 4:59:59.&amp;nbsp;&lt;BR /&gt;In the new line, the starttime should be the same as the starttime of the interval it is in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; starttime  day eat_sec dmintake_g    interval&lt;BR /&gt; 5:50:06      9  1120        100         1
 6:50:06      9	1544        150         1
 12:04:51     9	1261	    400         3
 18:20:41     9	2810	     42         5
 19:45:39     9	1158	    785         5
 22:15:21     9	1501	     33         6
 5:15:45     10	291	   1100	        1
 15:23:30    10	515         180         4
 18:15:44    10	2829	   1170	        5
 20:28:08    10	1318	    540         6
 22:05:39    10	1686	    690	        6
 9:22:37     11	2883	     12	        2
 11:05:39    11	1303	    100	        3
 14:46:54    11	947         300      	4
 17:13:04    11	2176	    100     	4
 19:49:31    11	1142	    450	        5
 21:05:01    11	1071        450	        6
 21:55:15    11	1306	    520	        6&lt;/PRE&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 20:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/696675#M212831</guid>
      <dc:creator>Joostvanerp</dc:creator>
      <dc:date>2020-11-04T20:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/696776#M212885</link>
      <description>&lt;P&gt;Show us the output you seek.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 05:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/696776#M212885</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-05T05:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/697453#M213134</link>
      <description>&lt;P&gt;The output I'm looking for is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;starttime  day eat_sec dmintake_g    interval
 5:50:06      9  1120        100        1
 6:50:06      9	1544        150         1&lt;BR /&gt; 8:00:00      9    0          0         2
 12:04:51     9	1261	    400         3&lt;BR /&gt; 14:00:00     9    0          0         4
 18:20:41     9	2810	     42         5
 19:45:39     9	1158	    785         5
 22:15:21     9	1501	     33         6&lt;BR /&gt; 23:00:00     9    0          0         7&lt;BR /&gt; 02:00:00     9    0          0         8
 5:15:45     10	291	   1100	        1&lt;BR /&gt;&amp;nbsp;8:00:00     10    0           0        2&lt;BR /&gt; 11:00:00    10    0           0        3
 15:23:30    10	515         180         4
 18:15:44    10	2829	   1170	        5
 20:28:08    10	1318	    540         6
 22:05:39    10	1686	    690	        6&lt;BR /&gt; 23:00:00    10    0          0         7&lt;BR /&gt;&amp;nbsp;02:00:00    10    0          0         8&lt;BR /&gt;5:00:00      11    0          0         1
 9:22:37     11	2883 	     12	        2
 11:05:39    11	1303	    100	        3
 14:46:54    11	947         300      	4
 17:13:04    11	2176	    100     	4
 19:49:31    11	1142	    450	        5
 21:05:01    11	1071        450	        6
 21:55:15    11	1306	    520	        6&lt;BR /&gt; 23:00:00    11    0          0         7&lt;BR /&gt; 02:00:00    11    0          0         8&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 19:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/697453#M213134</guid>
      <dc:creator>Joostvanerp</dc:creator>
      <dc:date>2020-11-08T19:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/698744#M213723</link>
      <description>&lt;P&gt;Is there a statement to create an additional data row if a value in a column is missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 18:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/698744#M213723</guid>
      <dc:creator>Joostvanerp</dc:creator>
      <dc:date>2020-11-13T18:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/698860#M213764</link>
      <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue intstart
  '1' = '5:00:00't
  '2' = '8:00:00't
  '3' = '11:00:00't
  '4' = '14:00:00't
  '5' = '17:00:00't
  '6' = '20:00:00't
  '7' = '23:00:00't
  '8' = '2:00:00't
;
run;

data want;
merge
  have
  /* look-ahead: */
  have (
    firstobs=2
    keep=day interval
    rename=(day=_day interval=_int)
  )
;
output;
eat_sec = 0;
dmintake_g = 0;
do interval = interval + 1 to ifn(_int &amp;lt; interval,9,_int) - 1;
  starttime = input(put(interval,best.-l),intstart.);
  output;
end;
drop _int;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Nov 2020 08:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/698860#M213764</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-14T08:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/699986#M214163</link>
      <description>&lt;P&gt;I'm having some difficulties with&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge
  have
  /* look-ahead: */
  have (
    firstobs=2
    keep=day interval
    rename=(day=_day interval=_int)
  )
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I do now have this, what goes wrong? I don't understand the want and having function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lot.datafile;
merge
  have lot.datafile-lot.datafile
  /* look-ahead: */
  have (
    firstobs=2
    keep=day interval
    rename=(day=_day interval=_int)
  )
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Nov 2020 20:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/699986#M214163</guid>
      <dc:creator>Joostvanerp</dc:creator>
      <dc:date>2020-11-18T20:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/700020#M214185</link>
      <description>&lt;P&gt;This type of question is exactly why I put all the keywords in lower case and the user words in uppercase.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
merge
  HAVE
  /* look-ahead: */
  HAVE(
    firstobs=2
    keep    =DAY INTERVAL
    rename  =(DAY=_DAY INTERVAL=_INT)
  )
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;More legible to you?&amp;nbsp; WANT and HAVE are not options. They are data set names&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 22:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/700020#M214185</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-18T22:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: addition data points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/700094#M214222</link>
      <description>&lt;P&gt;want and have are dataset names, used to make clear which is the data we have and which is the data we want to end up with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you do not seem to be familiar with the most basic elements of the SAS language, I strongly recommend that you work through the free online Programming 1 course to get a grip on them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the meantime, the documentation of the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1kh25to5o0wmvn1o4n4hsl3yyww.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DATA&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1i8w2bwu1fn5kn1gpxj18xttbb0.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;MERGE&lt;/A&gt;&amp;nbsp;statements and the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=ledsoptsref&amp;amp;docsetTarget=titlepage.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Dataset Options&lt;/A&gt;&amp;nbsp;will be helpful.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 05:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/addition-data-points/m-p/700094#M214222</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-19T05:06:06Z</dc:date>
    </item>
  </channel>
</rss>

