General Use Assembler Macros and Modules

This section describes the assembler macros, modules, and programs provided with INCONTROL products. Each macro, module, or program is described in detail in alphabetical order.

CTMCOD Assembler Macro

The CTMCOD macro performs the following functions:

  • extracts a code block from the MIT/MIC codes area

  • writes a modified code block back into the MIT/MIC codes area

  • adds a new code to the MIT/MIC codes area

Shown below are the environmental factors required for proper operation of the CTMCOD assembler macro:

  • The CTMBCOD data area must be addressable to the program issuing the CTMCOD macro.

  • Before invoking the CTMCOD macro, the issuing program must be in AMODE 31.

Syntax

CTMCOD Assembler Macro

Copy
name                   CTMCOD <function>
   ,CODE=requested code type                                   
   ,CONTIG=[Y/N]                                               
   ,MIT=address of MIT
   ,MCT=address of MCT
   ,NOTOK=label
   ,OK=label

Parameters

Table 316 CTMCOD Parameters

Parameter

Description and Values

name

Symbolic name. The name, if specified, must begin in column 1.

CTMCOD

Keyword CTMCOD. One or more blanks must precede and follow the CTMCOD keyword.

function

Valid values:

  • INIT - Initializes the search for a specific code. It must be issued when a new code type is searched for, or when starting a search of the codes area (when no specific code is requested). It does not actually extract the first code of the requested type.

  • GETNEXT - Extracts the next instance of the requested code, or, if no specific code is requested, the next code of the job. The extracted code is placed in field CODOUTC of data area CTMBCOD.

  • PUT - Writes a modified code back to the MIT/MIC codes area. The code to be written back must be extracted through the INIT or GETNEXT function, and remain in field CODOUTC of data area CTMBCOD. The code's ID and length must not be modified. The PUT invocation must immediately follow the INIT or GETNEXT invocation.

  • ADD - Adds a code to the end of the job's MIT/MIC code area. The code to be added must be placed in field CODOUTC of data area CTMBCOD. The code is only added if there is enough free space in the job's MIT/Miss concatenation.

,CODE=code

Specifies the type of code requested from INIT or GETNEXT functions. Optional. If omitted, no specific code type is requested.

,CONTIG=[Y|N]

Indicates if the job’s MIT/Miss reside in a contiguous storage area or are chained.

  • Y (Yes) - The job’s MIT/MICs reside in a contiguous storage area. Default.

  • N (No) - The job’s MIT/MICs are chained using a double-pointing method (i.e.,the first full word points to the previous record, the second full word points to the next record and the MIT/MIC itself starts after these pointers).

,MIT=mitaddr

MIT address of the job. Optional. If omitted, the MIT must be addressable.

,MCT=mctaddr

MCT address of the job. Optional. If omitted, the MCT must be addressable.

,NOTOK=label

The address to branch to when the requested code was not found or the function has not completed successfully. Optional.

,OK=label

The address to branch to when the requested function has completed successfully. Optional.

Parameters NOTOK and OK are optional and mutually exclusive.

Output Register Information

When control returns to the caller from CTMCOD, the general purpose registers (GPRs) contain the following values:

Table 317 Output Register Information

Register

Contents

0

Unchanged

1

Used as a work register by CTMCOD

2–13

Unchanged

14

Used as a work register by CTMCOD

15

Contains the CTMCOD return code

Return Codes

Table 318 Return Codes from the CTMCOD INIT Function

Return Code

Meaning

0

Successful completion

8

Requested code does not exist

20

Severe error

Table 319 Return Codes from the CTMCOD GETNEXT Function

Return Code

Meaning

0

Successful completion

8

No more codes of requested type exist. If no specific code type was requested, the end of codes was reached

20

Severe error

Table 320 Return Codes from the CTMCOD PUT Function

Return Code

Meaning

0

Successful completion

8

Code ID or length modified

20

Severe error

Table 321 Return Codes from the CTMCOD ADD Function

Return Code

Meaning

0

Successful completion

8

Not enough free space for new code

20

Severe error

Table 322 User Abends

User Abend Code

Meaning

0009

Pointer to module CTMCOD (in MCT) is not initialized

For an example of how to use the CTMCOD, see Sample Exit CTMX002H in the IOA SAMPEXIT library.

CTMCOD Programming Techniques

You can use the following programming techniques when working with the CTMCOD macro:

  • You may need to update a certain code in the MIT after reading some other codes. For example, you must update MITCCPRE, the number of code values in an ON statement, after reading and counting all the code values in that block.

    To do this, save CTMBCOD fields CODPREVC, CODPREVL, and CODAMIC after reading the code to be updated, and then restore those values before the code is updated.

    The following sample code illustrates this technique:

    Copy
       CTMCOD GETNEXT,CODE=MITCCPRE
       MVC        KEEPPREC,CODPREVC
       MVC        KEEPPREL,CODPREVL
       MVC        KEEPAMIC,CODAMIC

    (read and process other codes)

    Copy
       MVC        CODPREVC,KEEPPREC
       MVC        CODPREVL,KEEPPREL
       MVC        CODAMIC,KEEPAMIC
       CTMCOD  PUT

    CODPREVC contains the address of the code that was read by CTMCOD GETNEXT. CODPREVL contains the length from this address until end of the MIC. CODAMIC contains the address of the MIC where the code resides. All these fields are used by CTMCOD PUT in order to locate the requested code and replace it with the value in CODOUTC.

  • Programs that must read codes starting from a certain code, after other codes have been read and/or added, should also keep (and then restore) the values of fields CODCURRC and CODCURRL after the issuance of CTMCOD GETNEXT. These fields contain the address of the next code to be read after a code has been read, and the length from that address to the end of the MIC.

  • When CTMCOD is used in a loop (for example, to go over all the codes of a certain type in a job), and for each loop iteration CTMCOD is used for other purposes, the following fields in CTMBCOD must be saved after the main loop's GETNEXT and restored after the internal CTMCODs:

    • CODPREVC

    • CODCURRC

    • CODPREVL

    • CODCURRL

    • CODAMIC

    • CODFUNC

IOAENV Assembler Macro

The IOAENV macro initializes the IOA environment by performing the following functions:

  • Locate an area for the MCT and builds member IOAPARM into it.

  • Provide parameters for dynamic allocation.

  • Optionally build requested xxxPARMs.

  • Optionally build requested xxxPLEXs.

  • Optionally open LOG or LOG-in-Memory.

  • Optionally initialize the messages environment, optional wishes environment, and trace options.

Syntax

The standard format of the IOAENV macro is shown below.

Syntax for IOAENV Macro

Copy
=============================================================================                                                    
name    symbol. Begin name in column 1. One or more blanks must precede IOAENV
IOAENV  One or more blanks must follow IOAENV
=============================================================================
INIT                          Build MCT.
SERV[,MCTADDR=field]          Add services/xxxPARMs.
REFR[,MCTADDR=field]          Refresh xxxPARM (except IOAPARM). Delete the loaded xxxPARM and load it again.
TERM[,MCTADDR=field]          Delete all loaded xxxPARMs and terminate all initialized services.
                              If MCTADDR is omitted, then we assume to have addressability for the MCT.
                              Note:  Only one MCT is handled by the macro. If it does not exist,then one is built.
,PARMS=     p                 Parameter letter.
           (p1,p2,..,pn)      Parameter letters.
           area               An area within the program that contains pairs of parameter letter and parameter suffix. For example:
                              area DC C’M3D5R8’,X’FF’
                              (use CTMPARM3; CTDPARM5; CTRPARM8)
                              Note: Each xxxPARM is loaded (with IOALDPRM) and it’s address is saved in the MCT. For IOA, CTM,
                              CTD, CTR and ECS the fixed part of the loaded xxxPARM is copied to the MCT.
,PLEX=      p                 xxxPLEX letter.
            (p1,p2,..,pn)     xxxPLEX letters.
            area              An area within the program that contains pairs of plex letter and plex suffix.
                              Note Each xxxPLEX is loaded (with IOALDPRM) and it’s address s saved ina table of addresses. 
                             The address of this table is saved in MCTPLEXT field.    
,CMEM=     YES/NO   If CMEM=YES then CMMPARM is loaded if Control‑O is NOT installed
,MSG=      YES/NO             Initialize the messages environment.
,WISH=     YES/NO             Initialize the optional wishes environment.
,TRACE=    YES/NO             Initialize trace options.
,LOG=      NO                 LOG not required.
           LOG                Open LOG.
           CHN                Open LOG-in-MEMORY for 500 records.
,MCT=      Rx                 Default: R12
                              NONE Unless MCT=NONE is coded, on return from INIT function the following commands are generated:
                              LR Rx,R1
                              USING MCTSTART,Rx
,LOC=      BELOW/ANY          Where all the GETMAIN(s) needed for the services will be done
,ERRET=    label              Label of error routine (see return codes).
                              If ERRET is omitted, an ABEND will be used.
,DUMP=     YES/NO             Isssue IOADUMP macro.
                              This macro issues ESTAE and prints mini-dump at ABEND time.
,ALLOC=                       (a1,a2,..,an) List of Allocation Member Names.
,FREE=                        (f1,f2,..,fn)List of Allocation Member Names.
,SP=       sp                  A one byte area containing the subpool number
                               If omitted, the default (132) is used
,RAREA=    area                Support area for PARMS/PLEX in reentrant programs.

Output Register Information

Table 323 Output Register Information

Register

Description

R1

MCT address.

R15

Return Codes

0 -- OK, all requests honored.

8 - Error. Message was issued. TERM is required.

12 - Severe Error. Message was issued. Skip TERM.

16 - LOAD for IOAENV failed. Skip TERM.

Extracting only the MCT address

If you want to extract only the MCT address, and do not require any other IOAENV functionality of the INIT function, use the GETMCT macro. GETMCT does not increase the use count of the IOAENV token.

The GETMCT macro has the following syntax:

GETMCT MCTREG=[register | NONE]

The MCTREG value determines the following behavior:

  • MCTREG=NONE returns the MCT address in R1.

  • MCTREG=register generates a USING statement, and the register will contain the MCT address.

The following return codes are available in R15:

Return Code

Meaning

0

MCT address obtained

8

MCT not found

IOAMEM Assembler Macro

The IOAMEM Assemble Macro module is a general purpose library– and member–handling program that can handle fixed or variable-length format libraries (of any record length). It transfers information from the library or member to memory, and back.

IOAMEM uses dynamic allocation, so usually no pre-allocation is required. However, IOAMEM can work on pre-allocated DD statements also, in which case the DD statements must be concatenated.

General Description

The IOAMEM module attributes are

Copy
RENT, AMODE=31 RMODE=24

Upon entry, the value of AMODE is saved. AMODE is set to 31 to handle addresses above the 16MB line. Upon return, the original value of AMODE is restored.

Storage for the handler is obtained below the 16 MB line and is saved in the handler address. The caller must not modify the handler address between the first call and the FINISH request call to module IOAMEM.

The handler address is returned in field IMHNDLR, which is mapped by macro IOAMMEM.

When invoking macro IOAMEM with parameter HANDLE=addr, the field that contains the handler address is not modified by macro IOAMEM. If more than one handler is used in the same program, save the handler address and invoke macro IOAMEM with the proper handler address in parameter HANDLE=addr.

It is not necessary to provide a buffer address for GETMEM, DIRECTOR, DIRALL, and DIRFULL requests.

If the buffer address is not passed (field value is zero), module IOAMEM obtains storage above or below the 16MB line. The number of records in the storage buffer is determined as follows:

  • If field RECNUM (IMRECNUM) is not zero, then the number of records is the value in field RECNUM (IMRECNUM).

  • If field RECNUM (IMRECNUM) is zero, then the default number of records is 5000.

The actual buffer size is the number of records in the buffer times the LRECL of the input dataset, plus 16 bytes for the header.

Module IOAMEM does not free any buffer the caller uses. If module IOAMEM obtains a storage buffer address on behalf of a caller, the caller must free this storage. The caller can free the buffer by using macro IOAXAGR. Field IMBUFARD points to the real buffer address + 16 bytes. The length of the buffer is in offset 4 from the beginning of the header.

If the buffer address is passed (field value is not zero), IOAMEM treats the value of IMRECNUM as the actual buffer size (in records). Therefore, to prevent storage protection violations, do NOT specify a value of IMRECNUM that exceeds the actual buffer size (in records).

If the buffer address is passed (field value is not zero) and the buffer size is insufficient, module IOAMEM ends with a return code of 08 and a reason code of 24. The actual number of records the member contains is returned in field IMRECNUM.

If the buffer address is not passed (field value is zero), module IOAMEM returns with a buffer that contains the entire member. The number of records in the buffer is returned in field IMRECNUM.

Macro IOAMEM checks whether parameter IOAMEMA has been supplied. If this parameter has been supplied, macro IOAMEM uses the supplied address. Otherwise, macro IOAMEM loads the IOAMEM module before invoking it and deletes it upon return.

GETMEM, GETLINE and PUTMEM requests support reading and writing members with record lengths other than 80 bytes. The GETLINE request can read members with variable record lengths.

The DIRECTOR, DIRALL, and DIRFULL functions accept a member name in the MEMBER sub-parameter of the IOAMEM macro. The member name may include masking characters. For example

Copy
MEMBER==CL8’*’

All members are included in the directory list (the same as a null MEMBER= parameter or MEMBER=0)

Copy
MEMBER==CL8'A?*'

All members that begin with the character A and have a total length of at least 2 characters are included in the directory list.

The DIRALL request provides similar functionality as the DIRECTOR function and additionally supports concatenated files for the given DD name. When DIRECTOR is used, each buffer entry length is 11 bytes — 8 bytes for the member name, and 3 bytes for the TTR. When DIRALL is used, each buffer entry length is 52 bytes — 8 bytes for the member name, and 44 bytes for the library name in which the member exists.

The FINISH request cleans up the environment, closes all opened DCBs, and frees all I/O buffers and the handler storage.

Module IOAMEM must be called with a FINISH request. Otherwise, some DCBs may remain open and some storage buffers may remain allocated.

When trying to access a DFHSM migrated dataset, IOAMEM will behave as follows:

  • If the RECALL parameter was set to YES, access will be done with an automatic recall (all address spaces will wait until the dataset is recalled), and no further action will be required by the caller.

  • If the RECALL parameter was set to NO (default), IOAMEM will decide what to do based upon the MCTENV flag. Note that the MCT address must be passed to IOAMEM (MCTADDR parameter).

    • If MCTENV is MCTENVSE (IOA online monitor) or MCTENV1 is MCTENVAS (IOA application server), then IOAMEM will submit a RECALL request to DFHSM and will return to its caller with RC=4 RSN=8 (see details of codes below). If, for some reason, the request fails, the regular RC is returned (RC=16 RSN=32).

    • If MCTENV is MCTENVON (IOA online session) or MCTENV is MCTENVKS (KSL environment) or MCTENV2 is MCTENVBU (CONTROL-B batch utilities), the behavior will be the same as if the RECALL parameter was set to YES, even when it was set to the default (NO).

The parameter list passed to IOAMEM is mapped by the IOAMMEM macro as follows:

Table 324 Mapping of Parameter List by IOAMMEM Macro

Type

Field Name

Input/Output Fields

Length

In

IMREQ

Request/Function

CL8

In/Out

IMHNDLR

Handler address

AL4

In/Out

IMBUFADR

Buffer address

AL4

In/Out

IMRECNUM

Buffer size in records unit

AL4

In

IMFRMREC

Read from record number

AL4

In

IMMCTADR

MCT address

AL4

In

IMDSNAME

Dataset name

CL44

In

IMMEMBER

Member name

CL8

In

IMDDNAME

DD name

CL8

In

IMUSERID

User ID

CL8

In

IMBUFFMT

Buffer format

CL1 Vector/Double pointers

In

IMACT

Action for PUTMEM

CL1 Add/Replace

In

IMISPFS

ISPF statistics

CL1 Yes/No/Blank

In

IMBFLOC

Buffer location

CL1 Above/Below

In

IMESTAE

ESTAE

CL1 Yes/No

In

IMDUMP

DUMP when ESTAE is yes

CL1 Yes/No

Out

IMRC

Return code

AL2

Out

IMRSN

Reason code

AL2

Out

IMLRECL

LRECL of dataset

AL2

Out

IMBLKSIZ

Blocksize of dataset

AL2

Out

IMRECFM

RECFM of dataset

CL2

Out

IMDSORG

DSORG of dataset

CL2

Out

IMABENDC

Abend code

CL10

Table 325 Return Codes and Reason Codes

RC

RSN

DIRFULL

DIRECTOR/DIRALL

DELMEM

MEMSTAT

00

00

OK

OK

OK

OK

04

 

00

       

04

   

Requested member does not exist in dataset

 

08

00

Directory list is empty

Directory list is empty

Member name has not been supplied

Same

04

Dataset is not PDS or PDSE

Same

Same

Same

08

Insufficient storage GETMAIN failed

Same

Same

Same

12

OPEN for dataset failed

Same

Same

Same

16

     

 

20

     

Member does not exist

24

Buffer is full Actual number of records returned

Same

   

28

   

ENQ failed

 

32

The dataset is migrated and a RECALL request has been submitted to HSM

Same

Same

Same

12

Reason code from STOW

   

STOW for DELETE failed

 

Table 326 Return Codes and Reason Codes (GETMEM, GETLINE, PUTMEM)

RC

RSN

GETMEM

GETLINE

PUTMEM

00

00

OK

OK

OK

04

 

00

 

End of file reached

 

04

   

Replace was specified for a non-existing member, changed to Add

08

00

Member name has not been supplied

Same

Same

04

Dataset is not PDS or PDSE

Same

Same

08

Insufficient storage GETMAIN failed

Same

Same

12

OPEN for dataset failed or
RDJFCB failed

Same

Same

16

RECFM is not F or FB

 

Same

 

Requested member does not exist

Same

Add was specified for an existing member

 

Buffer is full Actual number of records returned

   
     

ENQ failed

 

The dataset is migrated and a RECALL request has been submitted to HSM

Same

Same

12

Reason code from STOW

   

STOW for ADD/REPLACE failed

Table 327 Return Codes and Reason Codes (ALLOC, DEALLOC)

RC

RSN

ALLOC

DEALLOC

RECALL

00

00

OK

OK

The request has been submitted

04

00

 

DDNAME is not allocated

 

08

00

DDNAME is already allocated

   

04

 

 

The environment is not authorized to issue SVC 34

08

 

 

Unable to obtain storage for ARCHSEND macro, total length required is 54+200 bytes below the 16 MB line

32

The dataset is migrated and a RECALL request has been submitted to HSM

   

16

RC

   

RC is the return code from ARCHSEND macro

Table 328 Return Codes, Reason Codes and Descriptions

RC

RSN

Description

16

00

Unknown request type

04

Neither dsname nor ddname have been supplied

08

Requested dataset is not cataloged

12

Dynamic allocation failed for the requested dataset

16

ESTAE caught an ABEND

20

The requested DSNAME is not in the concatenation of the given DDNAME.

24

Requested dataset does not exist on the volume pointed to by the catalog

28

Dynamic allocation/deallocaton failed for the requested dataset/ddname

32

Requested dataset is migrated by HSM

Table 329 Return Codes and Reason Codes from Librarian/Panvalet

RC

RSN

All functions

20

04

EOD reached

08

Open failed for Librarian/Panvalet dataset

12

Member not found

16

Read record error

Function Codes

The following function codes are supported by the IOAMEM module:

Table 330 Function Codes Supported by IOAMEM Module

Function Code

Description

INIT

Set up the handler (optional).

DELMEM

Delete an existing member.

DIRECTOR

Retrieve the directory entry for a given dataset.

DIRALL

Retrieve the directory entries for a given PDS or concatenation of PDSs.

DIRALL and DIRECTOR differ only in that DIRALL supports concatenated datasets in a DDname. DIRECTOR returns a buffer entry length of 11 bytes, 8 bytes for the member name and 3 bytes for the TTR, whereas DIRALL returns a buffer entry length of 52 bytes, 8 bytes for the member name and 44 bytes for the DSName in which the requested member(s) exist.

DIRFULL

Retrieve the full directory to a buffer.

ENDLIBDE

Close the last input member processed.

FINISH

Close last member and deallocate the library.

GETLINE

Read a member line by line.

GETMEM

Get a whole member into a buffer.

INITMEM

Prepare a member for GETLINE request.

MEMSTAT

Retrieve ISPF statistics for a given member.

PUTMEM

Write a whole member to a library.

ALLOC

Allocates a dataset and returns the dataset values.

DEALLOC

Deallocate a specific DDNAME.

RECALL

Submit a request to DFHSM to RECALL a migrated dataset.

To map the parameter list, use the IOAMEM macro with the following format:

Copy
[name]    IOAMMEM DSECT=[ NO | YES ]

To invoke the IOAMEM module, specify the IOAMEM macro with the following parameters:

IOAMEM Macro Parameters

Copy
[name] IOAMEM request,    Request type
       HANDLE=,           Handler address
       BUFFADR=,          Buffer address
       RECNUM=0,          Number of records in buffer
       FROMREC=0,         Read from record number
       MCTADDR=0,         MCT address
       DSNAME=,           DSNAME
       MEMBER=,           Member name
       USERID==CL8'IOAUSER',
                          User ID
       BUFFRMT=V,         Buffer format
       ACTION=A,          Action for PUTMEM
       ISPFSTAT=Y,        ISPF statistics for PUTMEM
       BUFFLOC=A,         Buffer location
       ESTAE=Y,           ESTAE request
       RECALL=N,          If HSM migrated, do nothing
       DUMP=N,            DUMP option when ESTAE is yes
       IOAMEMA=,          Location of IOAMEM address
MF=[ L | E | (E,label) ]

Table 331 Parameter Explanation

Parameter

Description

Request

See the IOAMEM Macro Parameters code above.

HANDLE=addr

Address or register (2) ‑ (12) used as input and output

BUFFADR=addr

Address or register (2) ‑ (12) used as input and output

RECNUM=addr

Address or register (2) ‑ (12) or number used as input and output

FROMREC=addr

Address or register (2) ‑ (12)

MCTADDR=addr

Address or register (2) ‑ (12)

DSNAME=addr

Address or register (2) ‑ (12)

MEMBER=addr

Address or register (2) ‑ (12)

DDNAME=addr

Address or register (2) ‑ (12)

USERID=addr

Address or register (2) ‑ (12)

BUFFMT=value

V or D or address for GETMEM and PUTMEM only

ACTION=value

A or R or address for PUTMEM only

ISPFSTAT=value

Y or N or address for PUTMEM only

BUFFLOC=value

A or B or address

ESTAE=value

Y or N or address

RECALL=value

Y or N or address

DUMP=value

Y or N or address

IOAMEMA=addr

Address or register (2) - (12)

ENQ=value

N (none), P (partial), F (full – including member name)

Assembler Macro Module Examples

Copy
LOAD EP=IOAMEM ST R0,MEMADR
 
 IOAMEM GETMEM,
   DDNAME=0,    
               RECNUM=1000,                                        
               DSNAME==CL44'N22.LIB.CNTL',                           
               MEMBER==CL8'TESTX',                                   
               ESTAE=Y,                                              
               DUMP=N,                                               
               IOAMEMA=MEMADR,                                       
               MF=E,                                                 
               MCTADDR=0
 
         MVC   HANDLE,IMHNDLR save handler address
 
          IOAMEM GETMEM,                      
               HANDLER=HANDLE,                     
               BUFFADR=0,
               RECNUM=RECNUM,
               DDNAME=DDNAME,                                    
               DSNAME=DSNAME,                           
               MEMBER=MEMBER,                                   
               ESTAE=Y,                                              
               DUMP=N,                                               
               IOAMEMA=MEMADR,                                       
               MF=E,                                                 
               MCTADDR=0
 
HANDLE   DS      A  
DDNAME   DC     CL8’DD1’
DSNAME   DC     CL44’MY.DSNAME’
MEMBER   DC     CL8’MEMBER1’
RECNUM   DC     A(10000)

IOABSR Program

IOABSR is a general-purpose program that manages internal (that is, in-memory) tree-structured lists of keyed records. Every record consists of a variable-length key and a variable-length data field.

The IOABSR program performs very fast additions and updates of records in the tree, as well as extractions of records into a caller area. As the tree is kept balanced, the maximum path length to the target record requires checking log2N elements, where N is the total number of records kept in the tree.

You can use the IOABSR program, for example, in Control-M AutoEdit processing, where an AutoEdit variable name is used as the key and the value is the data.

IOABSR Attributes and Fields

The IOABSR load module attributes are

Copy
RENT, AMODE=31 RMODE=24

Upon entry, the value of AMODE is saved. AMODE is set to 31 to handle addresses above the 16MB line. Upon return, the original value of AMODE is restored.

Use the following call statement to invoke the IOABSR program:

Copy
CALL ioabsr,(interface_blk,function,key_length,data_length)

Table 331a Fields for Invoking the IOABSR Program

Field

Description

ioabsr

Defines the entry point to the IOABSR program.

interface_blk

Defines a 16-fullwords (16F) area, initialized to zeros.

This area must not be changed by the caller after the call is made.

Note the following positions:

  • The 2nd byte of 11th word is used as the subpool number if defined before the tree is created.

  • The 15th word contains the total number of records and is updated by the program after every successful call.

  • The 16th word contains a pointer to the internal tree descriptor and serves as a tree ID. The internal tree descriptor is placed into an area of 48 bytes that is getmained (above the line) during tree creation.

function

Defines the function to perform.

This field contains 4 characters. The following functions are available:

  • 'PUT ': Add a record to the tree or update a record (if the element with the defined key already exists).

    If the tree does not exist, the function first creates an empty tree (as done by INIT).

    If you have programs that call IOABSR asynchronously, serialization is required only if any caller requests the PUT (or CPUT) function.

  • 'CPUT': Conditional PUT. Add a record, but do not update a record if the key exists.

  • 'GET ': Get an element from the tree.

  • 'NEXT': Get the next element from the tree, and update the key and data fields according to the attributes of the retrieved element.

  • 'PREV': Get the previous element from the tree, and update the key and data fields according to the attributes of the retrieved element.

  • 'CHK ': Check for the existence of the element in the tree.

  • 'CNEX': Check for the existence of the next element in the tree.

  • 'CPRE': Check for the existence of the previous element in the tree.

  • 'FREE': Empty the tree. FREEMAIN all related areas, but keep the internal tree descriptor.

  • 'INIT': Create an empty tree (that is, an internal descriptor).

    If the tree already exists, empty the tree (same as FREE).

  • 'DEL ': Delete the tree along with its descriptor.

  • 'PBAL': Stop balancing the tree. This special function is designed for use by programs that call IOABSR asynchronously from environments where serialization is impossible (SVC not allowed).

key_length

Defines the key of the element in the format of a variable length record, as follows:

Copy
<key_length>    DS    H
<key_body>      DS    XL(max key_length)                        

<key_length> range for PUT/GET functions: 1–240

data_length

Defines the data of the element in the format of a variable length record, as follows:

Copy
<data_length>   DS     H
<data_body>     DS     XL(max data_length)             

<data_length> range: 0–254

IOABSR Return Codes

The following codes are returned in Register 15 (R15) and also in the first half of the 11th word of interface_blk:

Table 331b Return Codes from the IOABSR Program

Return Code

Meaning

0

Successful completion. Element added/changed/returned.

4

CPUT function: Not added, as the key already exists. No PREV or NEXT element.

8

GET function: Key not found.

12

PUT function: Not added due to a storage problem.

16

Invalid parameter (the 1st parameter or key_length), or (for GET) the tree does not exist.

20

No storage for the internal descriptor area (for PUT, CPUT, or INIT).

IOABSR Example

The following example presents a call to the IOABSR program:

Copy
. . .
         CALL  IOABSR,(BSRDSC,BSRFUNC,BSRKEYL,BSRDATL)
. . .
BSRDSC    DS     16F
BSRFUNC   DS     CL4
BSRKEYL   DS     H
BSRKEY    DS     XL(max key_length)
BSRDATL   DS     H
BSRDATA   DS     XL(max data_length)

IOABSR64 Program

The IOABSR64 program is very similar to the IOABSR program, with the following differences:

  • IOABSR64 keeps the tree in the storage located above the bar.

  • The first IOABSR64 parameter must point to a 40F (20D) area that is used by IOABSR64 as a work area.

  • The length of the KEY (as well as the length of the DATA) is limited to 32760 bytes in IOABSR64.

IOABSR64 Parameters

The area that the first parameter points to can be described as follows:

Copy
WORKAR   DC    40F'0'
         ORG   WORKAR
BASESIZE DS    F                     
RETCODE  DS    H                     
RSNCODE  DS    H                     
@TOTSIZE DS    2F         TOTAL SIZE OF OBTAINED MEMORY (in bytes)               
@DEADSIZ DS    2F         TOTAL SIZE OF DEAD MEMORY (FRAGMENTATION)   
@TOTENT# DS    F          CURRENT TOTAL NUMBER OF ENTRIES IN THE TREE 
         DS    8F                     
BSRTREEA DS    F'0'       PTR TO THE TREE HEADER  
         ORG   ,     

Note the following parameters and fields:

  • IOABSR64 returns the @TOTSIZE, @DEADSIZ, and @TOTENT# fields on every call of RC=12 or less.

  • BASESIZE: Defines the size of the memory object that is obtained every time that additional memory is needed, in megabytes. The default is 1 megabyte.

  • BSRTREEA: Defines a pointer to the tree header. Initially it must be 0. IOABSR64 returns the value when it creates the tree.

IOASOR Program

IOASOR is a general-purpose SORT program that sorts vectors in the memory. The following limitations enable the IOASOR program to achieve exceptionally high performance:

  • The record length and key length are both limited to 256 bytes.

  • The vector is sorted by one key only.

IOASOR Attributes and Fields

The IOASOR load module attributes are

Copy
AMODE=31 RMODE=31

Use the following call statement to invoke the IOASOR program:

Copy
CALL  (ioasor),(vector,no_of_entries,entry_length,key_position,ascend/descend_and_keylen)

Table 331c Fields for Invoking the IOASOR Program

Field

Description

ioasor

Defines the entry point to the IOASOR program.

vector

Defines the address of the vector to be sorted.

no_of_entries

Determines the number of entries in the vector.

entry_length

Determines the length of the entry.

key_position

Defines the position of the sort key.

Valid values are from 1 to entry_length.

ascend/descend_and_keylen

Points to 2 halfwords:

  • The first halfword indicates ascending (H’0’) or descending (H’1’) sort order.

  • The second halfword contains the key length.