<?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 X command and call system not working correctly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194319#M266350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. I have a command line function that I would like to run. This function calls the "putty" program, with a given input.&amp;nbsp; I am using it to connect to a SFTP server...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The command is as follows.&lt;/P&gt;&lt;P&gt;"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A href="mailto:brandon@connect.myPRDServer.biz."&gt;brandon@connect.myPRDServer.biz&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i save this command line to a .bat file, and double click the bat file the correct results are returned to the file 'C:\SFTP\OutputofResults.txt'.&lt;/P&gt;&lt;P&gt;Also if I simply open the command line and paste this string into it, the correct results are returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However If I run it from SAS through either of the following commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x '"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A class="active_link" href="mailto:brandon@connect.myPRDServer.biz'"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;call system ('"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A class="active_link" href="mailto:brandon@connect.myPRDServer.biz'"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt; );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the program does not run.&amp;nbsp; The Command prompt window very quckly opens, and then immediately closes. From the very click glimpse of the command window, it looks like it is calling PSFTP correctly, but then immediately not recognizing the command -b, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure where to go from here... Does anyone have any great ideas at this point?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 May 2015 16:15:47 GMT</pubDate>
    <dc:creator>Anotherdream</dc:creator>
    <dc:date>2015-05-27T16:15:47Z</dc:date>
    <item>
      <title>X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194319#M266350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. I have a command line function that I would like to run. This function calls the "putty" program, with a given input.&amp;nbsp; I am using it to connect to a SFTP server...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The command is as follows.&lt;/P&gt;&lt;P&gt;"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A href="mailto:brandon@connect.myPRDServer.biz."&gt;brandon@connect.myPRDServer.biz&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i save this command line to a .bat file, and double click the bat file the correct results are returned to the file 'C:\SFTP\OutputofResults.txt'.&lt;/P&gt;&lt;P&gt;Also if I simply open the command line and paste this string into it, the correct results are returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However If I run it from SAS through either of the following commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x '"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A class="active_link" href="mailto:brandon@connect.myPRDServer.biz'"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;call system ('"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A class="active_link" href="mailto:brandon@connect.myPRDServer.biz'"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt; );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the program does not run.&amp;nbsp; The Command prompt window very quckly opens, and then immediately closes. From the very click glimpse of the command window, it looks like it is calling PSFTP correctly, but then immediately not recognizing the command -b, etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure where to go from here... Does anyone have any great ideas at this point?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194319#M266350</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-27T16:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194320#M266351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some additional information.&amp;nbsp; It looks like if I actually have SAS CREATE a batfile with teh exact same command, and then simply call that batfile the program works. Aka the code below is working perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;var1='"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt"&lt;BR /&gt; &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;A href="mailto:brandon@connect.myPRDServer.biz'"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt;;&lt;BR /&gt; file 'C:\SFTP\Testbatwrite.bat';&lt;BR /&gt; put var1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;x '"C:\SFTP\Testbatwrite.bat"';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So writing a bat file and then calling the bat file works, but simply putting the command into an X command (or call system command) doesn't..... That to me makes no sense so if anyone has any insight I would greatly appreciate it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194320#M266351</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-27T16:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194321#M266352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's probably a problem with quote marks.&amp;nbsp; What if you try it without adding the single quotes, ie:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;x "C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt" &amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:brandon@connect.myPRDServer.biz"&gt;brandon@connect.myPRDServer.biz&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that would try adding more quotes, something crazy like:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;x """C:\Program Files\PuTTY\psftp"" -b ""C:\SFTP\DirectoryCommand.txt"" &amp;gt;""C:\SFTP\OutputofResults.txt"" -pw myfakepassword &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:brandon@connect.myPRDServer.biz"&gt;brandon@connect.myPRDServer.biz&lt;/A&gt;&lt;SPAN&gt;"&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that I would re-read Art Carpenter's papers about quote marks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think if you set options xwait xsynch; it should leave the dos window open so you can at least read any messages you get back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194321#M266352</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-05-27T16:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194322#M266353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;What if you call system that variable?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;var1='"C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:brandon@connect.myPRDServer.biz'" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0e66ba; background-color: #ffffff;"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;file 'C:\SFTP\Testbatwrite.bat';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;put var1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;call system(var1);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194322#M266353</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-05-27T16:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194323#M266354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Type using CALL SYSTEM() in a data step so the the strings are similar to what you are doing to create the BAT file.&lt;/P&gt;&lt;P&gt;Is it possible that PUTTY is smart enough to behave differently when called from the command line (essentially a terminal session) versus from a batch file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194323#M266354</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-27T16:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194324#M266355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey. &lt;SPAN class="j-status-levels"&gt;&lt;IMG alt="Expert" class="jiveImage" src="https://communities.sas.com/5.0.2/images/status/statusicon-50.gif" title="Expert" /&gt; &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="726767" data-username="Quentin" href="https://communities.sas.com/people/Quentin" id="jive-72676748125298074320186"&gt;Quentin&lt;/A&gt; &lt;/STRONG&gt;Thanks for the help, but I am 99% sure it's not quote marks. I actually already tried both of your solutions (plus like 8 others that might make sense) and none of them worked =(.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;(Fyi your first one fails because you are not wrapping the password into the x call so it fails.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;The second one doesn't fail, but acts the same way that the single quote one is.. It's briefly opening the dos window, and then shutting it (open for &amp;lt;1/10 a second).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;Also: even with the options xwait and xsync&amp;nbsp; the program is STILL closing the command line pop up window.... Which makes zero sense but that is what is happening.&amp;nbsp; it's extremely frustrating... &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;Hey tom and Reeza I will look into the calling the variable. Testing it now (i've never done this before actually).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194324#M266355</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-27T16:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194325#M266356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;SPAN class="j-status-levels"&gt;&lt;IMG alt="Master" class="jiveImage" src="https://communities.sas.com/5.0.2/images/status/statusicon-51.gif" title="Master" /&gt; &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1566" data-externalid="" data-presence="null" data-userid="2431" data-username="Tom" href="https://communities.sas.com/people/Tom" id="jive-243148125522886865186"&gt;Tom&lt;/A&gt; and &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="j-status-levels"&gt;&lt;IMG alt="Master" class="jiveImage" src="https://communities.sas.com/5.0.2/images/status/statusicon-51.gif" title="Master" /&gt; &lt;/SPAN&gt;&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="2513" data-externalid="" data-presence="null" data-userid="255172" data-username="Reeza" href="https://communities.sas.com/people/Reeza" id="jive-25517248125522872036186"&gt;Reeza&lt;/A&gt;.&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;When I try to call system it, it acts the same way as running an X command on it.&amp;nbsp; It opens the dos command window for 1/10th of a second (and it looks like some putty psftp system options are shown) and then immediately closes the dos window... No output file (aka C:\SFTP\OutputofResults.txt) is returned.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;SO again, if I call a batfile with that exact variable command it works, if I call system the variable itself it fails.... I'm quite confused&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 16:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194325#M266356</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-27T16:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194326#M266357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call it in a pipe so that you can see the error message.&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile '.....' pipe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt; put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 17:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194326#M266357</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-27T17:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194327#M266358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey tom.. What do i put in the '&amp;nbsp; '.&amp;nbsp; Do I put the entire command string into that portion of the infile? Sorry I'm not following your solution (I have never used pipe before).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I was able to grab a screenshot of the windows command that keeps popping up for 1/10 a second (hurray fast typing).&amp;nbsp;&amp;nbsp;&amp;nbsp; if you cannot see it, it is just some system options for the Putty program PSFTP.exe...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it looks like when called thorugh the X command, or Call system, etc.. The program is maybe only recognizing&amp;nbsp; the first part (just the call to psftp itself?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Program Files\PuTTY\psftp" -b "C:\SFTP\DirectoryCommand.txt"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&amp;gt;"C:\SFTP\OutputofResults.txt" -pw myfakepassword &lt;/SPAN&gt;&lt;A class="jive-link-email-small active_link" href="mailto:brandon@connect.myPRDServer.biz'" style="color: #0e66ba; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;brandon@connect.myPRDServer.biz'&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't look like any of the other options that were specified went through the system&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure else it would run the program and note the options, without actually running the options.... (i do note that the scroll bar on the program has a lot of room left... so maybe it tried but we just can't see it because it won't hold open....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways attached is a copy of that screenshot &lt;IMG alt="show sas users.png" class="jive-image-thumbnail jive-image" height="344" src="https://communities.sas.com/legacyfs/online/10631_show sas users.png" width="791" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 19:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194327#M266358</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-27T19:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194328#M266359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, put the command you want to run.&amp;nbsp; You can also try copying the command to the paste buffer and pasting it into a command window and see if you can get the error message that way.&lt;/P&gt;&lt;P&gt;Here is a simple example for pipe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'dir' pipe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 19:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194328#M266359</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-05-27T19:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194329#M266360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd move the output redirection to the end of the command for a test.&lt;/P&gt;&lt;P&gt;Better yet to omit the redirection at all and use the pipe method suggested by Tom, you'll find the output in the SAS log.&lt;/P&gt;&lt;P&gt;For good measure, add 2&amp;gt;&amp;amp;1 at the very end of the command to make sure that stderr is also caught.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 06:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194329#M266360</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-28T06:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194330#M266361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a hint: Are the system options XSYNC and XWAIT turned on?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;options xwait xsync;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc options option=(xwait xsync); run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 09:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194330#M266361</guid>
      <dc:creator>barchan</dc:creator>
      <dc:date>2015-05-28T09:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: X command and call system not working correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194331#M266362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Turns out this is a problem with the Putty program. It doesn't allow one to call it from SAS using a command line call.&amp;nbsp; I assume this has something to do with calling the program from an outside command line call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a work around I am simply going to have SAS create the .BAT file, and then call the bat file from sas. This works and does what I need it too, so i'll be a happy camper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the pipe trick Tom, I wasn't aware of that and that is what allowed me to determine it was a Putty program and not sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 12:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-command-and-call-system-not-working-correctly/m-p/194331#M266362</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2015-05-28T12:33:49Z</dc:date>
    </item>
  </channel>
</rss>

