<?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 use CSIDL variables to change the location of SASUSER in Windows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188924#M35699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a global option to change default SASUSER library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname x v9 'c:\temp';&lt;/P&gt;&lt;P&gt;options user=x ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can change WORK library.&lt;/P&gt;&lt;P&gt;options work=x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Nov 2014 13:01:00 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-11-27T13:01:00Z</dc:date>
    <item>
      <title>How to use CSIDL variables to change the location of SASUSER in Windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188923#M35698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently made a useful discovery which may help others configure SAS 9.2 on Windows 7 or other versions. My motivation was to move the SASUSER library away from "My Documents" because that location was redirected to a slow network share, which caused occasional errors with the profile and its backup file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS configuration file SASV9.CFG by default has -SASUSER "?CSIDL_PERSONAL\My SAS Files\9.2". ?CSIDL_PERSONAL resolves to C:\Users\USERID\Documents or wherever that is redirected. I changed it to put it one level higher like so: -SASUSER "?CSIDL_PROFILE\My SAS Files\9.2". You could argue that this is more consistent with common Windows usage, where "My" folders appear directly under the profile home.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It turns out that SAS will understand several of these CSIDL identifiers; I also tried CSIDL_APPDATA. They are deprecated since Windows Vista but while they are still used by SAS, predumably we may still use them. There is a list of variables here: &lt;A href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx"&gt;CSIDL (Windows)&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These variables may also be used in -SET MYSASFILES and in -SASINITIALFOLDER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be considerate of SAS to document this use of CSIDL variables in the configuration file. For example, !TEMP looks as if it might be a way to refer to environment variables generally, but !OTHER_VAR does not work. If you look with %SYSGET() you will also discover that -SET itself does not expand the CSIDL reference; it happens somewhere else. SAS seems to have embraced and extended the complexity in Windows environment definitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Lancashire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 10:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188923#M35698</guid>
      <dc:creator>Peter_L</dc:creator>
      <dc:date>2014-11-27T10:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use CSIDL variables to change the location of SASUSER in Windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188924#M35699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a global option to change default SASUSER library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname x v9 'c:\temp';&lt;/P&gt;&lt;P&gt;options user=x ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can change WORK library.&lt;/P&gt;&lt;P&gt;options work=x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 13:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188924#M35699</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-11-27T13:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use CSIDL variables to change the location of SASUSER in Windows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188925#M35700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I confirm Peter's most useful post on all and every points :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;?CSIDL_PERSONAL&lt;/SPAN&gt; on Win 7 resolves to the location of "My Documents" which is sometimes synchronised with a network share (My Documents Synchronized vs My local Documents)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) the system synchronisation process might conflict with the SAS session updating SASUSER content, especially SAS profile catalog, SAS registry (itemStore) or Template Store.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) changing &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;?CSIDL_PERSONAL with ?CSIDL_PROFILE seems like a functional workaround&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;4) unfortunately Windows Companion Guide 9.2 doesn't include the slightest reference to &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;?CSIDL_PERSONAL&lt;/SPAN&gt; or %USERPROFILE% dynamic environment variables set up for SASUSER location &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) During the very first steps of SAS Windows launching process (eg Scope = Kernel), for instance when the SASV9.cfg is loaded, as a general rule no system environment variable can be expanded&lt;/P&gt;&lt;P&gt;with the exception of !TEMP&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; (= %TMP%) or ?CSIDL_&amp;lt;suffix&amp;gt; . It begins further at the Autoexec or Initstmt levels. Furthermore SAS option value based on dynamic resolution (ex.&amp;nbsp; -OPTION "&amp;amp;macrovar" , OPTION "%sysget(SYSTEMVAR);) might&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;vary from one option to another . Run proc options with the DEFINE statement to know about it :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Proc Options option=&amp;lt;option name&amp;gt; &lt;STRONG&gt;define&lt;/STRONG&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt; SASINITIALFOLDER=&lt;/P&gt;
&lt;P&gt;Option Definition Information for SAS Option SASINITIALFOLDER&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group= ENVFILES&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group Description: SAS library and file location information&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description: Sets SAS's initial working folder. Also changes initial folder of Open and Save&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As dialog to be current working folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type: The option value is of type CHARACTER&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Maximum Number of Characters: 260&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Casing: The option value is retained with original casing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quotes: If present during "set", start and end quotes are removed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parentheses: The option value does not require enclosure within parentheses. If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; present, the parentheses are retained.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Expansion: Environment variables, within the option value, are not expanded&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When Can Set: Session startup (command line or config) only&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Restricted: Your Site Administrator can restrict modification of this option&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Optsave: Proc Optsave or command Dmoptsave will not save this option&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Incidentally, I locked my SASUSER folders more than once because of this and I had to use Sysinternals "Handle" utility to identify the low level SMB/RDP&amp;nbsp; process involved in the system sync.&lt;/P&gt;&lt;P&gt;Even ProcessExplorer (with local admin privileges) could not display the system process Ids.:smileyplain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CSIDLs dynamic variables are supposed to be deprecated with Vista. They are closely linked to the registry keys stored at :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meanwhile, starting in 9.4, SAS recommends using new System environment variables for the SASUSER library:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/50/713.html" style="font-size: 10pt; line-height: 1.5em;" title="http://support.sas.com/kb/50/713.html"&gt;50713 - The SASUSER default location has changed in the SAS® 9.4 sasv9.cfg file for Windows operating environments&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Nov 2014 15:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-CSIDL-variables-to-change-the-location-of-SASUSER-in/m-p/188925#M35700</guid>
      <dc:creator>ronan</dc:creator>
      <dc:date>2014-11-28T15:07:34Z</dc:date>
    </item>
  </channel>
</rss>

