<?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 help with generate more time points in the data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10289#M961</link>
    <description>Dear SAS users:&lt;BR /&gt;
&lt;BR /&gt;
I hope to get some help for adding more data points in the data set. &lt;BR /&gt;
&lt;BR /&gt;
My data file is like following:&lt;BR /&gt;
&lt;BR /&gt;
ID TIME CONC.  AGE WEIGHT  &lt;BR /&gt;
1    0        10           22      70&lt;BR /&gt;
2    0        11           24      65&lt;BR /&gt;
3    0         9            33      71&lt;BR /&gt;
4    0         8            31      66 &lt;BR /&gt;
&lt;BR /&gt;
Every ID only has one CONC. at TIME=0. I'd like to add more TIME points eg. 0, 1, 2, 3, 4 ..to 100 for every ID. So the final format should look like:&lt;BR /&gt;
&lt;BR /&gt;
ID TIME CONC. AGE WEIGHT &lt;BR /&gt;
1     0       10         22        70&lt;BR /&gt;
1     1       10         22        70&lt;BR /&gt;
1     2       10         22        70&lt;BR /&gt;
...&lt;BR /&gt;
2     0       11           24      65&lt;BR /&gt;
2     1       11           24      65&lt;BR /&gt;
2     2       11           24      65&lt;BR /&gt;
   &lt;BR /&gt;
...&lt;BR /&gt;
3     0       9            33      71&lt;BR /&gt;
3     1       9            33      71&lt;BR /&gt;
3     2       9            33      71&lt;BR /&gt;
...&lt;BR /&gt;
4     0        8            31      66 &lt;BR /&gt;
4     1        8            31      66 &lt;BR /&gt;
4     2        8            31      66 &lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
I was trying to use DO LOOP, change the TIME and use SET to merge the data. The code is listed below. But I have not succeeded. As then number in do loop increase, I get less and less observations in the data set. Thanks in advance.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
filename datain&lt;BR /&gt;
'E:\\pk.csv';&lt;BR /&gt;
&lt;BR /&gt;
data fulldata;&lt;BR /&gt;
infile datain DELIMITER=',';&lt;BR /&gt;
input  ID TIME CONC AGE WEIGHT;&lt;BR /&gt;
if ID EQ _blank_ THEN delete;&lt;BR /&gt;
drop _blank_;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data pk1;&lt;BR /&gt;
set fulldata;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data pkn;&lt;BR /&gt;
do i=1 to 100 ;&lt;BR /&gt;
set pk1;&lt;BR /&gt;
TIME=TIME+i;&lt;BR /&gt;
end;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 26 Apr 2010 18:22:53 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-26T18:22:53Z</dc:date>
    <item>
      <title>help with generate more time points in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10289#M961</link>
      <description>Dear SAS users:&lt;BR /&gt;
&lt;BR /&gt;
I hope to get some help for adding more data points in the data set. &lt;BR /&gt;
&lt;BR /&gt;
My data file is like following:&lt;BR /&gt;
&lt;BR /&gt;
ID TIME CONC.  AGE WEIGHT  &lt;BR /&gt;
1    0        10           22      70&lt;BR /&gt;
2    0        11           24      65&lt;BR /&gt;
3    0         9            33      71&lt;BR /&gt;
4    0         8            31      66 &lt;BR /&gt;
&lt;BR /&gt;
Every ID only has one CONC. at TIME=0. I'd like to add more TIME points eg. 0, 1, 2, 3, 4 ..to 100 for every ID. So the final format should look like:&lt;BR /&gt;
&lt;BR /&gt;
ID TIME CONC. AGE WEIGHT &lt;BR /&gt;
1     0       10         22        70&lt;BR /&gt;
1     1       10         22        70&lt;BR /&gt;
1     2       10         22        70&lt;BR /&gt;
...&lt;BR /&gt;
2     0       11           24      65&lt;BR /&gt;
2     1       11           24      65&lt;BR /&gt;
2     2       11           24      65&lt;BR /&gt;
   &lt;BR /&gt;
...&lt;BR /&gt;
3     0       9            33      71&lt;BR /&gt;
3     1       9            33      71&lt;BR /&gt;
3     2       9            33      71&lt;BR /&gt;
...&lt;BR /&gt;
4     0        8            31      66 &lt;BR /&gt;
4     1        8            31      66 &lt;BR /&gt;
4     2        8            31      66 &lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
I was trying to use DO LOOP, change the TIME and use SET to merge the data. The code is listed below. But I have not succeeded. As then number in do loop increase, I get less and less observations in the data set. Thanks in advance.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
filename datain&lt;BR /&gt;
'E:\\pk.csv';&lt;BR /&gt;
&lt;BR /&gt;
data fulldata;&lt;BR /&gt;
infile datain DELIMITER=',';&lt;BR /&gt;
input  ID TIME CONC AGE WEIGHT;&lt;BR /&gt;
if ID EQ _blank_ THEN delete;&lt;BR /&gt;
drop _blank_;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data pk1;&lt;BR /&gt;
set fulldata;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data pkn;&lt;BR /&gt;
do i=1 to 100 ;&lt;BR /&gt;
set pk1;&lt;BR /&gt;
TIME=TIME+i;&lt;BR /&gt;
end;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 26 Apr 2010 18:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10289#M961</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-26T18:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: help with generate more time points in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10290#M962</link>
      <description>Rewrite your last step to&lt;BR /&gt;
&lt;BR /&gt;
data pkn;&lt;BR /&gt;
set pk1;&lt;BR /&gt;
OUTPUT;&lt;BR /&gt;
do i=1 to 100 ;&lt;BR /&gt;
  TIME=TIME+i;&lt;BR /&gt;
  OUTPUT;&lt;BR /&gt;
end;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
Note the re-arrangement and the addition of the two OUTPUT statements.  The first one outputs the original record and the second one outputs the 100 synthetic records.</description>
      <pubDate>Mon, 26 Apr 2010 18:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10290#M962</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-04-26T18:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: help with generate more time points in the data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10291#M963</link>
      <description>Hi Doc@Duke:&lt;BR /&gt;
&lt;BR /&gt;
It works. Thanks a lot.</description>
      <pubDate>Mon, 26 Apr 2010 20:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/help-with-generate-more-time-points-in-the-data/m-p/10291#M963</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-26T20:10:11Z</dc:date>
    </item>
  </channel>
</rss>

