<?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 filename socket to exchange binary files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/filename-socket-to-exchange-binary-files/m-p/199756#M37340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am testing the filename socket access type with the aim of transferring binary files between two SAS sessions, i.e. send a binary file from the client session, the server session should receive the file and make a copy on the server where it runs. The binary file to be transferred can have any length. I have found many examples that show how to send an ASCII file and how to transfer a SAS Dataset by serializing on the client and de&lt;SPAN style="font-size: 13.3333330154419px;"&gt;serializing the data on the server, but t&lt;SPAN style="font-size: 13.3333330154419px;"&gt;he behaviour I am after would be similar to that of an ftp client sending a file to an ftp server. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;W&lt;/SPAN&gt;hat I am looking for is something like the code below which would work for any file. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the server (i.e. on machine "server.com"):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename srv socket ":5100" server;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile srv;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;file "/srvpath/myCopiedBinaryFile.bin";&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the client&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename client socket "server.com:5100";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile &lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;/clipath/myOriginalBinaryFile.bin";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;input; /*The input here should ideally read the whole file*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;file client;&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There a options for file type (A or B) and fixed length, streaming and others, but I have not managed to make it work, I don't even know if it is at all possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jun 2015 12:37:20 GMT</pubDate>
    <dc:creator>franz</dc:creator>
    <dc:date>2015-06-04T12:37:20Z</dc:date>
    <item>
      <title>filename socket to exchange binary files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/filename-socket-to-exchange-binary-files/m-p/199756#M37340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am testing the filename socket access type with the aim of transferring binary files between two SAS sessions, i.e. send a binary file from the client session, the server session should receive the file and make a copy on the server where it runs. The binary file to be transferred can have any length. I have found many examples that show how to send an ASCII file and how to transfer a SAS Dataset by serializing on the client and de&lt;SPAN style="font-size: 13.3333330154419px;"&gt;serializing the data on the server, but t&lt;SPAN style="font-size: 13.3333330154419px;"&gt;he behaviour I am after would be similar to that of an ftp client sending a file to an ftp server. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;W&lt;/SPAN&gt;hat I am looking for is something like the code below which would work for any file. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the server (i.e. on machine "server.com"):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename srv socket ":5100" server;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile srv;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;file "/srvpath/myCopiedBinaryFile.bin";&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;On the client&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename client socket "server.com:5100";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile &lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;/clipath/myOriginalBinaryFile.bin";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;input; /*The input here should ideally read the whole file*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;file client;&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There a options for file type (A or B) and fixed length, streaming and others, but I have not managed to make it work, I don't even know if it is at all possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 12:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/filename-socket-to-exchange-binary-files/m-p/199756#M37340</guid>
      <dc:creator>franz</dc:creator>
      <dc:date>2015-06-04T12:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: filename socket to exchange binary files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/filename-socket-to-exchange-binary-files/m-p/322414#M71327</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If over a client/server SAS connection why not to use the proc download/upload procedure with the BINARY option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More on download procedure here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/viewer.htm#prcd.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/viewer.htm#prcd.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 15:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/filename-socket-to-exchange-binary-files/m-p/322414#M71327</guid>
      <dc:creator>Daniel-Santos</dc:creator>
      <dc:date>2017-01-04T15:13:19Z</dc:date>
    </item>
  </channel>
</rss>

