<?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: Linux SAS save working directory as a single variable in a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617603#M181019</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28840"&gt;@Jumboshrimps&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data working;&amp;nbsp; &lt;FONT face="arial,helvetica,sans-serif" color="#0000FF"&gt;&amp;lt;&amp;lt;&amp;lt;create a SAS data set "Working" with just 1 variable - temp work directory&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;call symput("workdir",&amp;amp;tmpSASwrk);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&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;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That part is incorrect, that's creating a macro variable with the work directory, equivalent to&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;tmpSASwrk&amp;nbsp; so its not doing what you think it's doing. This will, but make sure the length of the variable is long enough.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data working;&amp;nbsp; 
length workdir $300.;
workdir = "&amp;amp;tmpSASwrk";
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Jan 2020 21:43:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-01-15T21:43:07Z</dc:date>
    <item>
      <title>Linux SAS save working directory as a single variable in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617589#M181013</link>
      <description>&lt;P&gt;&lt;FONT color="#0000FF"&gt;Want to create a dataset containing one variable - the SAS temporary working directory on a&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;RedHat 7.7 (Maipo) server.&amp;nbsp; Code below works fine, until I try to write the (looooong) working&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;directory string to a temporary dataset.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;CODE:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc options option = work;&amp;nbsp; &lt;FONT face="arial,helvetica,sans-serif" color="#0000FF"&gt;&amp;lt;&amp;lt;&amp;lt;gets temporary SAS work directory&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%put %sysfunc(getoption(work));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%let tmpSASwrk = %sysfunc(getoption(work));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;%put &amp;amp;tmpSASwrk;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data working;&amp;nbsp; &lt;FONT face="arial,helvetica,sans-serif" color="#0000FF"&gt;&amp;lt;&amp;lt;&amp;lt;create a SAS data set "Working" with just 1 variable - temp work directory&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;call symput("workdir",&amp;amp;tmpSASwrk);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Although the working directory is correctly identified, I get the following error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;/saswork/SAS_work28AD0000FF4A_someplace.over.therainwbow.com"&amp;nbsp;&lt;/EM&gt;&lt;FONT color="#0000FF"&gt; &amp;lt;&amp;lt;&amp;lt;correct working directory&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;22 780&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;a datetime constant, a missing value, INPUT, PUT.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR 780-185: Invalid object or method name.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;How can I save the current (temporary) working directory string to a dataset with one variable?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 21:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617589#M181013</guid>
      <dc:creator>Jumboshrimps</dc:creator>
      <dc:date>2020-01-15T21:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Linux SAS save working directory as a single variable in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617593#M181015</link>
      <description>&lt;P&gt;What dataset do you want to create? What do you want to call the variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  working_dir = getoption('work');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 21:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617593#M181015</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-15T21:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Linux SAS save working directory as a single variable in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617603#M181019</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/28840"&gt;@Jumboshrimps&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data working;&amp;nbsp; &lt;FONT face="arial,helvetica,sans-serif" color="#0000FF"&gt;&amp;lt;&amp;lt;&amp;lt;create a SAS data set "Working" with just 1 variable - temp work directory&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;call symput("workdir",&amp;amp;tmpSASwrk);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&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;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That part is incorrect, that's creating a macro variable with the work directory, equivalent to&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;tmpSASwrk&amp;nbsp; so its not doing what you think it's doing. This will, but make sure the length of the variable is long enough.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data working;&amp;nbsp; 
length workdir $300.;
workdir = "&amp;amp;tmpSASwrk";
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 21:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/617603#M181019</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-15T21:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Linux SAS save working directory as a single variable in a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/618872#M181608</link>
      <description>&lt;P&gt;&lt;FONT size="4" color="#0000FF"&gt;Captain Obvious sez "Thanx", 'cause that was, well obvious.........&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 14:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linux-SAS-save-working-directory-as-a-single-variable-in-a/m-p/618872#M181608</guid>
      <dc:creator>Jumboshrimps</dc:creator>
      <dc:date>2020-01-21T14:27:14Z</dc:date>
    </item>
  </channel>
</rss>

