<?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: Error in when running the Proc sql. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74879#M21732</link>
    <description>It might be a long shot, but if the sas table currently exists (from a previous try) then it'll need deleting before running the code again.&lt;BR /&gt;
&lt;BR /&gt;
Mike</description>
    <pubDate>Wed, 29 Sep 2010 21:24:47 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-09-29T21:24:47Z</dc:date>
    <item>
      <title>Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74875#M21728</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
When I ran the Proc sql In the SAS program in th UNIX Environment I got the below error.&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;&lt;B&gt;"ERROR: Specified resource already exists."&lt;/B&gt;&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
In the log I got this error before the quit statemnt.&lt;BR /&gt;
&lt;BR /&gt;
Can any one please give me the solution.&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Sreenivas</description>
      <pubDate>Sun, 26 Sep 2010 09:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74875#M21728</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-26T09:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74876#M21729</link>
      <description>Share the SAS code, revealed in your SAS log, and past the log as a post-reply to this forum for a most effective reply.  Without seeing all of your SAS code (as executed), it would be a guessing-game.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sun, 26 Sep 2010 13:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74876#M21729</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-26T13:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74877#M21730</link>
      <description>Do you use SAS/EG, if it is SAS/EG.&lt;BR /&gt;
For example, if the dataset has opened  in SAS/EG ,  Open this dataset again,&lt;BR /&gt;
then you would get this message.&lt;BR /&gt;
"ERROR: Specified resource already exists."&lt;BR /&gt;
You can close this dataset.</description>
      <pubDate>Mon, 27 Sep 2010 03:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74877#M21730</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-09-27T03:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74878#M21731</link>
      <description>Please find the below log for the error.Here we are also using SAS with SPDS .&lt;BR /&gt;
&lt;BR /&gt;
292        &lt;BR /&gt;
293        data t.lab_&amp;amp;pid;&lt;BR /&gt;
294        merge t.lab_d_&amp;amp;pid(in=a) lab_c(in=c);&lt;BR /&gt;
295        by CL_HE_SEQ_ID;&lt;BR /&gt;
296        if c;&lt;BR /&gt;
297        run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 1719863 observations read from the data set T.LAB_D_1.&lt;BR /&gt;
NOTE: There were 815693 observations read from the data set WORK.LAB_C.&lt;BR /&gt;
NOTE: The data set T.LAB_1 has 815693 observations and 3 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           7.96 seconds&lt;BR /&gt;
      cpu time            6.34 seconds&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
298        &lt;BR /&gt;
299        data t.lab1_&amp;amp;pid;&lt;BR /&gt;
300        set t.lab_&amp;amp;pid;&lt;BR /&gt;
301        set lab_mbr_latest key= member_card_code/unique;&lt;BR /&gt;
302         if _iorc_ ne 0 then state='';&lt;BR /&gt;
303        run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 815693 observations read from the data set T.LAB_PRE_FINAL_1.&lt;BR /&gt;
NOTE: The data set T.LAB1_1 has 815693 observations and 3 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           1:09.17&lt;BR /&gt;
      cpu time            11.85 seconds&lt;BR /&gt;
&amp;#12;9 The SAS System                                                                                  10:02 Saturday, September 25, 2010&lt;BR /&gt;
&lt;BR /&gt;
      &lt;BR /&gt;
&lt;BR /&gt;
304        &lt;BR /&gt;
305        %let spdssize=128;&lt;BR /&gt;
306        &lt;BR /&gt;
307        proc sql;&lt;BR /&gt;
308        &lt;BR /&gt;
309        create table medmart.U_LAB_NW_&amp;amp;fromdt(type=DATA) as&lt;BR /&gt;
310        select&lt;BR /&gt;
311        SUBM_PATIENT_ID as PatientID  &lt;BR /&gt;
312        from t.lab1_&amp;amp;pid;;&lt;BR /&gt;
ERROR: Specified resource already exists.&lt;BR /&gt;
&lt;BR /&gt;
313        quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           9.84 seconds&lt;BR /&gt;
      cpu time            5.68 seconds</description>
      <pubDate>Mon, 27 Sep 2010 07:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74878#M21731</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-27T07:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74879#M21732</link>
      <description>It might be a long shot, but if the sas table currently exists (from a previous try) then it'll need deleting before running the code again.&lt;BR /&gt;
&lt;BR /&gt;
Mike</description>
      <pubDate>Wed, 29 Sep 2010 21:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74879#M21732</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-29T21:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error in when running the Proc sql.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74880#M21733</link>
      <description>Sreenivas,&lt;BR /&gt;
&lt;BR /&gt;
I've never worked with SPDS, thus I'm not sure if that is what is causing the problem.  As someone mentioned, with SPDS, the problem could be due to existing files/permissions.&lt;BR /&gt;
&lt;BR /&gt;
The following test of your code works for me .. but not using SPDS:&lt;BR /&gt;
&lt;BR /&gt;
%let spdssize=128;&lt;BR /&gt;
%let pid=1;&lt;BR /&gt;
%let fromdt=29SEP2010;&lt;BR /&gt;
libname medmart "k:\art";&lt;BR /&gt;
libname t "k:\art";&lt;BR /&gt;
data t.lab_d_&amp;amp;pid (drop=height age);&lt;BR /&gt;
  set sashelp.class (rename=(&lt;BR /&gt;
    name=CL_HE_SEQ_ID&lt;BR /&gt;
    weight=SUBM_PATIENT_ID));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data lab_c (drop=weight age);&lt;BR /&gt;
  set sashelp.class (rename=(&lt;BR /&gt;
    name=CL_HE_SEQ_ID));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data t.lab_&amp;amp;pid;&lt;BR /&gt;
  merge t.lab_d_&amp;amp;pid(in=a) lab_c(in=c);&lt;BR /&gt;
  by CL_HE_SEQ_ID;&lt;BR /&gt;
  if c;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data lab_mbr_latest (drop=weight height);&lt;BR /&gt;
  set sashelp.class (rename=(&lt;BR /&gt;
    name=member_card_code));&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc datasets library=work;&lt;BR /&gt;
   modify lab_mbr_latest;&lt;BR /&gt;
      index create member_card_code;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data t.lab1_&amp;amp;pid;&lt;BR /&gt;
  set t.lab_&amp;amp;pid;&lt;BR /&gt;
  set lab_mbr_latest key= member_card_code/unique;&lt;BR /&gt;
  if _iorc_ ne 0 then state='';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  create table medmart.U_LAB_NW_&amp;amp;fromdt(type=DATA) as&lt;BR /&gt;
    select SUBM_PATIENT_ID as PatientID &lt;BR /&gt;
      from t.lab1_&amp;amp;pid;;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Some things you could try to clean up are:&lt;BR /&gt;
  (1) your second line from the bottom has 2 semicolons where only one is needed&lt;BR /&gt;
  (2) you could put periods after each time you use a macro variable&lt;BR /&gt;
  (3) is your spdssize macro variable set to a large enough number&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Other than that, I'd think that the problem is SPDS specific.  Have you asked SAS Technical Support?&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Thu, 30 Sep 2010 00:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-in-when-running-the-Proc-sql/m-p/74880#M21733</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-30T00:16:01Z</dc:date>
    </item>
  </channel>
</rss>

