IFSTRTN (IFAM2) (HLI function)

From m204wiki
Revision as of 23:02, 11 July 2016 by ELowell (talk | contribs)
Jump to navigation Jump to search

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

Summary

Description
The IFSTRTN call (START THREAD) starts an IFAM2 thread connection to Model 204 with a specified Host Language Interface Model 204 service program through the named channel.
Thread type
multiple cursor IFSTRT, single cursor IFSTRT
IFCALL function number
4

Syntax

IFSTRTN|IFSTRN(RETCODE,LANG_IND,LOGIN,THRD_TYP,THRD_ID,[SBSN:]CHAN)

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

Specify the parameters in the syntax order shown above.

Parameter Description
RETCODE [O,i,r] The Model 204 return code is the required first parameter. The code is a binary integer value.
LANG_IND [I,i,r] The language indicator is a required input parameter that establishes the calling sequence convention to be used corresponding to the host language. The indicator specifies the format of parameters that are passed in subsequent calls.

Specify one of the following integer values:

1 = PL/1 F-level, and BAL languages
2 = COBOL, FORTRAN, and BAL languages
3 = PL/1 with +Optimizer/Checkout compilers, VS/FORTRAN, and BAL languages

Note: Any convention may be specified for use with the BAL language, and the BAL programmer must adhere to the convention that is specified when coding parameters.

LOGIN [I,c,r] The login information is a required parameter that supplies a valid Model 204 user ID and password that permit entry to the system. Specify the login as a character string using the following format:

userid [account]; password[:new password];

where:

userid is a character string that identifies the user who is logging into Model 204.

account is an optional character string that supplies an account under which the user is logging into Model 204.

password is a character string that allows the specified user to access Model 204.

new password is an optional character string that changes the login password for the specified user, for future logins.

See Login restrictions for the restrictions that apply to login entries when using a security subsystem, such as Security Server, to perform login validation. For a description of the login command, see LOGIN or LOGON command.

THRD_TYP [I,i,r] The thread type indicator is a required parameter that specifies the type of IFSTRT thread to be allocated. Specify one of the following integer values:

0 = Single cursor thread with read-only privileges
1 = Single cursor thread with update privileges
2 = Multiple cursor thread

Note: The 0 (read) and 1 (update) settings are valid for single cursor IFSTRT threads and can be used for a multithreaded application.

A thread type indicator of 0 allows a single cursor IFSTRT thread to be used only for retrieval, regardless of the file or group password that is used in a particular call.

File updating by passing data from a retrieval-only Host Language Interface thread to an update thread can lead to logical inconsistencies to the updated file during a roll forward. To prevent inconsistencies, start the thread as an update thread (1) and use a retrieval-only password to open a file. This provides share-mode enqueuing and prevents updating from the thread. Files that are opened this way are also prevented from being marked physically inconsistent with a user restart or system crash.

THRD_ID [O,i,r] The thread identifier is a required output parameter. Specify an integer variable. Model 204 returns a value that may be referenced using the IFDTHRD and IFSTHRD calls for thread switching in multithreaded applications.
[SBSN:]CHAN [I,c,r] The channel (CHAN) name is a required input parameter that specifies the CRAM, IUCV, or VMCF communications channel name for a particular service program. Specify the name as an eight-character string.

The subsystem name (SBSN:) is optional. You can use it when you want to override the default. Specify the name as a four-character string, plus colon (:).

Note: Do not append a semicolon.

If the host language is PL/1, pass the address of the string using a based variable that overlays the original parameter.

Usage notes

Use the IFSTRTN call to establish an IFAM2 connection using a specific Host Language Interface Model 204 service program. IFSTRTN performs the same function as IFSTRT. The IFSTRTN call includes a sixth parameter, which is not available with IFSTRT that is used to specify the communications channel name for the service program.

For more information about CRAM (Cross Region Access Method) and Host Language Interface Model 204 service programs, see HLI: Job requirements and HLI: IFAM2 CICS processing.

Note: An IFAM2 job can be multithreaded. You can call IFSTRTN more than once in a job to establish multiple threads, but only one thread is currently active and, for single cursor IFSTRT threads, each thread has its own current file or group, current record set, and current record.

IFSTRTN uses IFSTRT protocols, and allows applications written in a host language to process against the Model 204 database using a the same class of HLI calls that are available with IFSTRT. You can start a single cursor or multiple cursor IFSTRT thread using the IFSTRTN call.

IFSTRT, together with IFFNSH, initiates CPSORT checkpointing.

Login restrictions

Certain restrictions apply for specifying login information (the LOGIN parameter). Rocket recommends the following actions when using a security subsystem, such as Security Server, that performs login validation:

  • Do not specify a user ID in the login for User 0. Note that if you do supply a user ID in the login, it must match the user ID of the owner of the address space; otherwise, the login fails.
  • When the IFSTRT call processes the login parameter, do not code the password in the host language program. Model 204 interprets a password that is passed in the IFSTRT call as an invalid command.

Coding example (COBOL)

This COBOL coding example specifies the following IFSTRT parameters:

  • COBOL calling convention (language indicator is 2)
  • Login account name USERABC
  • Login password ECP
  • Single cursor thread with read-only access (thread type is 0)
  • Channel name M204CHNB

WORKING-STORAGE SECTION. 01 LOGIN-INFO. 05 LOGIN PIC X(12) VALUE 'USERABC;ECP;'. 01 CALL-ARGS. COMP SYNC. 05 RETCODE PIC 9(5). 05 LANG-IND PIC 9(5) VALUE 2. 05 MODE PIC 9(5) VALUE 0. 05 THRD-NO PIC 9(5). 05 CHAN-NAME PIC X(13) VALUE "SSN1:IFAMCHNL". * 05 CHAN-NAME PIC X(8) VALUE "IFAMCHNL". . . . PROCEDURE DIVISION. INITIALIZATION. OPEN OUTPUT... CALL "IFSTRTN" USING RETCODE, LANG-IND, LOGIN, MODE, THRD-NO, CHAN-NAME. IF RETCODE IS NOT EQUAL TO ZERO GO TO ERROR-ROUTINE. . . .