IFFNSH (HLI function)

From m204wiki
Jump to navigation Jump to search

The conventions used on this page are described in Function call notation conventions.

Summary

Description
The IFFNSH call (FINISH) closes, dequeues, and deallocates all files and threads to terminate Host Language Interface processing.
Thread type
multiple cursor IFSTRT, single cursor IFSTRT, IFDIAL
IFCALL function number
3

Syntax

IFFNSH(RETCODE,USER_RETCODE,URC_TYPE)

Compile-only form
Not available
Execute-only form
Not available

Specify the parameters in the syntax order shown above.

Parameter Specifies...
RETCODE [O,i,r] Model 204 return code, the required output parameter. The code is a binary integer value.
USER_RETCODE [O,i,o] Model 204 return code for the current user. The code is a binary integer value and is output only.
URC_TYPE [I,c,o] Type of return code to return in USER_RETCODE.

Values are:

  • N for return code = 0
  • O for Online value
  • B for batch value

Usage notes

USER_RETCODE and URC_TYPE are optional; however, if you enter one, you must enter both. Incorrect URC_TYPE parameter values are equivalent to entering N.

If the connection to Model 204 is lost prior to the call to IFFNSH, the RETCODE is 1000, indicating a successful disconnect. The USER_RETCODE value returned, however, is -1, indicating that the USER_RETCODE value is unknown.

Use the IFFNSH call to complete the update unit and end the current transaction. Call IFFNSH when the application program no longer needs the Host Language Interface/Model 204 service program.

IFFNSH closes, dequeues, and deallocates all files and threads in the current host language job, including any thread initiated by an IFDIAL call. You can use IFFNSH on any type of IFSTRT thread. IFFNSH, together with IFSTRT, initiates CPSORT checkpointing.

Completion codes (RETCODE)

Model 204 returns the completion codes for the IFFNSH call that are listed in the following table.

IFFNSH completion codes (RETCODE)

Code Job Condition
1nnn IFAM1 nnn is the highest journal error message return code encountered during the run. For example, the message FILE IS FULL... has an associated return code of 48 and may cause an IFAM1 IFFNSH return code of 1048. Completion codes greater than 1080 indicate that severe system errors were encountered during the run and prohibit further calls to IFSTRT.
1000 IFAM2

IFAM4

The application program disconnected from Model 204 normally. Otherwise, the system returns one of the completion codes listed in Completion return codes 4 and greater.

All Host Language Interface functions return with register 15 set to 0. The return code that the application program returns to the operating system is not set by Model 204 or the Host Language Interface, but must be set by the application program itself.

IFAM2 CICS Interface

An application that uses the IFAM2 CICS interface must issue IFFNSH before the program ends.

If IFFNSH is not issued, Model 204 does not detect that the IFAM2 program ended. In addition, Model 204 leaves the Host Language Interface threads, which were established through IFSTRT and IFDIAL, unusable by any other user.

See CICS abend handling for more information about using IFFNSH for abend handling in an IFAM2 CICS program.

Coding example (COBOL)

WORKING-STORAGE SECTION. 01 CALL-ARGS. 05 RETCODE PIC 9(5) COMP SYNC. . . . PROCEDURE DIVISION. OPEN-FILES. OPEN OUTPUT... CALL "IFSTRT" USING... . . . CLOSE-FILES. . . . CALL "IFFNSH" USING RETCODE.