<?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: USING LIBNAME in a VIEW in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906775#M358040</link>
    <description>&lt;P&gt;Using libnames it should work as long as view's are supported. M8 is not necessary.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2023 18:13:54 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2023-12-07T18:13:54Z</dc:date>
    <item>
      <title>USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906732#M358021</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to generate a View with either DATA SET or PROC SQL that would be accessible by anyone in my team afterward whitout the need to run SAS code. In other word, I would expect that everything is included in the VIEW to be able to view it without requiring running additional SAS code to get LIBNAME definition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With DATA SET I tried to bypass the use of LIBNAME and put the path directly, but I get an error.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA "/root/balbalba/reter/Central.sas7dbat" / VIEW="/root/balbalba/reter/Central.sas7dbat";
        SET "/root/balbalba/reter/Other_Table.sas7dbat";

        SET "/root/balbalba/reter/Other_Table2.sas7dbat" KEY = AGREEMENT_NUMBER / UNIQUE;
        IF _IORC_=%SYSRC(_DSENOM) THEN DO;
            _ERROR_ = 0;
        END;
    RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This give me an Error on the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;VIEW="/root/balbalba/reter/Central.sas7dbat"&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ERROR 22-322: Expecting a name.&lt;/LI&gt;&lt;LI&gt;ERROR 200-322: The symbol is no recognized and will be ignored.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried to use the functionalty 'USING LIBNAME' in a PROC SQL:&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Notes:&lt;BR /&gt;&amp;amp;TABLES_SAVE_PATH_LIBNAME. =&amp;nbsp;REP_DB&amp;nbsp;(which&amp;nbsp;is&amp;nbsp;a&amp;nbsp;LIBNAME defined in previous code)&lt;BR /&gt;&amp;amp;TABLES_SAVE_PATH.&amp;nbsp;=&amp;nbsp;"/root/balbalba/reter"&lt;BR /&gt;&lt;BR /&gt;PROC SQL;
        CREATE VIEW &amp;amp;TABLES_SAVE_PATH_LIBNAME..Central AS
           SELECT   MAT.*,
                    MAIN.*
            FROM &amp;amp;TABLES_SAVE_PATH_LIBNAME..Other_Table MAT
            USING LIBNAME &amp;amp;TABLES_SAVE_PATH_LIBNAME. &amp;amp;TABLES_SAVE_PATH.
            LEFT JOIN &amp;amp;TABLES_SAVE_PATH_LIBNAME..Other_Table2 MAIN
                ON MAT.AGREEMENT_NUMBER=MAIN.AGREEMENT_NUMBER;
    QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Which give me these error:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ERROR: Library REP_DB does not exist.&lt;BR /&gt;ERROR: SQL view was not defined due to errors.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing seem to work... If anyone could give me a solution that would be really nice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Samuel&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 Dec 2023 16:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906732#M358021</guid>
      <dc:creator>samlac</dc:creator>
      <dc:date>2023-12-07T16:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906734#M358022</link>
      <description>&lt;P&gt;Please try this modified version of the code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Libname lib1 "/root/balbalba/reter";

DATA lib1.Central / VIEW= lib1.Central_v;
        SET lib1.Other_Table;
        SET lib1.Other_Table2 KEY = AGREEMENT_NUMBER / UNIQUE;
        IF _IORC_=%SYSRC(_DSENOM) THEN DO;
            _ERROR_ = 0;
        END;
    RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2023 16:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906734#M358022</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-12-07T16:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906735#M358023</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I already thied that, but it does work at creating the VIEW, but the VIEW wont work after as the lib1 wont be defined anymore. I need the LIBNAME to be part of the VIEW itself.</description>
      <pubDate>Thu, 07 Dec 2023 16:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906735#M358023</guid>
      <dc:creator>samlac</dc:creator>
      <dc:date>2023-12-07T16:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906738#M358024</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL is an animal which likes statements in certain order, I would try with:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
        CREATE VIEW &amp;amp;TABLES_SAVE_PATH_LIBNAME..Central AS
           SELECT   MAT.*,
                    MAIN.*
            FROM &amp;amp;TABLES_SAVE_PATH_LIBNAME..Other_Table MAT
            LEFT JOIN &amp;amp;TABLES_SAVE_PATH_LIBNAME..Other_Table2 MAIN
                ON MAT.AGREEMENT_NUMBER=MAIN.AGREEMENT_NUMBER

        USING LIBNAME &amp;amp;TABLES_SAVE_PATH_LIBNAME. &amp;amp;TABLES_SAVE_PATH.
        ;


    QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;BTW. macrovariables are resolved during view generation and stored view will have constant values (for libname and path)&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 16:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906738#M358024</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T16:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906740#M358025</link>
      <description>&lt;P&gt;Libname is a reference to path . &lt;BR /&gt;Therefore when wants to use the view the reference to that location or libname will have to be mentioned again.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 16:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906740#M358025</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-12-07T16:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906742#M358026</link>
      <description>&lt;P&gt;Your idea of using a path in the SET statement should work.&lt;/P&gt;
&lt;P&gt;But you don't need to do that in the DATA statement.&amp;nbsp; &amp;nbsp;Just make a libref and use normal two level names when making the file. Once the file exists you can use quoted physical name to reference the file.&amp;nbsp; Remember that views use sas7bvew as the extension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=c:\downloads;
libname dummy "&amp;amp;path" ;
data dummy.class ; set sashelp.class; run;

data dummy.class_v/ view=dummy.class_v;
  set "&amp;amp;path/class" ;
  if sex='M';
run;

proc print data=dummy.class_v;
  title 'dummy.class_v';
run;

proc print data="&amp;amp;path/class_v" ;
  title "'&amp;amp;path/class_v'";
run;

proc print data="&amp;amp;path/class_v.sas7bvew" ;
  title "'&amp;amp;path/class_v.sas7bvew'";
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 17:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906742#M358026</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-07T17:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906743#M358027</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Just gave it a shoot and i'm still gettin gthe same error: Library REP_DB does not exist.&lt;BR /&gt;&lt;BR /&gt;regarding your comment "BTW. macrovariables are resolved during view generation and stored view will have constant values (for libname and path)" wouldnt that mean that just using the LIBNAME would stored its definition? because it is definetly not doing so right now. if I use normal DATA SET with the reference to the LIBNAME the view create properly and will work fine untill i clear my session and dont ahve the LIBNAME defined anymore in my session. So its mena that the definition of the LIBNAME was not Saved in the view and only the name that refer to the path.</description>
      <pubDate>Thu, 07 Dec 2023 16:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906743#M358027</guid>
      <dc:creator>samlac</dc:creator>
      <dc:date>2023-12-07T16:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906745#M358028</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mySesion "/path/where/view/will/be/stored";

PROC SQL;
        CREATE VIEW mySesion.Central AS
           SELECT   MAT.*,
                    MAIN.*
            FROM source.Other_Table MAT
            LEFT JOIN source.Other_Table2 MAIN
                ON MAT.AGREEMENT_NUMBER=MAIN.AGREEMENT_NUMBER

        USING LIBNAME source "/path/where/source/tables/are/stored";
        ;


    QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;try like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 16:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906745#M358028</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T16:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906748#M358029</link>
      <description>&lt;P&gt;If you want to do the SQL view then the libref you use in the USING clause does not have look anything like the actual libref that exists.&amp;nbsp; The important part is that the PATH used there is the one you want them to notice.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create view "&amp;amp;outpath/class_sqlv" as
  select * 
  from x.class
  where sex='M'
  using libname x "&amp;amp;inpath"
;
quit;

proc print data="&amp;amp;outpath/class_sqlv";
  title "'&amp;amp;outpath/class_sqlv'";
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2023 17:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906748#M358029</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-07T17:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906773#M358038</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let path=c:\downloads;
libname dummy "&amp;amp;path" ;
data dummy.class ; set sashelp.class; run;

data dummy.class_v/ view=dummy.class_v;
  set "&amp;amp;path/class" ;
  if sex='M';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this actually works great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use my own tables and my own libname then it only work during the same session. If I close my current SAS session and try to open the view i created previously I get this error: Cannot open data set "central". failure loading ECI00001.Central.VIEW. Error detected during View Load request.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906773#M358038</guid>
      <dc:creator>samlac</dc:creator>
      <dc:date>2023-12-07T18:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906774#M358039</link>
      <description>&lt;P&gt;Which version of sas do you use?&lt;/P&gt;
&lt;P&gt;On my M8 I have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    %let path=R:\;
2    libname dummy "&amp;amp;path" ;
NOTE: Libref DUMMY was successfully assigned as follows:
      Engine:        V9
      Physical Name: R:\
3    data test;
4    set dummy.class_v;
5    run;

NOTE: View DUMMY.CLASS_V.VIEW used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

NOTE: There were 19 observations read from the data set R:\/class.
NOTE: There were 10 observations read from the data set DUMMY.CLASS_V.
NOTE: The data set WORK.TEST has 10 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.00 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906774#M358039</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906775#M358040</link>
      <description>&lt;P&gt;Using libnames it should work as long as view's are supported. M8 is not necessary.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906775#M358040</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-12-07T18:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906777#M358041</link>
      <description>&lt;P&gt;btw. how's SQL version?&lt;/P&gt;
&lt;P&gt;In your session:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname dummy "C:\test" ;
data dummy.class ; 
set sashelp.class; 
run;


libname mySesion "C:\downloads";

PROC SQL;
        CREATE VIEW mySesion.Central AS
           SELECT   *
            FROM x.class
            where sex='M'

        USING LIBNAME x "C:\test";
        ;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in bran new one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname newSas "R:\downloads";
proc print data=newSas.central;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906777#M358041</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906778#M358042</link>
      <description>&lt;P&gt;First of all,&lt;/P&gt;
&lt;PRE&gt;.sas7dbat&lt;/PRE&gt;
&lt;P&gt;is not a valid extension for any SAS file. The valid extension for a SAS dataset file is&lt;/P&gt;
&lt;PRE&gt;.sas7bdat&lt;/PRE&gt;
&lt;P&gt;Next, SAS dataset filenames&amp;nbsp;&lt;U&gt;must&lt;/U&gt; be all lowercase, particularly on the case-sensitive UNIX system you apparently use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, SAS SQL does not have a USING clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Third, you can't do anything with SAS datasets&amp;nbsp;&lt;U&gt;without running SAS code&lt;/U&gt;. What you can do is to make it easier for users to run the code, e.g. by storing it in an easily accessible .sas program file. Or, if you have a BI Server, you can define stored processes which are easily run from a web interface. It depends on the way your users run the SAS system (locally installed, or client/server with either SAS Studio or Enterprise Guide).&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906778#M358042</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-07T18:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906779#M358043</link>
      <description>&lt;P&gt;Please note that your code will draw a WARNING for a variable already included. Never use asterisks in joins like this.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906779#M358043</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-07T18:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906780#M358044</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;Second, SAS SQL does not have a USING clause.&lt;/SPAN&gt;" - it does.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/n0nolnbokay91in1gouzgw3xzl5e.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/n0nolnbokay91in1gouzgw3xzl5e.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906780#M358044</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906781#M358045</link>
      <description>&lt;P&gt;The first time I tried this one. I forgot to put the double quote for the path, so that didnt work. I tried again with double quote and its working good.&lt;/P&gt;&lt;P&gt;for reference:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname mySesion "/path/where/view/will/be/stored";

PROC SQL;
        CREATE VIEW mySesion.Central AS
           SELECT   MAT.*,
                    MAIN.*
            FROM source.Other_Table MAT
            LEFT JOIN source.Other_Table2 MAIN
                ON MAT.AGREEMENT_NUMBER=MAIN.AGREEMENT_NUMBER

        USING LIBNAME source "/path/where/source/tables/are/stored";
        ;


    QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, havent found a way to make it work with DATA SET. They just dont save the LIBNAME in the view.. which is aligned with their documentation. There is only documentation about embedded LIBNAME for PROC SQL. I find it funny that the native SAS DATA SET doesnt support it, but the SQL does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906781#M358045</guid>
      <dc:creator>samlac</dc:creator>
      <dc:date>2023-12-07T18:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906784#M358047</link>
      <description>&lt;P&gt;Agree 100%, for production jobs only explicit lists of variables.&lt;/P&gt;
&lt;P&gt;But here I didn't know variables in datasets.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906784#M358047</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906785#M358048</link>
      <description>&lt;P&gt;I stand corrected. Funny that SAS did not document it as a clause in the list of SQL elements (where I looked).&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906785#M358048</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-07T18:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: USING LIBNAME in a VIEW</title>
      <link>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906786#M358049</link>
      <description>&lt;P&gt;The ON clause reveals that at least the key variable is common in both datasets. That's why one can be sure of the WARNING.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/USING-LIBNAME-in-a-VIEW/m-p/906786#M358049</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-12-07T18:24:21Z</dc:date>
    </item>
  </channel>
</rss>

