<?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: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887261#M11039</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know about Custom Tasks (*.ctk) and Common Task Model (*.ctm) in SAS Viya&lt;/P&gt;
&lt;P&gt;, but my experience using / building these is very limited.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Custom tasks use different syntax while building inputs&lt;BR /&gt;, but at the end I think SAS will see macro variables, or list of macro variables like &amp;amp;var1-&amp;amp;var10.&lt;/P&gt;
&lt;P&gt;And if user creates input in the XML syntax for which the name is "program" , I would guess that somewhere on the SAS session there should be some kind &amp;amp;program variable containing the value which was inserted by user. No?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure though ...&lt;BR /&gt;Probably &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114048"&gt;@XavierBizoux&lt;/a&gt; can help you out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Tue, 01 Aug 2023 09:51:49 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2023-08-01T09:51:49Z</dc:date>
    <item>
      <title>SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887120#M11036</link>
      <description>&lt;P&gt;I am trying to create a Task Prompt to allow a user to select a SAS program. I would then like to run the SAS program. Theoretically I should be able to achieve this by adding the program into an %include statement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've managed to create the prompt to allow the user to select the SAS program&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Option defaultExtension="sas" defaultName="program" inputType="sasserverpath" pathtype="file" required="true" name="var_sasprog"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My assumption was then that the var_sasprog will contain the path value. However, it returned an object. I needed to find out how to use this newly populated object. Searching the net, I found this link:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/sassoftware/sas-studio-tasks/blob/master/prompts/prompts/File_Selector.ctm" target="_blank"&gt;https://github.com/sassoftware/sas-studio-tasks/blob/master/prompts/prompts/File_Selector.ctm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It seems that the value of the full path is contained within the fullPath value in a Velocity variable&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://documentation.sas.com/doc/en/webeditorcdc/v_032/webeditordg/n1648jbi8lc1j7n0zxi4b3e9rcbb.htm#n1q3aa1lvxn9sin120j23vwdmg0y" target="_blank"&gt;https://documentation.sas.com/doc/en/webeditorcdc/v_032/webeditordg/n1648jbi8lc1j7n0zxi4b3e9rcbb.htm#n1q3aa1lvxn9sin120j23vwdmg0y&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As&amp;nbsp; stated above, there are examples for Custom Tasks to extract the value from the Velocity variable via Code Templates, but how do I get the full path value captured in my Task Prompt to be used in my Job Execution?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 15:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887120#M11036</guid>
      <dc:creator>dylanviking</dc:creator>
      <dc:date>2023-07-31T15:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887162#M11037</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/446073"&gt;@dylanviking&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this help? :&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;Usage Note 24301: How to retrieve the program name that is currently running in batch mode or interactively&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/24/301.html" target="_blank"&gt;https://support.sas.com/kb/24/301.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Macro Language Reference&lt;BR /&gt;Example 6: How to Retrieve the Program Name That Is Currently Running in Batch Mode or Interactively&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1ns5wvyfxbca8n1l3konj0yj6nq.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1ns5wvyfxbca8n1l3konj0yj6nq.htm&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Manage the current directory within your SAS program&lt;BR /&gt;By Chris Hemedinger on The SAS Dummy August 28, 2018 &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2018/08/28/sas-current-directory/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2018/08/28/sas-current-directory/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Get program name and path when using %INCLUDE&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Get-program-name-and-path-when-using-INCLUDE/td-p/529145" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Get-program-name-and-path-when-using-INCLUDE/td-p/529145&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 Jul 2023 18:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887162#M11037</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-07-31T18:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887247#M11038</link>
      <description>&lt;P&gt;Hi Koen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately no. This is related to SAS Viya 4 Task Prompts in SAS Job Execution. This is similar to SAS Stored Processes in 9.4 where you provide an interface to the user so they can provide inputs in a user-friendly kind of way. However, the Task Prompts are based on Common Task Model and uses the Apache Velocity Template language -&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/webeditorcdc/3.8/webeditordg/p11w43kg6zyc1tn10843n8bd0rrj.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/webeditorcdc/3.8/webeditordg/p11w43kg6zyc1tn10843n8bd0rrj.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 07:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887247#M11038</guid>
      <dc:creator>dylanviking</dc:creator>
      <dc:date>2023-08-01T07:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887261#M11039</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know about Custom Tasks (*.ctk) and Common Task Model (*.ctm) in SAS Viya&lt;/P&gt;
&lt;P&gt;, but my experience using / building these is very limited.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Custom tasks use different syntax while building inputs&lt;BR /&gt;, but at the end I think SAS will see macro variables, or list of macro variables like &amp;amp;var1-&amp;amp;var10.&lt;/P&gt;
&lt;P&gt;And if user creates input in the XML syntax for which the name is "program" , I would guess that somewhere on the SAS session there should be some kind &amp;amp;program variable containing the value which was inserted by user. No?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure though ...&lt;BR /&gt;Probably &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114048"&gt;@XavierBizoux&lt;/a&gt; can help you out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Koen&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Aug 2023 09:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887261#M11039</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-08-01T09:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887269#M11040</link>
      <description>&lt;P&gt;Hi Koen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;Option defaultExtension="sas" defaultName="program" inputType="sasserverpath" pathtype="file" required="true" name="var_sasprog"/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sasserverpath input type returns an object. This input type provides an interface for the user to select the folder/SAS program via a user-friendly dialog box.&lt;/P&gt;&lt;P&gt;As mentioned in my original post, the value of the SAS program or folder is in the fullPath variable within the object. Unfortunately I do not know how to access that variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other input types like a text box, the variables are straightforward and a Macro variable is generated and I can use these variables directly in my code. I've tried doing a %put _ALL_ to see if there are any variables that are populated but I can't see any.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:28:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887269#M11040</guid>
      <dc:creator>dylanviking</dc:creator>
      <dc:date>2023-08-01T11:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887272#M11041</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see ...&lt;/P&gt;
&lt;P&gt;Thanks for explaining further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's hope&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114048"&gt;@XavierBizoux&lt;/a&gt;&amp;nbsp;is available today or tomorrow to help you out.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887272#M11041</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-08-01T11:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887307#M11042</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've to admit that I've never used the file selector. Based on my experience, not all the options available in the CTM are implemented in SAS Job Execution. This should be one of the options which is not handled. While the prompt will display properly, the value may not be passed to the job. The easiest to workaround this limitation, would be to use a dataset as source for the prompt. The dataset should be created upfront and contain all the SAS code a user can select to execute.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on your needs, you may want to convert your prompt to HTML and use the SAS Content SDK to navigate inside the content server. Using SAS Content SDK, you can display only the job type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have questions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 13:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887307#M11042</guid>
      <dc:creator>XavierBizoux</dc:creator>
      <dc:date>2023-08-01T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Viya 4 Task Prompts - Get SAS Program Full Path and File Name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887835#M11047</link>
      <description>&lt;P&gt;Thanks Xavier. I guess we will have to manage without the file selector. Will probably go down the dataset but there are many limitations to this option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 08:09:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/SAS-Viya-4-Task-Prompts-Get-SAS-Program-Full-Path-and-File-Name/m-p/887835#M11047</guid>
      <dc:creator>dylanviking</dc:creator>
      <dc:date>2023-08-04T08:09:11Z</dc:date>
    </item>
  </channel>
</rss>

