Chapter Contents

Previous

Next
_open

_open



Bind to a same-named interface instance in another SAS session.


Syntax
Example

Syntax

CALL SEND(cnctionInst, '_open', stationInst,
connection_name, rc);

Where... Is
type...
And represents...
stationInst N successfully opened station instance
connection_name C connection name (destination)
rc N return code

When invoked on a Cnction instance, _open creates a duplex message channel between the bound session instances, which enables point-to-point messaging. The user is responsible for obtaining the instance of the Cnction class, and then sending the _open method to it. After opening, the active connection can send and receive stateless, free-form messages.

A station interface instance should have already been opened, and should be passed in as the stationInst. In order for the Cnction _open to be successful, the station instance names that are used to create the station instance must be the same in both SAS sessions. If the station names do not match, the Cnction _open fails.

The connection_name designates the destination; it may be network qualified or moniker based. The supported syntax is

[protocol]//[network node]
   /[network resource identifier]
or
[domain]:[moniker]

Note:   Not all qualifiers are required.  [cautionend]

For example, the specification: tcp//host1/shr1 defines the communications access method as TCP/IP, the host node as HOST1 and the service as SHR1. If the protocol qualifier is omitted, the default COMAMID setting is used. If the network node qualifier is omitted, the binding is LOCAL.

The rc return code will be non-zero if an error is encountered during the open. Use SYSMSG() to determine the exact error message.


Example

This example binds to the same-named station interface (DMMAPPL) in another SAS session, designated by the service "/SHR1". No network node is provided on the connection name, so the binding is LOCAL, that is, both SAS sessions are on the same host. In addition, no protocol qualifier was provided on the connection name, so the default COMAMID setting is used.

   /* create and open station instance */
stationid = loadclass('sashelp.connect.station');
stationObj = instance(stationid);
call send(stationObj, '_open', "DMMAPPL", rc);

   /* open connection */
cnctionid = loadclass('sashelp.connect.cnction');
cnctionInst = instance(cnctionid);
call send(cnctionInst, '_open', stationObj, 
          "/shr1", rc);


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.