<?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: LIBNAME META engine replacement in VIYA in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944328#M2588</link>
    <description>&lt;P&gt;Maybe this post is helpful:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Managing-Connections-to-Data-Sources-and-SAS-Libraries-for/ta-p/825138/jump-to/first-unread-message" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Managing-Connections-to-Data-Sources-and-SAS-Libraries-for/ta-p/825138/jump-to/first-unread-message&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are correct in that there is no metadata server in SAS Viya 4, hence no meta engine.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 23:30:35 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2024-09-17T23:30:35Z</dc:date>
    <item>
      <title>LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944285#M2587</link>
      <description>&lt;P&gt;Hey experts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My customer migrate large SAS 9.4 BI to VIYA. They have hundreds of scheduled jobs and actually also hundreds of libraries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In 9.4 they used META engine in code in libname to avoid preassign of hundred libraries in Batch context. I have dig in SAS documents and have got understanding, that there are no META engine any more in VIYA.&lt;/P&gt;&lt;P&gt;But have anyone found good workaround to keep the amount of assign libraries reasonable during launch of scheduled job.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see following options:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- group jobs by subject (or by users groups) , so that Batch context assign only subset of libraries. So useing multiple contexts (if it possible - I do not have VIYA to test).&amp;nbsp;&lt;/P&gt;&lt;P&gt;- hard code libname statements to code&amp;nbsp; (ugly, unsecure..)&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I have got impression, that You can assign libraries in autoexec of context, but how to assign it in batch server code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I miss some key hint ? I haven't learned systematically VIYA .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;/oleg&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 15:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944285#M2587</guid>
      <dc:creator>olegbogdanov</dc:creator>
      <dc:date>2024-09-17T15:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944328#M2588</link>
      <description>&lt;P&gt;Maybe this post is helpful:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Managing-Connections-to-Data-Sources-and-SAS-Libraries-for/ta-p/825138/jump-to/first-unread-message" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Managing-Connections-to-Data-Sources-and-SAS-Libraries-for/ta-p/825138/jump-to/first-unread-message&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are correct in that there is no metadata server in SAS Viya 4, hence no meta engine.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 23:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944328#M2588</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-09-17T23:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944363#M2592</link>
      <description>Thanks. I have seen this post. This is not exact solution, but looks like it is really only way. So I needed confirmation, that there are no other ways to solve this crossword.&lt;BR /&gt;/oleg&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944363#M2592</guid>
      <dc:creator>olegbogdanov</dc:creator>
      <dc:date>2024-09-18T09:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944396#M2595</link>
      <description>&lt;P&gt;The referenced article shows how to define a library in Viya so it becomes accessible to any selected user (also a batch user) but is not pre-assigned. Isn't that similar to a library metadata definition without pre-assignment in SAS9.4?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The article then also shows how to assign such a library in code using the&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_028/engsas7bdat/p0z3f4v5yeykc2n10db3c738bhq0.htm" target="_self"&gt;LIBRARYDEFINITION= LIBNAME Statement Option&lt;/A&gt; which looks very similar to using the libname meta engine in SAS 9.4 code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where I see a challenge which needs some further thinking is how to migrate such code from one environment to the next because the&amp;nbsp;source-definition-URI is likely environment specific. TBC: I do expect the uri to change but would need testing/confirmation.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 13:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944396#M2595</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-09-18T13:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944561#M2596</link>
      <description>&lt;P&gt;Thanks Patric!&lt;/P&gt;&lt;P&gt;Yes. that looks very much like META engine in 9.4. And I hope, that if datasource are created, this ugly&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; hexadecimal link is permanent.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not have VIYA to test currently, but from practical viewpoint.&lt;/P&gt;&lt;P&gt;Lets suppose, that I am in process of writing code&amp;nbsp; in Studio. Now I need to add this LIBRARYDEFINITION to code. Where I can see this URI.&amp;nbsp;According to my experience with VIYA ( Intelligent Decision), typically these K8S ID-s were visible in object (datasource)&amp;nbsp; properties.&amp;nbsp; So, can developer copy this URI from datasource properties. Or have he change to Environment manager.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace in bulk is different story, but I guess, that as this is just one-time&amp;nbsp; task, it can be solved in some way with python code over all code files. (if URI-s are permanent and I have these already).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or via REST call ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again - I see light at the end of tunnel .....&lt;/P&gt;&lt;P&gt;/oleg&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 07:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944561#M2596</guid>
      <dc:creator>olegbogdanov</dc:creator>
      <dc:date>2024-09-19T07:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944569#M2598</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/469631"&gt;@olegbogdanov&lt;/a&gt;&amp;nbsp;I'm myself still on the steep Viya learning path so many things are still on the level of "I believe, I'd expect" without being certain.&lt;/P&gt;
&lt;P&gt;I would expect that the hex part of a liburi is fixed for a library definition but will differ between environments for the same libref/path - similar to a metadata id&amp;nbsp; under SAS9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far I couldn't find anything in the docu that would allow to assign such a library definition based on defined libref or path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Where-to-define-your-SAS-libraries-in-SAS-Viya-Part-2/ta-p/928494" target="_self"&gt;This article&lt;/A&gt; shows how to use the Viya Rest api to retrieve all library definitions from an environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Right now my thinking is that I probably would replace the libname meta definition in the SAS9.4 code with a macro call for the library assignment (likely with the libref as input parameter). This would allow for code that certainly won't need change when promoting to higher environments.&lt;/P&gt;
&lt;P&gt;The Rest call from the article should return all the information needed to then actually assign the library - I'd be doing this within the macro as well as the actual library assignment.&amp;nbsp; &amp;nbsp;....and should the REST call require permissions not available to any user that needs to do such an assignment then there could also be some regular job for the REST call populating some SAS table with the info to which all users get read access - and that's then what you're using in the macro (which again is an advantage to implement via a centralized macro as then you can change or enhance the approach in a single place if and as needed).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For any article with links to the docu: Make sure that you always switch to the latest (or your version) of Viya because things are evolving and enhancing quickly with every single version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last but not least: You need Viya training. It's a big change from SAS9.4&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 09:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944569#M2598</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-09-19T09:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944571#M2599</link>
      <description>&lt;P&gt;Thanks for thorough answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;central macro was also one option I have considered. Based on table, which is regularily updated by some SAS code with REST call.&amp;nbsp;&lt;/P&gt;&lt;P&gt;All these tricks need testing as details are not exposed typically in documentation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that I have now all info to present to my colleagues as advice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again and have a nice afternoon.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;/oleg&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 09:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/944571#M2599</guid>
      <dc:creator>olegbogdanov</dc:creator>
      <dc:date>2024-09-19T09:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME META engine replacement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/953195#M2683</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/469631"&gt;@olegbogdanov&lt;/a&gt;&amp;nbsp;for raising the question and thank you all for your input.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;If it helps someone please find my first dynamic solution to assign libraries in batch code in the manner to avoid hardcoded LIBNAME statements&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%let lib_ref = SASHELP;  /* As for example */

%let SERVICESBASEURL=%sysfunc(getoption(servicesbaseurl));

/* Assign a temporary file to store the response */
filename resp temp;

proc http
  url="&amp;amp;SERVICESBASEURL./dataSources/providers/Compute/sourceDefinitions?filter=eq(defaultLibref,%27&amp;amp;lib_ref.%27)"
  method="GET"
  oauth_bearer=sas_services
  out=resp;
  headers
    "Accept"="application/json";
run;

libname respjson json fileref=resp;
    
/* Check if the dataset exists */
%if %sysfunc(exist(respjson.items_links)) %then %do;
  /* assign library definition value to macro variable*/
  data _null_;
    set respjson.items_links;
    where ordinal_items = 1 and rel = 'self'; /* choose the first match */
    call symputx('lib_def', uri);
  run;
%end;
%else %do;
  %put --------------------;
  %put WARNING: Library &amp;amp;lib_ref. was not found.;
  %put --------------------;
  %return;
%end;

libname respjson clear;

/*  Actual LIBNAME statement */
libname &amp;amp;lib_ref. libdef="&amp;amp;lib_def.";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Dec 2024 10:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/LIBNAME-META-engine-replacement-in-VIYA/m-p/953195#M2683</guid>
      <dc:creator>GuidoG</dc:creator>
      <dc:date>2024-12-11T10:14:36Z</dc:date>
    </item>
  </channel>
</rss>

