<?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: In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852278#M41962</link>
    <description>&lt;P&gt;Thanks Chris. The UUIDGEN function is what I need. Found your blog post about it as well. Appreciate the help.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 13:53:17 GMT</pubDate>
    <dc:creator>RJo</dc:creator>
    <dc:date>2023-01-05T13:53:17Z</dc:date>
    <item>
      <title>In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852016#M41944</link>
      <description>&lt;P&gt;I'm interested in using the &amp;amp;SASWORKLOCATION macro variable to create a unique ID. It seems like a portion of this macro variable is unique and created the first time a data set is saved to the work library. If you close and re-open the EG project, then re-run code to create something in the work library, a new value for this macro variable is created. Here is an example of my code and the log. I'm specifically interested in the part in blue. Is it in fact unique or could this portion of the work library directory get re-used for another EG project at another time? (Note - I scrambled some of the values to make sure I don't inadvertently post any sensitive information.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Run this code:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; test;&lt;/P&gt;&lt;P&gt;length testvar $&lt;STRONG&gt;10&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%put&lt;/STRONG&gt; &amp;amp;SASWORKLOCATION;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Log:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;SASWORKLOCATION;&lt;/P&gt;&lt;P&gt;"/saswork/SAS_work&lt;FONT color="#3366FF"&gt;&lt;EM&gt;&lt;STRONG&gt;AB9C00005740&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;_xxxxxxx.xxxx.net/SAS_work325100115740_xxxxxxx.xxxx.net/"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Save, close, re-open the EG project, re-run the same code. Now the log shows:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;SASWORKLOCATION;&lt;/P&gt;&lt;P&gt;"/saswork/SAS_work&lt;FONT color="#3366FF"&gt;&lt;EM&gt;&lt;STRONG&gt;F0R900007C73&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;_xxxxxxx.xxxx.net/SAS_work2FB622007C73_xxxxxxx.xxxx.net/"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Just re-running the code without closing the EG project, the directory does not change:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;SASWORKLOCATION;&lt;/P&gt;&lt;P&gt;"/saswork/SAS_work&lt;FONT color="#3366FF"&gt;&lt;EM&gt;&lt;STRONG&gt;F0R900007C73&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;_xxxxxxx.xxxx.net/SAS_work2FB622007C73_xxxxxxx.xxxx.net/"&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 19:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852016#M41944</guid>
      <dc:creator>RJo</dc:creator>
      <dc:date>2023-01-03T19:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852019#M41945</link>
      <description>&lt;P&gt;The WORK folder (location of the WORK library and other transient files) is established when your SAS session starts. The root is determined from the WORK system option you specify at startup or in a config file (an admin does this).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you start EG and run a project, a SAS session is established. When you run another project that session is reused (same WORK folder) unless you close EG (which closes all SAS sessions) or explicitly select Disconnect from the Servers list. A new session would then have a new WORK folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your goal is to create a folder with a truly unique name, something like this would do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;options dlcreatedir;
%let path=%sysfunc(getoption(WORK))/%sysfunc(uuidgen());
/* creates folder AND assigns a libname of P */
libname p "&amp;amp;path";
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;PRE&gt;28         options dlcreatedir;
29         %let path=%sysfunc(getoption(WORK))/%sysfunc(uuidgen());
30         /* creates folder AND assigns a libname of P */
31         libname p "&amp;amp;path";
NOTE: Library P was created.
NOTE: Libref P was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: /sastmp/SAS_workF20600013E2E_miseiddvp1/SAS_work0BC600013E2E_miseiddvp1/01ecb587-154b-2648-b97e-70cbe712106b
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 20:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852019#M41945</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2023-01-03T20:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852025#M41946</link>
      <description>&lt;P&gt;The SAS system uses the hexadecimally coded process number to create the WORK directory. Among other things, this makes it easy for the &lt;FONT face="courier new,courier"&gt;cleanwork&lt;/FONT&gt; utility to find orphaned directories.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 20:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852025#M41946</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-01-03T20:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852277#M41961</link>
      <description>Thanks!</description>
      <pubDate>Thu, 05 Jan 2023 13:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852277#M41961</guid>
      <dc:creator>RJo</dc:creator>
      <dc:date>2023-01-05T13:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: In SAS EG, how is the directory for the work library created / SASWORKLOCATION macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852278#M41962</link>
      <description>&lt;P&gt;Thanks Chris. The UUIDGEN function is what I need. Found your blog post about it as well. Appreciate the help.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 13:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/In-SAS-EG-how-is-the-directory-for-the-work-library-created/m-p/852278#M41962</guid>
      <dc:creator>RJo</dc:creator>
      <dc:date>2023-01-05T13:53:17Z</dc:date>
    </item>
  </channel>
</rss>

