<?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: libref not assigned error when using distinct in a proc sql sas view in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/539049#M148456</link>
    <description>&lt;PRE&gt;25         GOPTIONS ACCESSIBLE;
26         libname mylib '/aas/hardpath/datasets';
NOTE: Libref MYLIB was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: /aas/hardpath/datasets
27         
28         /*proc sql;*/
29         /*create view mylib.dream as*/
30         /*   select * from TMPLIBPT.DREAM using libname tmplibpt '/aas/hardpath/datasets/hideit' access = readonly filelocks =
30       ! none;*/
31         /*quit;*/
32         
33         data check1;
34              set mylib.dream;
35              where checkfld = "xxxx";
36         run;

1                                                          The SAS System                         10:55 Wednesday, February 27, 2019

INFO: Index checkfld selected for WHERE clause optimization.
NOTE: There were 102084 observations read from the data set TMPLIBPT.DREAM.
      WHERE checkfld='xxxx';
NOTE: There were 102084 observations read from the data set MYLIB.DREAM.
      WHERE checkfld='xxxx';
NOTE: The data set WORK.CHECK1 has 102084 observations and 11 variables.
NOTE: Compressing data set WORK.CHECK1 increased size by 12.87 percent. 
      Compressed is 114 pages; un-compressed would require 101 pages.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      user cpu time       0.10 seconds
      system cpu time     0.01 seconds
      memory              6003.15k
      OS Memory           28328.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        15  Switch Count  33
      Page Faults                       0
      Page Reclaims                     227
      Page Swaps                        0
2                                                          The SAS System                         10:55 Wednesday, February 27, 2019

      Voluntary Context Switches        98
      Involuntary Context Switches      1
      Block Input Operations            0
      Block Output Operations           14648
      

37         
38         proc sql;
39              create table check2 as select checkfld from mylib.dream
40              where checkfld = "xxxx";
NOTE: Compression was disabled for data set WORK.CHECK2 because compression overhead would increase the size of the data set.
1                                                          The SAS System                         10:55 Wednesday, February 27, 2019

INFO: Index checkfld selected for WHERE clause optimization.
NOTE: Table WORK.CHECK2 created, with 102084 rows and 1 columns.

41         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      user cpu time       0.03 seconds
      system cpu time     0.00 seconds
      memory              5681.03k
      OS Memory           28584.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        16  Switch Count  3
      Page Faults                       0
      Page Reclaims                     49
      Page Swaps                        0
      Voluntary Context Switches        18
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           1336
      

42         
43         proc sql;
44              create table check3 as select distinct checkfld from mylib.dream
45              where checkfld = "xxxx";
ERROR: Libref TMPLIBPT is not assigned.
INFO: Index checkfld of SQL table TMPLIBPT.DREAM selected for SQL SELECT DISTINCT/UNIQUE optimization.
NOTE: Compression was disabled for data set WORK.CHECK3 because compression overhead would increase the size of the data set.
NOTE: Table WORK.CHECK3 created, with 1 rows and 1 columns.

46         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.01 seconds
      system cpu time     0.01 seconds
      memory              5681.03k
      OS Memory           28584.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        17  Switch Count  2
      Page Faults                       0
      Page Reclaims                     26
      Page Swaps                        0
      Voluntary Context Switches        20
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           184
      

3                                                          The SAS System                         10:55 Wednesday, February 27, 2019

47         
48         proc sql;
49         describe view mylib.dream;
NOTE: SQL view MYLIB.DREAM is defined as:

        select *
          from TMPLIBPT.DREAM
         using libname tmplibpt '/aas/hardpath/datasets/hideit' access = readonly filelocks = none;

50         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              406.71k
      OS Memory           23460.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        18  Switch Count  0
      Page Faults                       0
      Page Reclaims                     16
      Page Swaps                        0
      Voluntary Context Switches        3
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           48
      &lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Feb 2019 16:58:33 GMT</pubDate>
    <dc:creator>cckesler</dc:creator>
    <dc:date>2019-02-27T16:58:33Z</dc:date>
    <item>
      <title>libref not assigned error when using distinct in a proc sql sas view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/538783#M148336</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;A view was created with the following definition (pulled from the describe view output)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;select *&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;from TMPLIBPT.DREAM&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;using libname tmplibpt "/hardpath/datasets/hideit" access = readonly filelocks = none;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;When I try to access it like below, it works.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mylib &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'/hardpath/datasets'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; check3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3"&gt;checkfld &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mylib.dream&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; checkfld = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"xxxx"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;When I add the distinct keyword I get an error saying the libname isn't assigned, but the step is still run.&amp;nbsp; Trying to figure out why.&amp;nbsp; I am pretty new to working with views.&amp;nbsp; Can someone help me understand this?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mylib &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'/hardpath/datasets'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; check3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;checkfld &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mylib.dream&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; checkfld = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"xxxx"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;ERROR: Libref TMPLIBPT is not assigned.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;INFO: Index checkfld of SQL table TMPLIBPT.DREAM selected for SQL SELECT DISTINCT/UNIQUE optimization.&lt;/P&gt;&lt;P&gt;NOTE: Compression was disabled for data set WORK.CHECK3 because compression overhead would increase the size of the data set.&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.CHECK3 created, with 1 rows and 1 columns.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 20:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/538783#M148336</guid>
      <dc:creator>cckesler</dc:creator>
      <dc:date>2019-02-26T20:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: libref not assigned error when using distinct in a proc sql sas view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/538798#M148346</link>
      <description>&lt;P&gt;Can you please show us the actual LOG instead of this copy-and-paste portions of the log, beginning with the entire PROC SQL part of the log where you have "&lt;FONT face="arial,helvetica,sans-serif"&gt;select *&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;from TMPLIBPT.DREAM"?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please click on the {i} icon and paste your log into the window that appears. DO NOT SKIP THIS STEP.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 20:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/538798#M148346</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-26T20:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: libref not assigned error when using distinct in a proc sql sas view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/539048#M148455</link>
      <description>&lt;PRE&gt;libname mylib '/aas/hardpath/datasets';

data check1;
     set mylib.dream;
     where checkfld = "xxxx";
run;

proc sql;
     create table check2 as select checkfld from mylib.dream
     where checkfld = "xxxx";
quit;

proc sql;
     create table check3 as select distinct checkfld from mylib.dream
     where checkfld = "xxxx";
quit;

proc sql;
describe view mylib.dream;
quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Feb 2019 16:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/539048#M148455</guid>
      <dc:creator>cckesler</dc:creator>
      <dc:date>2019-02-27T16:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: libref not assigned error when using distinct in a proc sql sas view</title>
      <link>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/539049#M148456</link>
      <description>&lt;PRE&gt;25         GOPTIONS ACCESSIBLE;
26         libname mylib '/aas/hardpath/datasets';
NOTE: Libref MYLIB was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: /aas/hardpath/datasets
27         
28         /*proc sql;*/
29         /*create view mylib.dream as*/
30         /*   select * from TMPLIBPT.DREAM using libname tmplibpt '/aas/hardpath/datasets/hideit' access = readonly filelocks =
30       ! none;*/
31         /*quit;*/
32         
33         data check1;
34              set mylib.dream;
35              where checkfld = "xxxx";
36         run;

1                                                          The SAS System                         10:55 Wednesday, February 27, 2019

INFO: Index checkfld selected for WHERE clause optimization.
NOTE: There were 102084 observations read from the data set TMPLIBPT.DREAM.
      WHERE checkfld='xxxx';
NOTE: There were 102084 observations read from the data set MYLIB.DREAM.
      WHERE checkfld='xxxx';
NOTE: The data set WORK.CHECK1 has 102084 observations and 11 variables.
NOTE: Compressing data set WORK.CHECK1 increased size by 12.87 percent. 
      Compressed is 114 pages; un-compressed would require 101 pages.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      user cpu time       0.10 seconds
      system cpu time     0.01 seconds
      memory              6003.15k
      OS Memory           28328.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        15  Switch Count  33
      Page Faults                       0
      Page Reclaims                     227
      Page Swaps                        0
2                                                          The SAS System                         10:55 Wednesday, February 27, 2019

      Voluntary Context Switches        98
      Involuntary Context Switches      1
      Block Input Operations            0
      Block Output Operations           14648
      

37         
38         proc sql;
39              create table check2 as select checkfld from mylib.dream
40              where checkfld = "xxxx";
NOTE: Compression was disabled for data set WORK.CHECK2 because compression overhead would increase the size of the data set.
1                                                          The SAS System                         10:55 Wednesday, February 27, 2019

INFO: Index checkfld selected for WHERE clause optimization.
NOTE: Table WORK.CHECK2 created, with 102084 rows and 1 columns.

41         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      user cpu time       0.03 seconds
      system cpu time     0.00 seconds
      memory              5681.03k
      OS Memory           28584.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        16  Switch Count  3
      Page Faults                       0
      Page Reclaims                     49
      Page Swaps                        0
      Voluntary Context Switches        18
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           1336
      

42         
43         proc sql;
44              create table check3 as select distinct checkfld from mylib.dream
45              where checkfld = "xxxx";
ERROR: Libref TMPLIBPT is not assigned.
INFO: Index checkfld of SQL table TMPLIBPT.DREAM selected for SQL SELECT DISTINCT/UNIQUE optimization.
NOTE: Compression was disabled for data set WORK.CHECK3 because compression overhead would increase the size of the data set.
NOTE: Table WORK.CHECK3 created, with 1 rows and 1 columns.

46         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      user cpu time       0.01 seconds
      system cpu time     0.01 seconds
      memory              5681.03k
      OS Memory           28584.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        17  Switch Count  2
      Page Faults                       0
      Page Reclaims                     26
      Page Swaps                        0
      Voluntary Context Switches        20
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           184
      

3                                                          The SAS System                         10:55 Wednesday, February 27, 2019

47         
48         proc sql;
49         describe view mylib.dream;
NOTE: SQL view MYLIB.DREAM is defined as:

        select *
          from TMPLIBPT.DREAM
         using libname tmplibpt '/aas/hardpath/datasets/hideit' access = readonly filelocks = none;

50         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              406.71k
      OS Memory           23460.00k
      Timestamp           02/27/2019 11:55:08 AM
      Step Count                        18  Switch Count  0
      Page Faults                       0
      Page Reclaims                     16
      Page Swaps                        0
      Voluntary Context Switches        3
      Involuntary Context Switches      0
      Block Input Operations            0
      Block Output Operations           48
      &lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Feb 2019 16:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/libref-not-assigned-error-when-using-distinct-in-a-proc-sql-sas/m-p/539049#M148456</guid>
      <dc:creator>cckesler</dc:creator>
      <dc:date>2019-02-27T16:58:33Z</dc:date>
    </item>
  </channel>
</rss>

