LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 9 Jul 2010 13:33:39 -0500
Reply-To:   Kevin Myers <kmyers1@CLEARWIRE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Kevin Myers <kmyers1@CLEARWIRE.NET>
Subject:   SAS Communication with VB.Net Application Using Named Pipes
Content-Type:   text/plain; charset="iso-8859-1"

I am trying to get SAS to communicate with a VB.Net application using two separate named pipes. One of the pipes is used for sending data from SAS to the VB application, and the other one is used to send data from the VB application back to SAS. One the two named pipes is connecting properly, but I can't get the other one to connect. In this scenario, the VB application is acting as the server for both named pipes, while SAS is acting as the client.

Here is the SAS filename statement for the named pipe that connects ok:

filename SASOut namepipe "\\.\pipe\SASOut" client noblock byte;

That is followed later by:

proc printto log=SASOut; run;

Which works fine.

Here is the corresponding code on the VB.Net side that works ok:

Dim pipeSASOut As New NamedPipeServerStream("SASOut", PipeDirection.InOut, 1, PipeTransmissionMode.Byte) Console.WriteLine("SAS output NamedPipeServerStream object created.")

Console.WriteLine("Waiting for SAS output client connection...") pipeSASOut.WaitForConnection() Console.WriteLine("SAS output client connected.")

Now here is the SAS filename statement for the named pipe that I'm having trouble with:

filename SASIn namepipe "\\.\pipe\SASIn" client noblock byte;

That is followed later by:

%let SASIn=%sysfunc(fopen(SASIn,I)); %put SASIn=&SASIn;

%do %while(%sysfunc(fread(&SASIn)) = 0); %let RecLen=%sysfunc(frlen(&SASIn)); %put RecLen=&RecLen; %let RC=%sysfunc(fget(&SASIn,Statements,&RecLen)); %put Statements=&Statements; &Statements %end;

%let RC=%sysfunc(fclose(&SASIn)); %put RC=&RC;

And here is the corresponding VB.Net code: Dim pipeSASIn As New NamedPipeServerStream("SASIn", PipeDirection.Out, 1, PipeTransmissionMode.Byte) Console.WriteLine("SAS input NamedPipeServerStream object created.")

Console.WriteLine("Waiting for SAS input client connection...") pipeSASIn.WaitForConnection() Console.WriteLine("SAS input client connected.")

In the console log from the VB.Net application, the first "SAS output client connected" message is received (along with SAS log output via proc printto), but the second connection attempt never proceeds beyond "Waiting for SAS input client connection."

Can anyone see what I'm doing wrong? Doesn anyone know how to fix this?

Thanks, Kevin M.


Back to: Top of message | Previous page | Main SAS-L page