<?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: How to assign CASLIB to the new local library(New library isn't CAS library) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-CASLIB-to-the-new-local-library-New-library-isn-t/m-p/745073#M233517</link>
    <description>&lt;P&gt;So I interpret the question as: You've got some data in a CAS lib that you can see in SAS Viya.&lt;/P&gt;
&lt;P&gt;You now want to use SAS Studio ("Develop SAS Code") to access the data in that CAS Library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's quite easy:&lt;/P&gt;
&lt;P&gt;You need to use a libname statement using the CAS engine like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* here, abc is the libref, cas is the CAS engine and you specify the library name (exactly as defined in CAS) in caslib=;&lt;/P&gt;
&lt;P&gt;Libname abc cas caslib='XYZ';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*the following will list the tables that are in the CAS library&lt;/P&gt;
&lt;P&gt;proc datasets lib=abc;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;*assuming you have a table called sales in the caslib, then you can use it in code like this:&lt;/P&gt;
&lt;P&gt;data MaySales;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;set abc.sales;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;where Month='May';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've made some assumptions with the above code, particularly the libname statement. I assume that you are using SAS StudioV that is in the same environment as SAS Viya. That way you don't have to specify CAS connection information.&lt;/P&gt;
&lt;P&gt;If you are using SASStudio or other SAS Coding tools like Enterprise Guide that are separate from the SAS Viya environment then you will have to specify the cashost, port and maybe authentication.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 03:50:07 GMT</pubDate>
    <dc:creator>MarkBodt_NZ</dc:creator>
    <dc:date>2021-06-02T03:50:07Z</dc:date>
    <item>
      <title>How to assign CASLIB to the new local library(New library isn't CAS library)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-CASLIB-to-the-new-local-library-New-library-isn-t/m-p/744924#M233441</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created CAS library ie. "XYZ" in SAS Viya 3.4 version through Prepare Data component. I want to assign this library to the new local library using Develop SAS Code component. Can anyone suggest the way how it can be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;G2&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 13:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-CASLIB-to-the-new-local-library-New-library-isn-t/m-p/744924#M233441</guid>
      <dc:creator>jitendra_patil</dc:creator>
      <dc:date>2021-06-01T13:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign CASLIB to the new local library(New library isn't CAS library)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-CASLIB-to-the-new-local-library-New-library-isn-t/m-p/745073#M233517</link>
      <description>&lt;P&gt;So I interpret the question as: You've got some data in a CAS lib that you can see in SAS Viya.&lt;/P&gt;
&lt;P&gt;You now want to use SAS Studio ("Develop SAS Code") to access the data in that CAS Library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's quite easy:&lt;/P&gt;
&lt;P&gt;You need to use a libname statement using the CAS engine like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* here, abc is the libref, cas is the CAS engine and you specify the library name (exactly as defined in CAS) in caslib=;&lt;/P&gt;
&lt;P&gt;Libname abc cas caslib='XYZ';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*the following will list the tables that are in the CAS library&lt;/P&gt;
&lt;P&gt;proc datasets lib=abc;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;*assuming you have a table called sales in the caslib, then you can use it in code like this:&lt;/P&gt;
&lt;P&gt;data MaySales;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;set abc.sales;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;where Month='May';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've made some assumptions with the above code, particularly the libname statement. I assume that you are using SAS StudioV that is in the same environment as SAS Viya. That way you don't have to specify CAS connection information.&lt;/P&gt;
&lt;P&gt;If you are using SASStudio or other SAS Coding tools like Enterprise Guide that are separate from the SAS Viya environment then you will have to specify the cashost, port and maybe authentication.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 03:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-CASLIB-to-the-new-local-library-New-library-isn-t/m-p/745073#M233517</guid>
      <dc:creator>MarkBodt_NZ</dc:creator>
      <dc:date>2021-06-02T03:50:07Z</dc:date>
    </item>
  </channel>
</rss>

