<?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: Adding extra data to existing dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117315#M32367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Jack, this is the right approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2013 01:55:26 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2013-08-22T01:55:26Z</dc:date>
    <item>
      <title>Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117310#M32362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;How can i add extra data to an existing dataset???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have(ID flag time);&lt;/P&gt;&lt;P&gt;ID=103; flag="Y" ;time="xxx "DT; ---------/*103 already exists in the have dataset and want to create more extra records*/&lt;/P&gt;&lt;P&gt;ID=105 ; flag="N" time="XX"DT; etc etc&amp;nbsp;&amp;nbsp;&amp;nbsp; /*I am getting only the latest record????????&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 13:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117310#M32362</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-08-21T13:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117311#M32363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; PROC APPEND is your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append base=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data=extra;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply put all of your additional data into a new dataset with the same structures and field names. Use the FORCE option to add observations with new variables .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 14:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117311#M32363</guid>
      <dc:creator>Murray_Court</dc:creator>
      <dc:date>2013-08-21T14:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117312#M32364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try the below code&lt;/P&gt;&lt;P&gt;i removed 103 record considering that the record already exists in the have data set, in order to insert the new records please include with the do and end statement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have(ID flag time) end=eof;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;if end then do;&lt;/P&gt;&lt;P&gt;ID=105 ; flag="N" time="XX"DT; &lt;/P&gt;&lt;P&gt;/*include more records*/&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 17:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117312#M32364</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-21T17:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117313#M32365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alternately to proc append, there is&amp;nbsp; proc sql insert method or the tried and true data step set. If its a large dataset append and insert have some advantages not having to rewrite the old data to the dataset,. Append has simplier syntax especially for very wide datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either way you need a separate dataset with the additions. Below I use Append to add to the original dataset and a data step to show an example of creating a new dataset with all the observations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;format id $3. Flag $1. time timeampm8.;&lt;/P&gt;&lt;P&gt;infile cards dsd ;&lt;/P&gt;&lt;P&gt;input id flag $ time : time8.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;103,N,12:15 AM&lt;/P&gt;&lt;P&gt;105,Y,1:35 PM&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Add;&lt;/P&gt;&lt;P&gt;format id $3. Flag $1. time timeampm8.;&lt;/P&gt;&lt;P&gt;infile cards dsd ;&lt;/P&gt;&lt;P&gt;input id flag $ time : time8.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;103,Y,2:15 PM&lt;/P&gt;&lt;P&gt;105,N,1:45 AM&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have add;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append base=have data=add force; run;&lt;/P&gt;&lt;P&gt;--------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 17:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117313#M32365</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-08-21T17:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117314#M32366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just looking at the above code I believe you would need an explicit output statement after each new row you were adding to the dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if end then do;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=105 ; flag="N" time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=103 ; flag="Y" time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=105 ; flag="Y" time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 18:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117314#M32366</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-08-21T18:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117315#M32367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Jack, this is the right approach&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2013 01:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117315#M32367</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-22T01:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117316#M32368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there a semicolon after the flag variable too like shown below????in your code the semicolon is missing after the flag variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if end then do;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=105 ; flag="N"&lt;STRONG&gt;;&lt;/STRONG&gt; time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=103 ; flag="Y"&lt;STRONG&gt;;&lt;/STRONG&gt; time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ID=105 ; flag="Y"&lt;STRONG&gt;;&lt;/STRONG&gt; time="XX"DT;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 05:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117316#M32368</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-08-23T05:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding extra data to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117317#M32369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is correct. Sorry did not notice the omission.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 09:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Adding-extra-data-to-existing-dataset/m-p/117317#M32369</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-08-23T09:49:41Z</dc:date>
    </item>
  </channel>
</rss>

