Query Sessions (10)

Top  Previous  Next

The Query Sessions function returns a 16-byte (12-byte for standard interface) data string describing each host session.

 

3270

5250

Yes

Yes

 

 

Prerequisite Calls

 

There are no prerequisite calls for this function.

 

 

Call Parameters

 

Function

Description

 

 

Standard Interface

Enhanced Interface

Function Number

Must be 10

 

Data String

Preallocated string of 16n bytes long (12n for 16-bit) (n =number of sessions) or more

 

Length

12n bytes

16n bytes

PS Position

NA

 

 

Note:

When the length is not matched to the number of sessions, the return code is 2.

 

 

Return Parameters

 

This function returns a data string, a length, and a return code.

 

Data String

 

The returned data string is 16n bytes long (12n for standard interface), where n is the number of host sessions. The descriptors are concatenated into the data string and each session type, and presentation space size of a host session.

 

The format of each 16-byte (12-byte for standard interface) session descriptor is as follows:

 

Byte

 

Definition

Standard

Enhanced

 

1

1

A 1-character presentation space short name (PSID)

 

2-4

Reserved

2-9

5-12

Session long name (same as profile name; or, if profile not set, same as short name)

10

13

Connection type H=host

 

14

Reserved

11-12

15-16

Host presentation space size (this is a binary number and is not in display format). If the session type is a print session, the value is 0.

 

Length

 

The number of host sessions started.

 

Return Code

 

The following codes are defined:

 

Return Code

Explanation

0

The Query Sessions function was successful.

2

An incorrect string length was made.

9

A system error was encountered.

 

 

Remarks

 

1.If an application program receives RC=2 or RC=0, the number of the active sessions is returned in the length field. The application program can recognize the minimum string length by this number.
2.The Query Sessions function is affected by the CFGSIZE/NOCFGZISE session option and by the EXTEND_PS/NOEXTEND_PS option.