Date: Tue, 23 Jun 2009 05:43:06 -0700
Reply-To: feenberg <feenberg@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: feenberg <feenberg@GMAIL.COM>
Subject: Re: Read/write access to a Socket
Content-Type: text/plain; charset=ISO-8859-1
On Jun 22, 8:23 pm, snoopy...@GMAIL.COM (Joe Matise) wrote:
> I wonder if the problem could be resolved by using two different filenames
> for the same 'file'. I can't test that easily right now, but I think it
> believes you're updating due to identical filenames, even though you didn't
> specify sharebuffers.
Tried that - doesn't help. This would open two separate paths, and the
return path wouldn't be known to the echo server.
> You could use two datasteps also to do it, of course, or I wonder if you
> could do it using a data step object?
Two data steps would have the same problem as above, I am unfamiliar
with data step objects, but looking at the documentation, it would
appear likely the same problem would occur.
I did find some more information on the SAS website, but in a rather
confusing. In a paper by Gleason and Yu
(http://www2.sas.com/proceedings/sugi24/Coders/p083-24.pdf) it is
that "As implemented in the SAS system a socket can be used only to
or receive, i.e. one direction only." The SAS documentation doesn't
contradict this claim, but it is contradicted by the other
proceedings paper (below) and my recent experience. Gleason and Yu
two sockets, and the server has to be informed of the number of the
receiving socket on the client, which requires a customized server,
and wouldn't work with the servers typically provided for TCP/IP
or through the typical firewall that requires clients to establish
At least I learned I wasn't making a silly mistake.
> On Mon, Jun 22, 2009 at 7:06 PM,feenberg<feenb...@gmail.com> wrote:
> > I've been experimenting with filename I/O using sockets, and found
> > that there seems to be a difficulty when one writes to a socket before
> > reading from it. For example this job writes a line to the "echo" port
> > of a system, and wants to read it back from the same port.(Yes, the
> > echo port is working on this system). :
> > filename echosock socket 'nber3.nber.org:7';
> > data;
> > file echosock; put 'stuff to echo';
> > infile echosock; input;
> > file log; put _infile_;
> > run;
> > Even before the socket is opened, SAS generates an error message:
> > ERROR: The FILE and INFILE statements are out of proper order for
> > update processing. The INFILE statement must be specified before the
> > FILE statement.
> > Of course I am not doing UPDATE processing (AFAICT). The documentation
> > for sockets is athttp://tinyurl.com/mz35ozbut it doesn't mention
> > anything about reading and writing to the same socket. I didn't
> > realize it was allowed until I read the Proceedings paper at
> >http://tinyurl.com/leqygcand while I can get those examples to work,
> > they always read a banner before writing to the socket. I have a
> > feeling the error message may just be overzealous error checking.
> > DanielFeenberg
> > 617-588-0343
> > feenb...@gmail.com