<?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: Data Step View independent of Libref in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339589#M77498</link>
    <description>&lt;P&gt;A data step view is compiled before being stored as a .sas7bvew file, so it can't be dynamic after that, with the exception of changing the physical path for a libname. So what you want to do is not possible.&lt;/P&gt;
&lt;P&gt;SQL views, OTOH, are stored as program code and executed with proc sql at runtime.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 11:13:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-09T11:13:34Z</dc:date>
    <item>
      <title>Data Step View independent of Libref</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339581#M77493</link>
      <description>&lt;P&gt;I need to create a Data Step View for an existing dataset. This view should not be require that one assign the physical path of the existing dataset to a specific Libref.&lt;/P&gt;&lt;P&gt;I need Data Step equivalent of following PROC SQL View:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Libname ViewOut "&amp;lt;physical path of view output library&amp;gt;" disp=shr;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC SQL&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CREATE VIEW ViewOut.DataSetName as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT * FROM&amp;nbsp;XYZ123.DataSetName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;EM&gt;USING LIBNAME &amp;nbsp;XYZ123 "&amp;lt;physical path of existing output dataset&amp;gt;"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DISP=SHR WAIT=999;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUIT;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above PROC SQL View, the physical path of the dataset is included within the view, so, if the one has access to the view, he/she does not need to know where the actual dataset is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in anticipation!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 10:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339581#M77493</guid>
      <dc:creator>ShagilImam</dc:creator>
      <dc:date>2017-03-09T10:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step View independent of Libref</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339586#M77497</link>
      <description>&lt;P&gt;I don't believe that is possible as such in SAS, they only implement ANSI SQL. &amp;nbsp;What is it your trying to do, from that code you just create a view of a dataset, which is database thinking. &amp;nbsp;SAS references data with libnames, so effectively the same code would be:&lt;/P&gt;
&lt;P&gt;libname dataloc "&amp;lt;physical_path&amp;gt;";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I.e. point the library reference to where the data is. &amp;nbsp;That is all you need. &amp;nbsp;If you need further complicated views then you need the libref and the code.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 10:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339586#M77497</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-09T10:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step View independent of Libref</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339589#M77498</link>
      <description>&lt;P&gt;A data step view is compiled before being stored as a .sas7bvew file, so it can't be dynamic after that, with the exception of changing the physical path for a libname. So what you want to do is not possible.&lt;/P&gt;
&lt;P&gt;SQL views, OTOH, are stored as program code and executed with proc sql at runtime.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 11:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-View-independent-of-Libref/m-p/339589#M77498</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-09T11:13:34Z</dc:date>
    </item>
  </channel>
</rss>

