HLI: Function summary: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Changed IIFSPRM to IFSPRM, IIFSTRT to IFSTRT)
 
Line 156: Line 156:
</tr>
</tr>
<tr>
<tr>
<td>IIFSPRM</td>
<td>IFSPRM</td>
<td>Sets a parameter.</td>
<td>Sets a parameter.</td>
</tr>
</tr>
Line 164: Line 164:
</tr>
</tr>
<tr>
<tr>
<td>IIFSTRT</td>
<td>IFSTRT</td>
<td>Establishes an IFSTRT thread connection.</td>
<td>Establishes an IFSTRT thread connection.</td>
</tr>
</tr>

Latest revision as of 03:57, 7 January 2017

Overview

This topic summarizes the function calls available in the Model 204 Host Language Interface (HLI) facility. Read this topic if you are using the HLI facility for the first time.

This topic also provides overview information on IFDIAL and IFSTRT threads that you need to understand in order to code the HLI calls in your application program.

When designing program logic, you must be familiar with the following distinctions:

For more information:

  • See the HLI functions table at the end of this topic for a complete listing of HLI function calls.
  • See the individual pages in the HLI functions category for a detailed description of each call.
  • See HLI: Coding conventions for information about coding HLI call parameters using different host languages.
  • For sample coding sequences using HLI calls, see HLI: Threads.

IFDIAL thread calls

IFDIAL thread

An IFDIAL thread provides a line-at-a-time terminal type interface between Model 204 and a host language program that is running in batch.

With an IFDIAL thread, an application that is written in a host language can transmit data to and from Model 204 using the IFWRITE and IFREAD calls.

See HLI: Job requirements for information about setting up and running the batch Model 204 job using an IFDIAL thread.

Summary of IFDIAL calls

The following table summarizes the HLI calls that are available for use only with an IFDIAL thread. See the individual pages in HLI functions for a detailed description of each call.

IFDIAL functions

Call Function
IFATTN Sends an attention interrupt.
IFDIAL Starts an IFDIAL thread.
IFDIALN Starts an IFDIAL thread using a specified communications channel name.
IFHNGUP Ends all threads that are started in a job.
IFREAD Gets a line of output from Model 204.
IFSETUP Initiates contact with Model 204 and sets the PARM parameters and CCAIN statements for the IFAM1 job.
IFWRITE Sends a line of input to Model 204.

IFSTRT thread calls

IFSTRT thread

An IFSTRT thread provides a user interface between Model 204 and a host language program that is running in batch.

With an IFSTRT thread, an application that is written in a host language can issue calls to Model 204 that perform operations against the database which are similar to Model 204 commands and SOUL statements.

See HLI: Job requirements for information about setting up and running the Online or batch Model 204 job using an IFSTRT thread. See IFSTRT (IFAM1) or IFSTRT (IFAM2/IFAM4) for a detailed description of the IFSTRT call.

Different operational levels

The HLI calls that are available for use with an IFSTRT thread are categorized by functionality and operate at the following levels:

  • System
  • Transaction
  • File or group
  • Set
  • Single record

A typical application program works at all levels, using the HLI calls that are available at each level. The calls that are available in each of these categories are summarized in the tables on the following pages.

Enqueuing action and record locking behavior

When several users have access to the same files or groups, Model 204 prevents conflicting, simultaneous use of records with a facility called enqueuing. Enqueuing is performed at the thread level.

With an IFSTRT thread, most HLI function calls automatically enqueue and dequeue on the resources, such as the files, groups, sets, or records, to which they refer.

See HLI functions for detailed information about the record locking behavior of individual calls. See HLI: Locking behavior of HLI calls for more information about enqueueing on an IFSTRT thread.

System level IFSTRT calls

System level functions constitute the highest level of access to the Host Language Interface Model 204 service routines. At the system level, most functions do not require a file or group context.

The following table summarizes the IFSTRT calls that function at the system level.

System level IFSTRT calls

Call Function
IFCALL Calls another HLI function by number.
IFCHKPT Requests a checkpoint, checkpoint status information, or both. (Note that IFCHKPT is also a transaction-level function.)
IFDTHRD Deletes the current thread and switches to another thread.
IFEFCC Returns specific information about field values or record numbers that cause a field constraint conflict using the IFSTOR, IFUPDT, or IFPUT HLI calls
IFEPRM Reads a parameter.
IFERLC Returns a file name, record number, and user name after a record locking conflict occurs in an HLI program that issues a call that requires locking a record
IFERR Places a message on the journal, requests a snap dump of the Model 204 region, or both.
IFFNSH Deallocates all threads; finishes HLI portion of program.
IFGERR Reads the latest error message produced by Model 204.
IFLOG Logs in user with user ID and password (IFAM1).
IFRPRM Resets a parameter.
IFSPRM Sets a parameter.
IFSTHRD Switches from one thread to another.
IFSTRT Establishes an IFSTRT thread connection.
IFSTRTN Establishes an IFSTRT thread connection to an alternate HLI Model 204 service program.
IFUTBL Resets the size of a user's server tables.

Transaction level IFSTRT calls

Transaction level functions operate in a job that uses the Host Language Interface facility to manage transactions for a logical unit of work processing against the Model 204 database.

The following table summarizes the IFSTRT calls that function at the transaction level.

Transaction level IFSTRT calls

Call Function
IFBOUT Backs out current transaction.
IFCHKPT Requests a checkpoint or checkpoint status or both.

Note: IFCHKPT is also a system-level function.

IFCMMT Commits the current transaction.
IFCMTR Releases all record sets and commits the current transaction.
IFRELA Releases all record sets.

File or group level IFSTRT calls

HLI functions at the file or group level operate with a file or group.

For example, whenever an application program requires access to a Model 204 file, a file or group must be opened. IFOPEN must be called before any other file or group level functions. IFOPEN establishes the current file or group on which subsequent file or group level, record level, and set level functions operate.

Note: On a single cursor IFSTRT thread, each thread can have only one current file or group. All functions operate against this file or group.

On a multiple cursor IFSTRT thread, multiple files or groups can be accessed, and the file or group that is specified in the HLI call is the one that is current for processing. If the file specification is optional and no file is specified, the file that was opened last is current, by default.

The following table summarizes the IFSTRT calls that function at the file or group level.

File or group level IFSTRT calls

Call Function
IFCLOSE Closes all files and groups for the current thread.
IFDELF Deletes a field definition in a file. IFDELF can be used only if the current context is a file.
IFDFLD Defines new fields in a file.
IFDISP Displays file, group, and other information.
IFFLS Checks for field-level security violations.
IFINIT Initializes a file. IFINIT can be used only if the current context is a file.
IFNFLD Renames fields in a file. IFNFLD can be used only if the current contest is a file.
IFOPEN Opens a file or group.
IFOPENX Opens a file or group, enqueuing upon the file(s) in exclusive status.
IFRFLD Redefines fields in a file. IFRFLD can be used only if the current context is a file.

Record set level IFSTRT calls

Functions at the record set level operate with sets of records or field values.

For example, the IFFIND function must be called to establish a current set before any other set level functions can operate successfully.

On a multiple cursor IFSTRT thread, the set that is specified in the HLI call is the one that is current for processing. On a single cursor IFSTRT thread, the current set is the one last created.

The IFSTRT calls that function at the record set level are summarized in the following tables:

Record set level calls on any IFSTRT thread

The following table lists calls that can be used on both multiple cursor and single cursor IFSTRT threads.

Record set level calls on any IFSTRT thread

Call Function
IFCOUNT Counts the number of records in the current set.
IFDSET Deletes the current set of records from the file or group.
IFFAC Finds and returns record count.
IFFACC Compiles an IFFAC specification.
IFFACE Executes a precompiled IFFAC specification.
IFFDV Selects a set of field values to become the current value set.
IFFDVC Compiles an IFFDV specification.
IFFDVE Executes a precompiled IFFDV specification.
IFFILE Adds an invisible key field to all records in the current set.
IFFIND Selects a set of records as the current set.
IFFINDC Compiles an IFFIND specification.
IFFINDE Executes a precompiled IFFIND specification.
IFFNDX Selects a set of records and enqueues upon them exclusively.
IFFNDXC Compiles an IFFNDX specification.
IFFNDXE Executes a precompiled IFFNDX specification.
IFFWOL Selects a set of records as the current set, without locking.
IFFWOLC Compiles an IFFWOL specification.
IFFWOLE Executes a precompiled IFFWOL specification.
IFSKEY Sorts the records in the current IFFIND set; only the record key is written to the sort records.
IFSKYC Compiles the IFSKEY specification.
IFSKYE Executes the precompiled IFSKEY specification.
IFSORT Sorts the records in the current set.
IFSRTC Compiles the IFSORT sort specification.
IFSRTE Executes the precompiled IFSORT or IFSRTC specification.
IFSRTV Sorts the values in the current value set.
IFSTVC Compiles the IFSRTV specification.
IFSTVE Executes the precompiled IFSRTV specification.

Record set level calls on a multiple cursor IFSTRT thread

The following table lists those calls that can be used only on a multiple cursor IFSTRT thread.

Record set level calls on a multiple cursor IFSTRT thread

Call Function
IFCCUR Closes a cursor on a set.
IFCLST Clears a list.
IFOCUR Opens a cursor on a set.
IFOCURC Compiles the IFOCUR specification.
IFOCURE Executes the precompiled IFOCUR specification.
IFPROLS Places records from a found set onto a list.
IFRELR Releases records in a found set.
IFRRFLS Removes records in a found set from a list.

Record set level calls on a single cursor IFSTRT thread

The following table lists those calls that can be used only on a single cursor IFSTRT thread.

Record set level calls on a single cursor IFSTRT thread

Call Function
IFDEQL Dequeues the set of records on a specified list.
IFENQL Enqueues in share or exclusive mode on the set of records of the specified list.
IFLIST Places the records in the current set onto a named list.

Individual record level IFSTRT calls

Individual record functions operate on a record.

On a single cursor IFSTRT thread, IFGET, IFBREC, and IFPOINT establish the current record on which they and other functions at this level operate.

On a multiple cursor IFSTRT thread, the current record in the cursor that is specified in the HLI call is the record that is current for processing. The current record in a cursor is established by an IFFTCH, IFSTOR, or IFFRN call.

The IFSTRT calls that function at the single record level are summarized in the following tables:

Individual record level calls on any IFSTRT thread

Call Function
IFDALL Deletes all the occurrences of a field from the current record.
IFDREC Deletes the current record from its file.
IFDVAL Deletes a field name = value pair.
IFPROL Places the current record on a named list.
IFRRFL Removes the current record from a named list.

Individual record level calls on a multiple cursor IFSTRT thread

The following table lists those calls that can be used only on a multiple cursor IFSTRT thread.

Individual record level calls on a Multiple Cursor IFSTRT thread

Call Function
IFFRN Points to the specified record in the specified file and makes it the current record.
IFFRNC Compiles the IFFRN specification.
IFFRNE Executes the precompiled IFFRN specification.
IFFTCH Processes the next logical record or value and returns the specified data.
IFFTCHC Compiles the IFFTCH specification.
IFFTCHE Executes the precompiled IFFTCH specification.
IFOCC Counts the number of occurrences of the specified field in the current record and returns a count.
IFOCCC Compiles the IFOCC specification.
IFOCCE Executes the precompiled IFOCC specification.
IFRNUM Returns the number of the current record in the specified cursor.
IFSTOR Creates a new record with the specified data and adds the record to the specified file.
IFSTRC Compiles the IFSTOR specification.
IFSTRE Executes the precompiled IFSTOR specification.
IFUPDT Updates the current record with the specified data.
IFUPDTC Compiles the IFUPDT specification.
IFUPDTE Executes the precompiled IFUPDT specification.

Individual record level calls on a single cursor IFSTRT thread

The following table lists those calls that can be used only on a single cursor IFSTRT thread.

Individual record level calls on a single cursor IFSTRT thread

Call Function
IFBREC Creates a new record.
IFCTO Counts the number of field occurrences in the current record.
IFCTOC Compiles an IFCTO specification.
IFCTOE Executes a precompiled IFCTO specification.
IFGET Reads information from the next record in the current set.
IFGETC Compiles an IFGET specification.
IFGETE Executes a precompiled IFGET specification.
IFGETV Reads the next value from the current value set.
IFGETX Reads information from the next record, enqueuing upon it exclusively.
IFGETXE Executes a precompiled IFGET specification, enqueuing upon the record exclusively.
IFGTVC Compiles the IFGETV specification.
IFGTVE Executes the precompiled IFGETV.
IFMORE Reads more information from the current record.
IFMOREC Compiles an IFMORE specification.
IFMOREE Executes a precompiled IFMORE specification.
IFMOREX Reads more information from the current record, enqueuing upon the record exclusively.
IFMORXE Executes a precompiled IFMORE specification, enqueuing upon the record exclusively.
IFPOINT Specifies a new current record.
IFPUT Updates the current record.
IFPUTC Compiles an IFPUT record.
IFPUTE Executes a precompiled IFPUT specification.

IFSTRT thread calls and compiled IFAM

Compiled IFAM facility

The Compiled IFAM (Inverted File Access Method) facility allows IFSTRT thread calls to be compiled and stored.

Using the Compiled IFAM facility, you can execute a compilation at a later time by specifying the name under which it was stored. You do not need to recompile the stored call.

A compilation must be uniquely identified so that multiple calls can use it. The name parameter included in all Compiled IFAM calls specifies a character string that is used to identify the compilation. A null name string is the same as an omitted parameter.

Three forms of Compiled IFAM calls

Three forms of IFSTRT calls are available using the Compiled IFAM facility: compile and execute, compile-only, and execute-only. The following options are available to accommodate different programming styles:

  • Using a single call that compiles and executes with the name parameter that identifies the compilation. The call executes and the compiled version of the call is saved.

    When the same call is executed again or when another call containing the same name parameter is executed, the stored compilation is executed without requiring recompilation.

  • Using two calls, one is compile-only and one is execute-only, with the name parameter that identifies the compilation for the two phases of Compiled IFAM processing: compilation and execution.

    This option involves a two-call procedure, useful in loop processing. The compilation form of the call is used outside the loop to compile (but not execute) the call specification. Within the loop, the execution form of the call is issued, thereby executing the previously compiled call.

See the functions table for an overview of the calls that provide Compiled IFAM functionality for IFSTRT thread processing.

See HLI: IFSTRT processing for more information about IFSTRT calls and the Compiled IFAM facility.

Function call notation conventions

The conventions for call syntax and parameters described in this section apply to each function call page in the HLI functions category.

Type of thread for the call

The Thread type heading on each function call page indicates the type(s) of thread that can be used for the call:

  • multiple cursor IFSTRT thread
  • single cursor IFSTRT thread
  • IFDIAL thread

Call name and syntax

The syntax of host language calls is presented in the following format:

callname | alias (parm1, parm2,...parmn)

where:

  • callname is a keyword which specifies the name of the HLI function; an alias, if available, is also provided. alias is a name that is six characters or less in length to be used for FORTRAN programming. A vertical bar separates the callname from the alias, for example:

    IFFIND | IFFD

  • parm1 is the first parameter in the call list. Parameters must be specified in the proper syntax order, as shown (parm2 follows parm1, and so on; parmn is last).
  • A comma delimiter (,) separates parameters in the list, and the entire parameter list is enclosed inside parentheses, for illustrative purposes only. (When coding calls, use the delimiter and format that is valid in your host language.)

Different forms of call syntax

The individual call description includes the full syntax and, where available, the compile-only and execute-only forms of the call. For example, with IFFIND (full syntax), the IFFINDC (compile-only syntax) and IFFINDE (execute-only syntax) forms are also provided. Compile-only or execute-only syntax is used with the Compiled IFAM facility.

Also, each form of the call, that is, full syntax, compile-only syntax, and execute-only syntax, is identified by a call number, where available. Note that you can use IFCALL to call functions that have numbers.

For example, for the three forms of the find function call, the IFCALL function numbers are:

  • IFFIND Full syntax (13)
  • IFFINDC Compile-only syntax (46)
  • IFFINDE Execute-only syntax (47)

Parameters

Each parameter description provides a three-character code having the following format:

[X,y,z]

where:

X Specifies that the parameter is used for input or output operations, and that it is either of the following codes:

I (input)
O (output)

y Specifies that the parameter, if coded, must be defined in the host language program as one of three possible data type variables, and is one of the following codes:

i -- For an integer whose maximum length is 4 bytes

s -- For a short character string whose maximum length is 32 bytes

c -- For a character string whose maximum length is the buffer size

z Specifies whether the parameter must be coded in the call, and is either (or both) of the following codes:

r (required)

o (optional)

For example, RETCODE [O,i,r] where:

O Specifies that RETCODE is an output parameter
i Specifies an integer type variable (maximum length is 4 bytes)
r Specifies that RETCODE is required

Certain parameters may be either r or o depending, in some cases, on whether the call is being coded on a multiple cursor IFSTRT thread or, in other cases, whether the call is used for Compiled IFAM.

For example, for IFFAC, the compilation name parameter is FAC_NAME [I,s,r/o] where:

I Specifies that FAC_NAME is an input parameter
s Specifies a short character string type variable (maximum length is 32 bytes)
r/o Specifies that FAC_NAME is required for use with a multiple cursor IFSTRT thread, and is only required for a single cursor IFSTRT thread if using the compiled IFAM facility (IFFACC and IFFACE).

For an r/o code, read the parameter description to determine usage requirements.

Complete listing of HLI functions

The following table provides a summary overview of the calls that are available using the HLI facility, including their Compiled IFAM and multiple cursor (MC) functionality.

Table conventions

For each call, this table provides the following information:

  • Name: Names are listed in alphabetical order. Each function name links to a topic describing that function in detail.
  • IFCALL function #: the number that can be used to reference the function using IFCALL.
    Note that IFCALL, IFDECL, IFLOG, and IFSTRT (IFAM1) do not have numbers.
  • Alias: The shortened COBOL form (six characters or less in length) for the call. A dash indicates that the call name does not have an alias.
  • Compile-only form/IFCALL function #: If present, the compile-only form of the function and its IFCALL number. Any alias for the compile-only form is also listed.
  • Execute-only form/IFCALL function #: If present, the execute-only form of the function and its IFCALL number. Any alias for the execute-only form is also listed.
  • IFDIAL?: A Y indicates that the call is valid for use with an IFDIAL thread.
  • Multiple cursor?: A Y indicates that the call is valid for use with a multiple cursor IFSTRT thread.

HLI functions

Name IFCALL
function #
Alias Compile-only form/
IFCALL function #
Execute-only form/
IFCALL function #
IFDIAL? Multiple
cursor?
IFABXIT 97 - - - - Y
IFATTN 43 - - - Y -
IFBOUT 71 - - - - Y
IFBREC 20 - - - - -
IFCALL - - - - - Y
IFCCUR 125 - - - - Y
IFCHKPT 30 IFCHKP - - - Y
IFCLOSE 12 IFCLOS - - - Y
IFCLST 108 - - - - Y
IFCMMT 72 - - - - Y
IFCMTR 105 - - - - Y
IFCOUNT 14 IFCNT - - - Y
IFCSA 96 - - - - Y
IFCTO 65 - IFCTOC / 66 IFCTOE / 67 - -
IFDALL 73 - - - - Y
IFDECL - - - - - -
IFDELF 62 - - - - Y
IFDEQ 38 - - - - Y
IFDEQL 41 - - - - -
IFDFLD 24 - - - - Y
IFDIAL 6 - - - Y -
IFDIALN 7 IFDILN - - Y -
IFDISP 60 - - - - Y
IFDREC 19 - - - - Y
IFDSET 21 - - - - Y
IFDTHRD 42 IFDTRD - - - Y
IFDVAL 32 - - - - Y
IFEFCC 139 - - - - Y
IFENQ 39 - - - - Y
IFENQL 40 - - - - -
IFEPRM 25 - - - - Y
IFERLC 138 - - - - Y
IFERR 28 - - - - Y
IFFAC 126 - IFFACC / 127 IFFACE / 128 - Y
IFFDV 74 - IFFDVC / 75 IFFDVE / 76 - Y
IFFILE 22 - - - - Y
IFFIND 13 IFFD IFFINDC / 46,
(alias) IFFDC
IFFINDE / 47,
(alias) IFFDE
- Y
IFFLS 61 - - - - Y
IFFLUSH 45 IFFLSH - - - Y
IFFNDX 56 IFFDX IFFNDXC / 57,
(alias) IFFDXC
IFFNDXE / 58,
(alias) IFFDXE
- Y
IFFNSH 3 - - - Y Y
IFFRN 118 - IFFRNC / 119 IFFRNE / 120 - Y
IFFTCH 98 - IFFTCHC / 99,
(alias) IFFCHC
IFFTCHE / 100,
(alias) IFFCHE
- Y
IFFWOL 87 IFFWO IFFWOLC / 88,
(alias) IFFWOC
IFFWOLE / 89,
(alias) IFFWOE
- Y
IFGERR 29 - - - - Y
IFGET 15 - IFGETC / 48 IFGETE / 49 - -
IFGETV 77 - IFGTVC / 78 IFGTVE / 79 - -
IFGETX 36 - None; IFGETC can be used IFGETXE / 50,
(alias) IFGTXE
- -
IFHNGUP 8 IFHNGP - - Y -
IFINIT 23 - - - - Y
IFLIST 17 - - - - -
IFLOG - - - - - Y
IFMORE 16 - IFMOREC / 51,
(alias) IFMREC
IFMOREE / 52,
(alias) IFMREE
- -
IFMOREX 37 IFMREX None; IFMOREC can be used IFMORXE / 53,
(alias) IFMRXE
- -
IFNFLD 63 - - - - Y
IFOCC 122 - IFOCCC / 123 IFOCCE / 124 - Y
IFOCUR 95 - IFOCURC / 106,
(alias) IFOCRC
IFOCURE / 107,
(alias) IFOCRE
- Y
IFOPEN 11 - - - - Y
IFOPENX 35 IFOPNX - - - Y
IFPOINT 44 IFPNT - - - -
IFPROL 33 - - - - Y
IFPROLS 109 IFPRLS - - - Y
IFPUT 18 - IFPUTC / 54 IFPUTE / 55 - -
IFREAD 9 - - - Y -
IFRELA 104 - - - - Y
IFRELR 103 - - - - Y
IFRFLD 59 - - - - Y
IFRNUM 121 - - - - Y
IFRPRM 27 - - - - Y
IFRRFL 34 - - - - Y
IFRRFLS 110 IFRFLS - - - Y
IFSETUP 86 IFSETP - - Y -
IFSKEY 83 - IFSKYC / 84 IFSKYE / 85 - Y
IFSORT 68 - IFSRTC / 69 IFSRTE / 70 - Y
IFSPRM 26 - - - - Y
IFSRTV 80 - IFSTVC / 81 IFSTVE / 82 - Y
IFSTHRD 2 IFSTRD - - - Y
IFSTOR 112 - IFSTRC / 113 IFSTRE / 114 - Y
IFSTRT
(IFAM1)
- - - - - Y
IFSTRT
(IFAM2/IFAM4)
1 - - - - Y
IFSTRTN
(IFAM2)
4 IFSTRN - - - Y
IFUPDT 115 - IFUPDTC / 116,
(alias) IFUPDC
IFUPDTE / 117,
(alias) IFUPDE
- Y
IFUTBL 64 - - - - Y
IFWRITE 10 IFWRIT - - Y -

See also