<?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 Passing Parameters to Another Software Program - X Command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844846#M333995</link>
    <description>&lt;P&gt;Is it possible to pass parameters to another software program I want to call from SAS?&amp;nbsp; I'm trying to call a tool called LEGS which when you click on it it will open a terminal and ask you to input R or F and then your instructions file. Using this I get as far as the terminal asking R or F but I have no idea how to go about inputting the required prompts from SAS-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x start "" "P:\SAS PD\LEGS\G3\LEGS Release.exe";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight is greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 13:37:02 GMT</pubDate>
    <dc:creator>lbogar</dc:creator>
    <dc:date>2022-11-17T13:37:02Z</dc:date>
    <item>
      <title>Passing Parameters to Another Software Program - X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844846#M333995</link>
      <description>&lt;P&gt;Is it possible to pass parameters to another software program I want to call from SAS?&amp;nbsp; I'm trying to call a tool called LEGS which when you click on it it will open a terminal and ask you to input R or F and then your instructions file. Using this I get as far as the terminal asking R or F but I have no idea how to go about inputting the required prompts from SAS-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x start "" "P:\SAS PD\LEGS\G3\LEGS Release.exe";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 13:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844846#M333995</guid>
      <dc:creator>lbogar</dc:creator>
      <dc:date>2022-11-17T13:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Parameters to Another Software Program - X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844859#M334000</link>
      <description>&lt;P&gt;You can't feed data into a prompt directly from SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On UNIX, I would create a shell script which accepts commandline parameters and then uses&amp;nbsp;&lt;FONT face="courier new,courier"&gt;expect&lt;/FONT&gt; to feed them to the target process.&lt;/P&gt;
&lt;P&gt;Unless, of course, the target software accepts commandline parameters on its own (something which separates software from crapware IMO).&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 13:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844859#M334000</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-17T13:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Parameters to Another Software Program - X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844860#M334001</link>
      <description>&lt;P&gt;Your EXE file is running under Windows command CMD shell. You can redirect to the input of terminal-style programs like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;echo R|"&lt;SPAN&gt;P:\SAS PD\LEGS\G3\LEGS Release.exe"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Echo sends R followed by end-of-line. It is more challenging to provide two lines. It might work to write your two lines to an external file and then have this CMD line:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;lt;"myinput.txt" "P:\SAS PD\LEGS\G3\LEGS Release.exe"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It depends very much on how the EXE reads its input. In the worst case you might need something like AutoIT. Get it working outside SAS first, then make SAS provide what works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ref:&amp;nbsp;&lt;A href="https://ss64.com/nt/syntax-redirection.html" target="_blank"&gt;Command Redirection, Pipes - Windows CMD - SS64.com&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;An alternative is to write a CMD wrapper for your EXE which takes two parameters and provides them as described above. Then call the wrapper from SAS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ref:&amp;nbsp;&lt;A href="https://ss64.com/nt/call.html" target="_blank"&gt;Call - Windows CMD - SS64.com&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 14:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844860#M334001</guid>
      <dc:creator>Peter_L</dc:creator>
      <dc:date>2022-11-17T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Parameters to Another Software Program - X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844899#M334017</link>
      <description>&lt;P&gt;Can you show a command line that behaves as if the value R or F are accepted?&lt;/P&gt;
&lt;P&gt;Maybe something like this entered in a command prompt:&lt;/P&gt;
&lt;PRE&gt;P:\SAS PD\LEGS\G3\LEGS Release.exe &amp;lt;R &lt;/PRE&gt;
&lt;P&gt;The redirect can be used to send a parameter to standard input depending on the program. If that works then you could create a SAS call that creates the appropriate call but that depends on Where is the R or F that you want set or stored? SAS cannot pass something it has not processed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which environment are you running SAS in? EG has a Prompt to submit such stuff, SAS Display manager can use the WINDOW data step functionality or the macro facility %WINDOW to request user input.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 15:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-Parameters-to-Another-Software-Program-X-Command/m-p/844899#M334017</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-17T15:15:59Z</dc:date>
    </item>
  </channel>
</rss>

