<?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 CAS SESSOPTS Statement - CASLIB option in Developers</title>
    <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/496026#M43</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to come up to speed with SAS Viya and have been looking at some of the great SAS videos that are available at: &lt;A href="https://video.sas.com/category/videos/an-introduction-to-sas-viya-programming-for-sas-9-programmers" target="_blank"&gt;https://video.sas.com/category/videos/an-introduction-to-sas-viya-programming-for-sas-9-programmers&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not yet working on a SAS Viya site, but want to get the concepts clear in my head and I've boxed myself into a corner on a little point that I would like some clarification on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In one video (Using the DATA Step in SAS® Viya™) the demonstration shows the following code:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=casuser);
libname mycase cas;

proc casutil;
load data=sashelp.cars replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in another video (Understanding Caslibs and Loading Data in SAS® Viya™)&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt; doing more or less the same thing, the demonstration shows the following, slightly different code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=casuser);
libname mycase cas &lt;STRONG&gt;caslib=casuser;&lt;/STRONG&gt;

proc casutil;
load data=sashelp.cars replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The difference is that in the second video the assignment of the CASLIB occurs in &lt;U&gt;both&lt;/U&gt; the SESSOPTS statement as well as the LIBNAME statement. In the first video however, the assignment only occurs in the SESSOPTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have assumed from the first video that using the SESSOPTS statement to assign the CASLIB means that the immediately following LIBNAME statement does not have to explicitly reference the CASLIB=CASUSER relationship because that has been set as the default for the whole cas session. Is this correct ? If so, is the LIBNAME statement in the second video just re-iterating the relationship ? No mention was made in either video about the CASLIB reference being optional in the LIBNAME statement if it had been referenced as part of SESSOPTS and similarly, no mention was made of it being mandatory to use the SESSOPTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This isn't a moan, it's just I have been a bit confused. If anyone can give a concise answer to my less-than concise question, I would really appreciate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Downunder Dave&lt;BR /&gt;Wellington&lt;/P&gt;</description>
    <pubDate>Sun, 16 Sep 2018 11:01:25 GMT</pubDate>
    <dc:creator>DaveShea</dc:creator>
    <dc:date>2018-09-16T11:01:25Z</dc:date>
    <item>
      <title>CAS SESSOPTS Statement - CASLIB option</title>
      <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/496026#M43</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to come up to speed with SAS Viya and have been looking at some of the great SAS videos that are available at: &lt;A href="https://video.sas.com/category/videos/an-introduction-to-sas-viya-programming-for-sas-9-programmers" target="_blank"&gt;https://video.sas.com/category/videos/an-introduction-to-sas-viya-programming-for-sas-9-programmers&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not yet working on a SAS Viya site, but want to get the concepts clear in my head and I've boxed myself into a corner on a little point that I would like some clarification on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In one video (Using the DATA Step in SAS® Viya™) the demonstration shows the following code:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=casuser);
libname mycase cas;

proc casutil;
load data=sashelp.cars replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in another video (Understanding Caslibs and Loading Data in SAS® Viya™)&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt; doing more or less the same thing, the demonstration shows the following, slightly different code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=casuser);
libname mycase cas &lt;STRONG&gt;caslib=casuser;&lt;/STRONG&gt;

proc casutil;
load data=sashelp.cars replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The difference is that in the second video the assignment of the CASLIB occurs in &lt;U&gt;both&lt;/U&gt; the SESSOPTS statement as well as the LIBNAME statement. In the first video however, the assignment only occurs in the SESSOPTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have assumed from the first video that using the SESSOPTS statement to assign the CASLIB means that the immediately following LIBNAME statement does not have to explicitly reference the CASLIB=CASUSER relationship because that has been set as the default for the whole cas session. Is this correct ? If so, is the LIBNAME statement in the second video just re-iterating the relationship ? No mention was made in either video about the CASLIB reference being optional in the LIBNAME statement if it had been referenced as part of SESSOPTS and similarly, no mention was made of it being mandatory to use the SESSOPTS statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This isn't a moan, it's just I have been a bit confused. If anyone can give a concise answer to my less-than concise question, I would really appreciate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Downunder Dave&lt;BR /&gt;Wellington&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 11:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/496026#M43</guid>
      <dc:creator>DaveShea</dc:creator>
      <dc:date>2018-09-16T11:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: CAS SESSOPTS Statement - CASLIB option</title>
      <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/498066#M44</link>
      <description>&lt;P&gt;Hi, as far as I know (I'm a sas 9.4 expert but I'm new in Viya) what happens should be this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- when you initialize a cas session you can specify a caslib (sasuser in this case), which becomes the "active" caslib&lt;/P&gt;
&lt;P&gt;- there exists only an "active" caslib at a time&lt;/P&gt;
&lt;P&gt;- if you specify a statement which require a caslib in some option, you may omit it and the "active" caslib will be used&lt;/P&gt;
&lt;P&gt;- otherwise, you may specify a different caslib (not the "active")&lt;/P&gt;
&lt;P&gt;- the cas engine in libname requires a caslib to attach to; in the first case, it will use the "active" caslib (which is sasuser) by default; in the second case you explicitly specify that the libname mycase is attached to casuser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since casuser is indeed the "active" caslib, the two codes are equivalent (and in the second one "caslib=casuser" in the libname statement is useless).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT, this is what I have understand so far, I'm not sure I got it right!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 22 Sep 2018 12:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/498066#M44</guid>
      <dc:creator>Edoedoedo</dc:creator>
      <dc:date>2018-09-22T12:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: CAS SESSOPTS Statement - CASLIB option</title>
      <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/498688#M45</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="lia-panel-heading-bar-title"&gt;EduxEdux&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply. I think that you are correct in that, in the second code snippet, &lt;U&gt;either&lt;/U&gt; of the two references to CASLIB=CASUSER are superfluous:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=casuser);
libname mycase cas caslib=casuser;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whilst it probably does no harm, I did find it a bit confusing as to why the CASLIB was being defined twice. My personal preference would be to explicitly reference the CASLIB=CASUSER on the LIBNAME statement, nice and bold and obvious to the reader.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My view of the LIBNAME statement has always been that it is the place where the user declares the connection between the Libref and the data source, irrespective of whether that data source is a SAS data library, an Excel workbook, an ORACLE database or a SAS Viya CASLIB. Consequently I think that it would be logical to keep using the same methodology in SAS Viya too,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ho hum, new things to learn. I think I need to find lots more examples of using SAS code to SAS Viya to help drum this new stuff in &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Downunder Dave&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 10:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/498688#M45</guid>
      <dc:creator>DaveShea</dc:creator>
      <dc:date>2018-09-25T10:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: CAS SESSOPTS Statement - CASLIB option</title>
      <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/501772#M46</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think its better to explicitly specify CASLIB option in LIBNAME statement to be sure which caslib our libref is referring to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below link which specifies that "&lt;SPAN&gt;Binding the CAS engine libref with the active caslib prevents the CAS engine libref from switching to a subsequently added caslib."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmcdc&amp;amp;cdcVersion=8.11&amp;amp;docsetId=pgmdiff&amp;amp;docsetTarget=n1hjajagui3sg3n1ttquns3t1i8y.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmcdc&amp;amp;cdcVersion=8.11&amp;amp;docsetId=pgmdiff&amp;amp;docsetTarget=n1hjajagui3sg3n1ttquns3t1i8y.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 08:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/501772#M46</guid>
      <dc:creator>AmitGoel</dc:creator>
      <dc:date>2018-10-05T08:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: CAS SESSOPTS Statement - CASLIB option</title>
      <link>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/503943#M47</link>
      <description>&lt;P&gt;Hi Amit,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reply and the reference to the documentation. I have flagged EduxEdux's reply as the solution although I would like to do the same for yours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with your assertion that it is better to explicitly specify the CASLIB=xxxx option in LIBNAME statement so that it is obvious to the user which caslib our libref is referring to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess that we all have a long and interesting path to tread with SAS Viya, I'm looking forward to the journey &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Downunder Dave&lt;/P&gt;
&lt;P&gt;Wellington&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 22:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/CAS-SESSOPTS-Statement-CASLIB-option/m-p/503943#M47</guid>
      <dc:creator>DaveShea</dc:creator>
      <dc:date>2018-10-12T22:59:52Z</dc:date>
    </item>
  </channel>
</rss>

