<?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: assign new ID numbers to my observations on sas? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444581#M111334</link>
    <description>&lt;P&gt;If you're using Enterprise Guide, particularly an older version of Enterprise Guide, just re-run the code. The error you received is explained in the following note:&amp;nbsp;&lt;A href="http://support.sas.com/kb/38/344.html" target="_blank"&gt;http://support.sas.com/kb/38/344.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Mar 2018 20:10:13 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2018-03-11T20:10:13Z</dc:date>
    <item>
      <title>assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444572#M111327</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;dataAB&amp;nbsp; which is a vertical merge of data A and data B contains ID numbers 501-510 for data A and 501-510 for data B. Now i need to do a horizontal merge by ID of dataAB with baselinedata and it will not work. I believe i need to renumber my ID. How do I do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data A ID: 501 502 503 504 505 506 507 508 509 510&lt;/P&gt;&lt;P&gt;Data B ID: 501 502 503 504 505 506 507 508 509 510&lt;/P&gt;&lt;P&gt;Baseline:&amp;nbsp; 501 502 503 504 505 506 507 508 509 510 601 602 603 604 605&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code: *************Vertical Merge***********;&lt;BR /&gt;Data dataAB; set dataa datab;&lt;BR /&gt;run;&lt;BR /&gt;**************Horizontal Merge********;&lt;BR /&gt;data HorMerge2; merge dataAB baseline;&lt;BR /&gt;by ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 18:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444572#M111327</guid>
      <dc:creator>marianthi86</dc:creator>
      <dc:date>2018-03-11T18:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444574#M111329</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198336"&gt;@marianthi86&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i need to do a horizontal merge by ID of dataAB with baselinedata and it will not work. &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why doesn't it work? What happens? What is the error? Please tell us.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 19:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444574#M111329</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-11T19:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444576#M111330</link>
      <description>&lt;P&gt;Since dataAB isn't in id order, you have to sort it before merging. e.g.:&lt;/P&gt;
&lt;PRE&gt;data dataa;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
Data datab;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510
;
data baseline;
  input ID @@;
  cards;
501 502 503 504 505 506 507 508 509 510 601 602 603 604 605
;

 

/* Code: *************Vertical Merge***********; */
data dataAB;
  set dataa datab;
run;

/* **************Horizontal Merge********; */
proc sort data=dataAB;
  by ID;
run;

data HorMerge2; 
  merge dataAB baseline;
  by ID;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 19:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444576#M111330</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-11T19:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444579#M111332</link>
      <description>When i try run the syntax&lt;BR /&gt;data baseline24;&lt;BR /&gt;input ID @@;&lt;BR /&gt;cards;&lt;BR /&gt;501 502 503 504 505 506 507 508 509 510 601 602 603 604 605&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;I get the following message:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ERROR: You cannot open WORK.BASELINE24.DATA for output access with&lt;BR /&gt;member-level control because&lt;BR /&gt;WORK.BASELINE24.DATA is in use by you in resource environment ViewTable&lt;BR /&gt;Window.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;287 ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;can you please help me resolve this issue?&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Mar 2018 19:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444579#M111332</guid>
      <dc:creator>marianthi86</dc:creator>
      <dc:date>2018-03-11T19:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444580#M111333</link>
      <description>&lt;P&gt;You can't use SAS code to modify or change a data set that is opened in ViewTable. Close the ViewTable window first.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 20:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444580#M111333</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-03-11T20:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444581#M111334</link>
      <description>&lt;P&gt;If you're using Enterprise Guide, particularly an older version of Enterprise Guide, just re-run the code. The error you received is explained in the following note:&amp;nbsp;&lt;A href="http://support.sas.com/kb/38/344.html" target="_blank"&gt;http://support.sas.com/kb/38/344.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 20:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444581#M111334</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-11T20:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444582#M111335</link>
      <description>Now that i resorted my dataA, dataB and data baseline ID with the syntax&lt;BR /&gt;you provided all my other columns were deleted from the data. How do i&lt;BR /&gt;resort my data without deleting the other columns?&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Mar 2018 20:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444582#M111335</guid>
      <dc:creator>marianthi86</dc:creator>
      <dc:date>2018-03-11T20:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444585#M111338</link>
      <description>&lt;P&gt;Sorting, in itself, doesn't delete data. You never mentioned other columns. In order for anyone to help you'd have to show us your data and the code you ran.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My initial guess is that you had created data files that contained your actual data, but overwrote them with the datasets created by the code I posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 20:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444585#M111338</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-11T20:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444587#M111339</link>
      <description>I apologize. I have included attachments of my data. And yes your guess is&lt;BR /&gt;correct. how can i sort them by ID?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Mar 2018 20:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444587#M111339</guid>
      <dc:creator>marianthi86</dc:creator>
      <dc:date>2018-03-11T20:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: assign new ID numbers to my observations on sas?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444594#M111342</link>
      <description>&lt;P&gt;I didn't see any attachments. Regardless, to sort, simply use proc sort. You only have to sort what you called the vertical merge data and, if your baseline data isn't in ID order, you'd have to sort that as well before doing the horizontal merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sun, 11 Mar 2018 21:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-new-ID-numbers-to-my-observations-on-sas/m-p/444594#M111342</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-11T21:15:20Z</dc:date>
    </item>
  </channel>
</rss>

