9.36 DEFINE_ANY_SERVER

Note: Built-In Function Rules     Usage Options

Defines the details of a LANSA system that is to be used as a Server.

The definition details are not persistent and only exist while the LANSA environment remains active.

The time taken to define a server is minimal.

Platform Considerations

IBM i Server

This Built-In Function must be used for I/O commands to RDMLX files or to call an RDMLX function on the server. It may also be used instead of DEFINE_OS_400_SERVER to access non-RDMLX objects, if they have been recompiled since enabling the partition for RDMLX.

If the partition has not been enabled for RDMLX or the non-RDMLX objects have not been recompiled, DEFINE_OS_400_SERVER must be used to access non-RDMLX objects.

Other Servers

Either this Built-In Function or DEFINE_OTHER_SERVER may be used to access any object on the server.

Arguments

No

Type

Req/Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

SSN (Server Symbolic Name) This is the name that will be used in all future references to this server by this and other RDML functions.

1

10

 

0

2

A

Req

LU Partner Name

1

20

 

0

3

A

Req

Ignored on non-IBM i Servers (Always Y)
Y or 1 - Start commitment control on the server. Once this server is connected it will receive a "commit" or "rollback" request whenever the client issues an RDML level COMMIT or ROLLBACK command.
other - do not use commitment control

1

1

 

 

4

A

Opt

X_RUN exceptional arguments.

1

256

 

0

5

A

Opt

Divert LOCK_OBJECT requests to this server.
If this option is used all subsequent LOCK_OBJECT requests will be diverted to this server. Multiple servers will receive the same LOCK_OBJECT request if multiple servers have this option enabled concurrently.
In such cases, a lock must be granted on all participating servers for the LOCK_OBJECT to complete normally. Where one server fails to grant the lock an UNLOCK_OBJECT request is made to all servers that have already granted the object lock.

Note that *AUTONUM, *AUTOALP, and *DTAssslllxxxxxxxxxx system variables are also retrieved from the server if locks are diverted to the server. Refer to *AUTONUM and *AUTOALP System Variables (Data Areas) and *DTASSSLLLXXXXXXXXXX System Variables (Data Areas) in the LANSA Application Design Guide.

Y or 1 - Divert LOCK_OBJECT requests.

Z - Divert LOCK_OBJECT requests and also divert authority checking requests to this server (only one server should be nominated as the diversion target for authority checking requests).

R - Route lock requests AND authority requests AND repository data requests (if not found locally). Refer also to the Notes of the X_RUN parameter PSRR.

Other- do not divert LOCK_OBJECT requests.

The default value is Z.

1

1

 

0

6

A

Opt

Show "Please Wait" message while connecting.
Y or 1 - Show wait message.
Other - do not show message.
Default value is Y.

1

1

 

0

7

A

Opt

Ignored on non-IBM i Servers
Execution priority. Default value is '20'. Specify other values as per the IBM i command CHGJOB parameter RUNPTY. User should be authorized to change to the nominated value.

1

2

 

 

8

A

Opt

Ignored on non-IBM i Servers
Client-to-Server conversion table name to be used. No library name can be specified Defaults to *JOB, meaning the translation table will be generated based on the client code page and the IBM i server job's CCSID.
If this argument is *JOB then the Server-to-Client table must also be *JOB.

1

10

 

0

9

A

Opt

Ignored on non-IBM i Servers
Server-to-Client conversion table name to be used. No library name can be specified. Defaults to *JOB, meaning the translation table will be generated based on the client code page and the IBM i server job's CCSID.
If this argument is *JOB then the Client-to-Server table must also be *JOB.

1

10

 

0

 

Return Values

No

Type

Req/Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return Code:
OK - Server Defined

2

2

 

0

 

Technical Notes

   Do this before launching into any large-scale design or development project.

Notes on Commitment Control

A Note on Error Handling

It is very strongly recommended that you avoid building complex error handling schemes into your applications. Use a very simple trap like this at all levels of your application:

if (#retcode *ne OK)

    abort msgtxt('Failed to .............................')

endif

Let the standard error handling built into every generated application, take care of the problem. Situations have arisen where user defined error handling logic has become so complex as to consume 40 - 50% of all RDML code (with no obvious benefit to the application). Do not fall into this trap.

DBCS Considerations

When the server is indicated as being DBCS capable an additional translation table must be locatable on the client PC.

This table must be named X_CT<language code>.DAT and must be located in the X_LANSA\EXECUTE directory.

A version of this table named X_CTJPN.DAT for <language code> "JPN" (Japanese) is available to all Japanese customers.

This translation file contains the following notes:

Separate values with a single comma (,) only.