<?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 SAS Custom Task - Obtain fullPath in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/707963#M9586</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the SAS Server Path to read in a SAS dataset, and I would only like to obtain the&amp;nbsp;full path of the dataset location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the return value from the SAS Server Path, it shows me the &lt;STRONG&gt;path, name&lt;/STRONG&gt; and &lt;STRONG&gt;fullPath&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is, when I use this code: %let file = $fileSelector.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is shown:&lt;/P&gt;
&lt;P&gt;%let file = {path=C:\Output, &lt;BR /&gt;name=pq1.sas7bdat, &lt;BR /&gt;fullPath=C:\Output\pq1.sas7bdat};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only would like to obtain the full path result, without having to subsequently use SUBSTR functions to obtain the value in fullPath. Do you know how I can achieve this please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is&amp;nbsp;some of the code that I used in my custom task:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;Option name="fileSelector" inputType="sasserverpath" defaultFileName="pq1"&lt;BR /&gt;pathType="file" defaultExtension="sas7bdat"&amp;gt;An example of a SAS Server Path control.&lt;BR /&gt;This example allows the user to select a SAS program file.&amp;lt;/Option&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kriss Harris&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Dec 2020 19:37:11 GMT</pubDate>
    <dc:creator>djrisks</dc:creator>
    <dc:date>2020-12-23T19:37:11Z</dc:date>
    <item>
      <title>SAS Custom Task - Obtain fullPath</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/707963#M9586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the SAS Server Path to read in a SAS dataset, and I would only like to obtain the&amp;nbsp;full path of the dataset location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the return value from the SAS Server Path, it shows me the &lt;STRONG&gt;path, name&lt;/STRONG&gt; and &lt;STRONG&gt;fullPath&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is, when I use this code: %let file = $fileSelector.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is shown:&lt;/P&gt;
&lt;P&gt;%let file = {path=C:\Output, &lt;BR /&gt;name=pq1.sas7bdat, &lt;BR /&gt;fullPath=C:\Output\pq1.sas7bdat};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only would like to obtain the full path result, without having to subsequently use SUBSTR functions to obtain the value in fullPath. Do you know how I can achieve this please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is&amp;nbsp;some of the code that I used in my custom task:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;Option name="fileSelector" inputType="sasserverpath" defaultFileName="pq1"&lt;BR /&gt;pathType="file" defaultExtension="sas7bdat"&amp;gt;An example of a SAS Server Path control.&lt;BR /&gt;This example allows the user to select a SAS program file.&amp;lt;/Option&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kriss Harris&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 19:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/707963#M9586</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2020-12-23T19:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Custom Task - Obtain fullPath</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/708454#M9597</link>
      <description>&lt;P&gt;I found this solution, 1) because I've wanted to learn if I could pipe a macro variable into a filename/infile statement(s) and also 2) because I've wanted to learn the input statement using the "named" input style.&amp;nbsp; I don't think this is as elegant of a solution as either of us wanted.&amp;nbsp; I defer to another for a&amp;nbsp; beautifully short answer.&amp;nbsp; I could also think of another way -- by using the SCAN function to parse the string.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fileSelector={path=C:\Output,
name=pq1.sas7bdat,
fullPath=C:\Output\pq1.sas7bdat};

  filename in dataurl "data:&amp;amp;fileSelector";

data _null_;
  length fullPath $ 256;
  infile in ;
  input @;
  _infile_=compress(_infile_,"{,}");
  input fullPath=;
  call symput("fullpath",strip(fullpath));
run;

%put NOTE: fullpath=&amp;amp;fullpath;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Dec 2020 17:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/708454#M9597</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2020-12-28T17:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Custom Task - Obtain fullPath</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/708459#M9598</link>
      <description>&lt;P&gt;Hi Phil,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for this, it's great and it works. I tested it out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, today I did find the elegant solution (for the velocity code).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; %let file = ${fileSelector.fullPath};&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Many thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kriss Harris&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 18:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Custom-Task-Obtain-fullPath/m-p/708459#M9598</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2020-12-28T18:56:51Z</dc:date>
    </item>
  </channel>
</rss>

