G32ALLOC Function

Purpose

Starts interaction with an API application running simultaneously on the local system.

Syntax

G32ALLOC

Description

The G32ALLOC function starts a session with an application program interface (API) application by sending a message to the g32_alloc system call indicating that the allocation is complete. The G32ALLOC function is a HCON API function that can be called by a 370 Assembler application program.

The G32ALLOC function is part of the Host Connection Program (HCON).

The G32ALLOC function requires one or more adapters used to connect to a mainframe host.

Return Values

This call sets register 0 to the following values:

Value Description
> 0 Indicates a normal return or a successful call. The value returned indicates the maximum number of bytes that may be transferred to an operating system application by way of G32WRITE or received from an operating systems application by way of G32READ.
< 0 Indicates less than 0. Host API error condition.

Examples

The following 370 Assembler code example illustrates the use of the host G32ALLOC function:

L R11,=v(G32DATA)
USING G32DATAD,R11
G32ALLOC                 /* Allocate a session */
LTR R0,R0
BNM OK                   /* Normal completion  */
C  R0,G32ESESS           /* Session error      */
BE SESSERR
C  R0,G32ESYS            /* System error       */
BE SYSERR
.
.
.