<?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: issue in assigning CASLIB in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859248#M339498</link>
    <description>&lt;P&gt;In CAS, the name of the CASUSER caslib&amp;nbsp; often has the userID of the caslib owner included in parentheses. In your example, the userID appears to be&amp;nbsp;&lt;SPAN&gt;CMSTEST, so the name appears like this: CASUSER(CMSTEST). Of course, that would&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; be valid as a SAS libref. So, if the value of SOURCE is&amp;nbsp; CASUSER(CMSTEST), when you submit this code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x = &amp;amp;source
libname &amp;amp;x cas caslib="x";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;after the macro variable resolved, the code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname &lt;STRONG&gt;CASUSER(CMSTEST)&lt;/STRONG&gt; cas caslib="&lt;STRONG&gt;x&lt;/STRONG&gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's not valid syntax, so the code fails to run. What you really need is for the resolved code to look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname &lt;STRONG&gt;CASUSER&lt;/STRONG&gt; cas caslib="&lt;STRONG&gt;CASUSER(CMSTEST)&lt;/STRONG&gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can accomplish that by scanning out the first part of the &amp;amp;x value as the libref, and using &amp;amp;x in the caslib= option like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname %qscan(&amp;amp;x,1,%str(%(%))) cas caslib="&amp;amp;x";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this helps.&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>Thu, 16 Feb 2023 18:30:04 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2023-02-16T18:30:04Z</dc:date>
    <item>
      <title>issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859231#M339489</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help in below syntax.&lt;/P&gt;
&lt;P&gt;I&amp;nbsp; am using below code to assign a CASLIB&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let x = &amp;amp;source&lt;/P&gt;
&lt;P&gt;libname &amp;amp;x cas caslib="x";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting error in libname statement. I have attached log details below:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;normal: SYMBOLGEN: Macro variable source resolves to CASUSER(CMSTEST)&lt;BR /&gt;normal: SYMBOLGEN: Macro variable x&amp;nbsp; resolves to CASUSER(CMSTEST)&lt;/P&gt;
&lt;P&gt;error: ERROR: Libref CMSTEST is not assigned.&lt;BR /&gt;error: ERROR: Error in the LIBNAME statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know what went wrong here. How can I resolve this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 16:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859231#M339489</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2023-02-16T16:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859248#M339498</link>
      <description>&lt;P&gt;In CAS, the name of the CASUSER caslib&amp;nbsp; often has the userID of the caslib owner included in parentheses. In your example, the userID appears to be&amp;nbsp;&lt;SPAN&gt;CMSTEST, so the name appears like this: CASUSER(CMSTEST). Of course, that would&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; be valid as a SAS libref. So, if the value of SOURCE is&amp;nbsp; CASUSER(CMSTEST), when you submit this code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x = &amp;amp;source
libname &amp;amp;x cas caslib="x";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;after the macro variable resolved, the code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname &lt;STRONG&gt;CASUSER(CMSTEST)&lt;/STRONG&gt; cas caslib="&lt;STRONG&gt;x&lt;/STRONG&gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's not valid syntax, so the code fails to run. What you really need is for the resolved code to look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname &lt;STRONG&gt;CASUSER&lt;/STRONG&gt; cas caslib="&lt;STRONG&gt;CASUSER(CMSTEST)&lt;/STRONG&gt;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can accomplish that by scanning out the first part of the &amp;amp;x value as the libref, and using &amp;amp;x in the caslib= option like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname %qscan(&amp;amp;x,1,%str(%(%))) cas caslib="&amp;amp;x";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope this helps.&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>Thu, 16 Feb 2023 18:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859248#M339498</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2023-02-16T18:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859263#M339499</link>
      <description>Thank you for your response.&lt;BR /&gt;&lt;BR /&gt;Just wanted to add here that The X macro variable can have other values Like Public and other CAS libs&lt;BR /&gt;&lt;BR /&gt;This macro is not working when I pass the X value as Public</description>
      <pubDate>Thu, 16 Feb 2023 20:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859263#M339499</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2023-02-16T20:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859374#M339541</link>
      <description>&lt;P&gt;When you say that something isn't working you need to provide more than just a verbal description to get additional help. Please proved a sample of the simplest code you can that demonstrates the problem, along with all of the log messages generated. For example, I ran this code in SAS Viya:&lt;/P&gt;
&lt;PRE&gt;%let source=Public; &lt;BR /&gt;%let x=&amp;amp;source;&lt;BR /&gt;libname %qscan(&amp;amp;x,1,%str(%(%))) cas caslib="&amp;amp;x";&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and it produced these results in the log:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;80 %let source=Public;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;81 %let x=&amp;amp;source;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;82 libname %qscan(&amp;amp;x,1,%str(%(%))) cas caslib="&amp;amp;x";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NOTE: Libref PUBLIC was successfully assigned as follows: &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Engine: CAS &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Physical Name: f64402f2-bb59-d94c-84ac-f4ac417d4986&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;BR /&gt;As you can see, this code is working as expected with a &lt;STRONG&gt;source&lt;/STRONG&gt;&amp;nbsp;value of&amp;nbsp; 'Public'. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;So before we can troubleshoot further, you'll need to share your actual code and log. It would be helpful to print the values of&amp;nbsp;&lt;STRONG&gt;source&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;x&lt;/STRONG&gt; to the log just before the LIBNAME statement is generated.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 13:38:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/859374#M339541</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2023-02-17T13:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/860156#M339825</link>
      <description>Thanks. Yes my bad .let me add  some more .&lt;BR /&gt;&lt;BR /&gt;I have source name as InventoryFulfillment&lt;BR /&gt;&lt;BR /&gt;though it is throwing error for libname but other operation worked fine. I am not getting what is actual issue. &lt;BR /&gt;&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable MP_SOURCENAME resolves to InventoryFulfillment&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable VF_LIB resolves to InventoryFulfillment&lt;BR /&gt;normal: SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;BR /&gt;error: ERROR: InventoryFulfillment is not a valid SAS name.&lt;BR /&gt;error: ERROR: Error in the LIBNAME statement.&lt;BR /&gt;&lt;BR /&gt;normal: MPRINT(X):   proc casutil;&lt;BR /&gt;note: NOTE: The UUID '227b59b2-fcf9-e64a-aa96-e6abec55e82e' is connected using session CASAUTO.&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable PLAN_LIB resolves to planning&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable INPUTTABLE resolves to OUTFOR_102&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable INPUTTABLE resolves to OUTFOR_102&lt;BR /&gt;normal: SYMBOLGEN:  Macro variable VF_LIB resolves to InventoryFulfillment&lt;BR /&gt;normal: SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;BR /&gt;normal: MPRINT(X):   load data =planning.ed_OUTFOR_102 CASOUT="ed_OUTFOR_102" OUTCASLIB="InventoryFulfillment" replace;&lt;BR /&gt;note: NOTE: PLANNING.ED_OUTFOR_102 was successfully added to the "InventoryFulfillment" caslib as "ED_OUTFOR_102".&lt;BR /&gt;&lt;BR /&gt;normal: MPRINT(X):   create table InventoryFulfillment.tmp_OUTFOR_102 as select a.* ,b.time_id as start_dt_sk from &lt;BR /&gt;normal: InventoryFulfillment.OUTFOR_102 a, InventoryFulfillment.ed_OUTFOR_102 b where a.start_date between b.start_date and b.end_date;&lt;BR /&gt;note: NOTE: CASDAL driver. Creation of a DATE column has been requested, but is not supported by the CASDAL driver. A DOUBLE PRECISION &lt;BR /&gt;note:       column will be created instead. A DATE format will be associated with the column.&lt;BR /&gt;note: NOTE: Table TMP_OUTFOR_102 was created in caslib InventoryFulfillment with 779282 rows returned.&lt;BR /&gt;normal: MPRINT(X):   quit;</description>
      <pubDate>Wed, 22 Feb 2023 13:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/860156#M339825</guid>
      <dc:creator>Aexor</dc:creator>
      <dc:date>2023-02-22T13:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: issue in assigning CASLIB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/863179#M340988</link>
      <description>&lt;P&gt;The reason this doesn't work is given in the log:&lt;/P&gt;
&lt;PRE&gt;error: ERROR: InventoryFulfillment is not a valid SAS name.&lt;/PRE&gt;
&lt;P&gt;A &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/casref/n0kizq68ojk7vzn1fh3c9eg3jl33.htm#p0z2j1bjz4zof0n1rsb7qy6z3pjs" target="_self"&gt;caslib name can be up to 256 characters long&lt;/A&gt;, but a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/default/engsas7bdat/n1e6qvz7mrer88n1pqs1ypx6d4it.htm#n1qfpiund4s3lin12r8ca31drbt9" target="_self"&gt;SAS libref has a maximum length of 8 characters&lt;/A&gt;. So&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;InventoryFulfillment&lt;/STRONG&gt; is valid as a caslib name but is not valid as a libref.&amp;nbsp; You still have not shared your code so more specific help is not possible, but when you assign the libref to the caslib, you will need to supply a libref value that meets the 8-character maximum criteria.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 13:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/issue-in-assigning-CASLIB/m-p/863179#M340988</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2023-03-09T13:40:27Z</dc:date>
    </item>
  </channel>
</rss>

