<?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: run psftp .bat file from SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8698#M366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the numerous answers. &lt;/P&gt;&lt;P&gt;It seems that it doesn't matter which ending the file containing the FTP commands has.&lt;/P&gt;&lt;P&gt;@Tom: The glue with the pipe is great. Now, I get the follwoing message into the Log:&lt;/P&gt;&lt;P&gt;&amp;lt;log-output&amp;gt;&lt;/P&gt;&lt;P&gt;Stderr output:&lt;/P&gt;&lt;P&gt;The server's host key is not cached in the registry. You&lt;/P&gt;&lt;P&gt;have no guarantee that the server is the computer you&lt;/P&gt;&lt;P&gt;think it is.&lt;/P&gt;&lt;P&gt;The server's rsa2 key fingerprint is:&lt;/P&gt;&lt;P&gt;ssh-rsa 1024 39:95:d4:82:cf:25:8f:92:9a:92:6a:23:4f:89:47:4f&lt;/P&gt;&lt;P&gt;Connection abandoned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/log-output&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I think I got the solution. I was logged in EG with a different user than the user logged on to the server, because the users usually are not allowed to log-on to the Win-Server. I have a SASADMIN windows user and was logged in Windows with this user. So the keys in the registry are stored under HKEY_CURRENT_USER. But when I use a different user in EG to execute the program the keys are not available to this user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to deal with this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your support!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2011 10:36:34 GMT</pubDate>
    <dc:creator>puntigama</dc:creator>
    <dc:date>2011-12-06T10:36:34Z</dc:date>
    <item>
      <title>run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8693#M361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally I got it to sign to this community and a first question already came up:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to transfer a file from SAS 9.3 on Windows via psftp to a Unix-Server.&lt;/P&gt;&lt;P&gt;I've written a dos-bat file "execute_cmd.bat" which contains the following ftp-commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cd /cid/test_folder&lt;/P&gt;&lt;P&gt;put d:\test\test.dat&lt;/P&gt;&lt;P&gt;quit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I type in the dos-prompt the following line everything works fine and the file is transferred to the Unix server:&lt;/P&gt;&lt;P&gt;psftp av2 -batch -b d:\test\execute_cmd.bat&amp;nbsp; ("av2" is a stored putty session for connection to the unix server).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to execute this line of code within SAS Enterprise Guide (X commands are enabled):&lt;/P&gt;&lt;P&gt;X "psftp av2 -batch -b d:\test\execute_cmd.bat";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Program ends fine, without error, but there is no file transferred to the Unix Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to execute another .bat file e.g.: "doit.bat" wiht X "d:\test\doit.bat"&amp;nbsp; which contains the following (non ftp) commands it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d:&lt;/P&gt;&lt;P&gt;cd d:\test&lt;/P&gt;&lt;P&gt;dir &amp;gt; testit.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have a glue why my transfer isn''t working? I've already searched in google and read lots of related documents but unfortunately without success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help and kind regards,&lt;/P&gt;&lt;P&gt;Arnold&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 16:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8693#M361</guid>
      <dc:creator>puntigama</dc:creator>
      <dc:date>2011-12-05T16:21:03Z</dc:date>
    </item>
    <item>
      <title>run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8694#M362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No idea about psftp, but if you use a PIPE in SAS then you can read the messages that the program might spit out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename getfiles pipe "psftp av2 -batch -b d:\test\execute_cmd.bat";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile getfiles;&lt;/P&gt;&lt;P&gt; input;&lt;/P&gt;&lt;P&gt; list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 16:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8694#M362</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-05T16:52:14Z</dc:date>
    </item>
    <item>
      <title>run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8695#M363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; the account which executes your SAS programs on the EG server might have different privileges (like psftp and putty and ... )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 16:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8695#M363</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-12-05T16:52:18Z</dc:date>
    </item>
    <item>
      <title>run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8696#M364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm confused by what you are saying you are trying to submit.&amp;nbsp; Your command looks like it is trying to run the ftp program and having that program call the batch program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your batch program is already calling the ftp program, shouldn't you just be submitting the batch program?&amp;nbsp; And, like Tom suggested, you might want to run the program via a pipe but, again, I think you simply want to run the batch program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 17:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8696#M364</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-05T17:12:18Z</dc:date>
    </item>
    <item>
      <title>run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8697#M365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The program he listed is a series of FTP command, not DOS commands.&amp;nbsp; He should give it a different extension because the .BAT extension might confuse Windows into think that it is an actual batch of DOS commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 17:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8697#M365</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-05T17:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8698#M366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the numerous answers. &lt;/P&gt;&lt;P&gt;It seems that it doesn't matter which ending the file containing the FTP commands has.&lt;/P&gt;&lt;P&gt;@Tom: The glue with the pipe is great. Now, I get the follwoing message into the Log:&lt;/P&gt;&lt;P&gt;&amp;lt;log-output&amp;gt;&lt;/P&gt;&lt;P&gt;Stderr output:&lt;/P&gt;&lt;P&gt;The server's host key is not cached in the registry. You&lt;/P&gt;&lt;P&gt;have no guarantee that the server is the computer you&lt;/P&gt;&lt;P&gt;think it is.&lt;/P&gt;&lt;P&gt;The server's rsa2 key fingerprint is:&lt;/P&gt;&lt;P&gt;ssh-rsa 1024 39:95:d4:82:cf:25:8f:92:9a:92:6a:23:4f:89:47:4f&lt;/P&gt;&lt;P&gt;Connection abandoned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/log-output&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I think I got the solution. I was logged in EG with a different user than the user logged on to the server, because the users usually are not allowed to log-on to the Win-Server. I have a SASADMIN windows user and was logged in Windows with this user. So the keys in the registry are stored under HKEY_CURRENT_USER. But when I use a different user in EG to execute the program the keys are not available to this user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to deal with this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your support!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 10:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8698#M366</guid>
      <dc:creator>puntigama</dc:creator>
      <dc:date>2011-12-06T10:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8699#M367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any suggestions anybody? &lt;/P&gt;&lt;P&gt;Workaround could be to create a user profile for each user on the win-server and configure putty there. so the sessions are strored in the registry for each user and they can use the psftp transfer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you think about this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 14:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8699#M367</guid>
      <dc:creator>puntigama</dc:creator>
      <dc:date>2011-12-07T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8700#M368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anybody have a auggestion how to deal with this?&lt;/P&gt;&lt;P&gt;Don't you use sftp transfers out of SAS EG for your personalized users or do they work with a common user for which the servers fingerprint is already stored?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your collaboration!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 16:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8700#M368</guid>
      <dc:creator>puntigama</dc:creator>
      <dc:date>2011-12-13T16:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8701#M369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try using the FTP filename engine to just let SAS ftp the file for you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 17:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8701#M369</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-13T17:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: run psftp .bat file from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8702#M370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is som examples with sftp. not sure whether it can work with psftp&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0xln1fiwsr340n1xxf4mkmfxp6f.htm"&gt;http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0xln1fiwsr340n1xxf4mkmfxp6f.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 06:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/run-psftp-bat-file-from-SAS/m-p/8702#M370</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-14T06:38:32Z</dc:date>
    </item>
  </channel>
</rss>

