<?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 libraries from metadata using SAS code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912724#M359780</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356206"&gt;@paul_e&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would highly encourage you to read the following papers and article, if you have not already&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Framework for Using the&amp;nbsp;SAS® Metadata Server from&amp;nbsp;SAS® Foundation" href="https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/394-2008.pdf" target="_blank" rel="noopener"&gt;A Framework for Using the&amp;nbsp;SAS® Metadata Server from&amp;nbsp;SAS® Foundation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Programming Approach to Implementing SAS® Metadata-Bound&amp;nbsp;Libraries for SAS® Data Set Encryption" href="https://support.sas.com/resources/papers/proceedings18/2181-2018.pdf" target="_blank" rel="noopener"&gt;A Programming Approach to Implementing SAS® Metadata-Bound&amp;nbsp;Libraries for SAS® Data Set Encryption&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Metadata to Physical Table Comparison Tool" href="https://support.sas.com/resources/papers/proceedings15/3314-2015.pdf" target="_blank" rel="noopener"&gt;A Metadata to Physical Table Comparison Tool&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="Using Dynamic Views as a Supplement to SAS Security to Enhance Multiple Levels of Access Requirements to Row-Level Data Upon SAS® Server Startup" href="https://support.sas.com/resources/papers/proceedings12/374-2012.pdf" target="_blank" rel="noopener"&gt;Using Dynamic Views as a Supplement to SAS Security to Enhance Multiple Levels of Access Requirements to Row-Level Data Upon SAS® Server Startup&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="SAS administrator tip: How to identify and prevent duplicate librefs in SAS metadata" href="https://blogs.sas.com/content/sgf/2022/11/08/sas-administrator-tip-how-to-identify-and-prevent-duplicate-librefs-in-sas-metadata/" target="_blank" rel="noopener"&gt;SAS administrator tip: How to identify and prevent duplicate librefs in SAS metadata&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These may not provide you straight answer to you issue, but I hope they will provide you with wider perspective on what's involved with libraries defined in the Metadata Server.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 15:46:43 GMT</pubDate>
    <dc:creator>AhmedAl_Attar</dc:creator>
    <dc:date>2024-01-23T15:46:43Z</dc:date>
    <item>
      <title>Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912646#M359760</link>
      <description>&lt;P&gt;Hello, I'd like to automatically assign libraries from metadata with a code snippet. Retrieving the info including libname and physical location is the easy part, so I had though I could just write a libname statment and paste the correct info from metadata with macro variables. However, when I try this I get the following errors:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: Encountered error when the V9 engine tried to determine if MYLIB has a registered secured library object location.
ERROR: User does not have appropriate authorization level for library MYLIB.
ERROR: Error in the LIBNAME statement.
ERROR: Libref MYLIB is not assigned.
&lt;/PRE&gt;
&lt;P&gt;So it seems I'm not allowed to assign libraries that already sit as unassigned in the metadata. Assigning them manually in EG from the server menu works fine, so this is not an actual authorization problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to get around this? Maybe there's a piece of metadata code to assign a library from metadata?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 11:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912646#M359760</guid>
      <dc:creator>paul_e</dc:creator>
      <dc:date>2024-01-23T11:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912658#M359766</link>
      <description>&lt;P&gt;It would be useful to share the code that generated this error...&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 12:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912658#M359766</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-01-23T12:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912675#M359772</link>
      <description>Is there a reqason why you don't assign it from the server context/metadata server?&lt;BR /&gt;What happens if you try the meta libname engine?</description>
      <pubDate>Tue, 23 Jan 2024 13:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912675#M359772</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-01-23T13:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912724#M359780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356206"&gt;@paul_e&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would highly encourage you to read the following papers and article, if you have not already&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Framework for Using the&amp;nbsp;SAS® Metadata Server from&amp;nbsp;SAS® Foundation" href="https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/394-2008.pdf" target="_blank" rel="noopener"&gt;A Framework for Using the&amp;nbsp;SAS® Metadata Server from&amp;nbsp;SAS® Foundation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Programming Approach to Implementing SAS® Metadata-Bound&amp;nbsp;Libraries for SAS® Data Set Encryption" href="https://support.sas.com/resources/papers/proceedings18/2181-2018.pdf" target="_blank" rel="noopener"&gt;A Programming Approach to Implementing SAS® Metadata-Bound&amp;nbsp;Libraries for SAS® Data Set Encryption&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="A Metadata to Physical Table Comparison Tool" href="https://support.sas.com/resources/papers/proceedings15/3314-2015.pdf" target="_blank" rel="noopener"&gt;A Metadata to Physical Table Comparison Tool&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="Using Dynamic Views as a Supplement to SAS Security to Enhance Multiple Levels of Access Requirements to Row-Level Data Upon SAS® Server Startup" href="https://support.sas.com/resources/papers/proceedings12/374-2012.pdf" target="_blank" rel="noopener"&gt;Using Dynamic Views as a Supplement to SAS Security to Enhance Multiple Levels of Access Requirements to Row-Level Data Upon SAS® Server Startup&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;A title="SAS administrator tip: How to identify and prevent duplicate librefs in SAS metadata" href="https://blogs.sas.com/content/sgf/2022/11/08/sas-administrator-tip-how-to-identify-and-prevent-duplicate-librefs-in-sas-metadata/" target="_blank" rel="noopener"&gt;SAS administrator tip: How to identify and prevent duplicate librefs in SAS metadata&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These may not provide you straight answer to you issue, but I hope they will provide you with wider perspective on what's involved with libraries defined in the Metadata Server.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 15:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912724#M359780</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-01-23T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912807#M359790</link>
      <description>&lt;P&gt;The libname meta engine allows you to assign a library that uses a libname definition from SAS Metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here a sample as used in an actual implementation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname pg_temp meta liburi="SASLibrary?@libref='pg_temp'" metaout=data;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;SASLibrary?@libref='pg_temp'"&lt;/CODE&gt;&amp;nbsp;searches through metadata library object and will use the one where the libref property has the value pg_temp.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In below sample the libref that gets assigned&amp;nbsp;&lt;CODE class=" language-sas"&gt;libname &lt;STRONG&gt;pg_temp&lt;/STRONG&gt;&lt;/CODE&gt;&amp;nbsp;will have the same libref like the one defined in SAS metadata&amp;nbsp;&lt;CODE class=" language-sas"&gt;@libref='pg_temp'"&lt;/CODE&gt;&amp;nbsp;that gets used to define the library. This gives you a result pretty much the same as if the library would have been defined as pre-assigned in SAS metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now.... metadata bound libraries are something special and I'm not sure if above syntax will also work for them. But it's your best shot so just try it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 10:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/912807#M359790</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-24T10:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Assign libraries from metadata using SAS code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/959195#M374276</link>
      <description>Thank you! this is a life saver! I was missing the metaout statement</description>
      <pubDate>Thu, 13 Feb 2025 16:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-libraries-from-metadata-using-SAS-code/m-p/959195#M374276</guid>
      <dc:creator>spunj</dc:creator>
      <dc:date>2025-02-13T16:53:10Z</dc:date>
    </item>
  </channel>
</rss>

