Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

CALL interface for DIV

Adapter Window Services can be used in some high-level programming languages to invoke DIV functions from programs via a CALL interface. These programming language are:

  • COBOL (Version 2.0 onward)

  • FORTRAN (Version 2.2 onward)

  • PL/1 (Version 4.1 onward)

  • C (Version 2.0 onward)

ILCS linkage is required in order to call DIV functions via a CALL interface.
When programs in COBOL, FORTRAN and C are compiled, the ICLS linkage is provided by default. If PL/1 programs are compiled, an appropriate compiler option must be set.

A special feature must be noted for programs written in C: pointers to data elements must be passed, not the data elements themselves (“call by reference” passing in C).

The semantics of data types in the programming languages indicated above varies widely. The following table lists the data types for which the data representation in the above languages is identical, so that they can be passed as parameters without problems to the extent that is required when calling Window Services.

Data types from programming languages that can be passed as parameters for DIV:

Compiler

Data type binary word

Data type string

PL/1

BIN FIXED (31)

CHAR (i)

COBOL

PIC S9(i) COMP
(i = 5,...,9)

USAGE DISPLAY

C

long

char <var>

FORTRAN


INT * 4

(<size> )
CHAR * i

The Adapter Window Services are supplied as a runtime library (OML) in a file called SYSLIB.DWS.110 under the system administrator ID TSOS.

When DIV is invoked from the Window Services, not all DIV functions are available fully.

  • Windows cannot be located in a data space when using Window Services (SPID is dropped).

  • The LOCVIEW=MAP function does not exist for Window Services.

  • RELEASE=YES (in the RESET function) is not supported by Window Services.

  • In the case of sequential processing, instead of the option of specifying the number of pages to be read (PFCOUNT) in advance, only the sequential access (USAGE) is indicated for Window Services.
    USAGE='RANDOM' has the same effect as PFCOUNT=0,
    USAGE='SEQ' is mapped to PFCOUNT=15.

  • Only the main code is available as a return code.

CALLs

A number of different parameters must be passed when the corresponding functions are called (with CALL). The following table shows a summary of all possible values.

Field name

Data type
PL/1 environment

Brief explanation

DISPOS

CHAR(6);

/* for function=MAP: 'OBJECT' 'UNCHNG'

/* for function=UNMAP: 'UNCHNG' 'FRESH

DMS_CODE

BIN FIXED (31);


FILENAME

CHAR(54);


ID

CHAR (8);

* ID of the OPEN,

/* (output parameter)

LINKNAME

CHAR(8);


OFFSET

BIN FIXED (31);


OPEN-MODE

CHAR(5);


RETURNCODE

BIN FIXED (31);

/* 'INPUT' INOUT' 'OUTIN'

SHARUPD-MODE

CHAR(4);

/* 'NO' 'WEAK' 'YES'

SIZE

BIN FIXED (31);


SPAN

BIN FIXED (31);

/* file size,

/* (output param)

USAGE

CHAR(6);

/* ' RANDOM' ' SEQ'

WINDOW

AREA(1) BASED ...;

/* aligned on page

/* boundary !!

All CALLs for the individual DIV functions (in PL/1) are listed below. The parameters to be specified in each CALL are shown in the individual CALLs.

DIV function OPEN

CALL DWSOPEN (LINKNAME, FILENAME, OPEN-MODE, SHARUPD-MODE,ID, SIZE, RETURNCODE, DMS-CODE);

DIV function MAP

CALL DWSMAP (ID, OFFSET, SPAN, WINDOW, USAGE, DISPOS, RETURNCODE); 

DIV function SAVE

CALL DWSSAVE (ID, OFFSET, SPAN, SIZE, RETURNCODE);

REFRESH function (equivalent to the function 'RESET')

CALL DWSREFR (ID, OFFSET, SPAN, RETURNCODE);

DIV function UNMAP

CALL DWSUNMP  (ID, OFFSET, SPAN, WINDOW, DISPOS, RETURNCODE);

DIV function CLOSE

CALL DWSCLS (ID, RETURNCODE, DMS_CODE);