IFFRN (HLI function): Difference between revisions
(Created page with " ==Summary== <dl> <dt>Description</dt> <dd>The IFFRN call (FOR RECORD NUMBER) creates a cursor, or opens an existing cursor on the current thread. The IFFRN cursor points to t...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
The conventions used on this page are described in [[HLI: Function summary#Function call notation conventions|Function call notation conventions]]. | |||
==Summary== | ==Summary== |
Latest revision as of 22:57, 12 July 2016
The conventions used on this page are described in Function call notation conventions.
Summary
- Description
- The IFFRN call (FOR RECORD NUMBER) creates a cursor, or opens an existing cursor on the current thread. The IFFRN cursor points to the specified record in the specified file and makes it the current record in the cursor.
- Thread type
- multiple cursor IFSTRT
- IFCALL function number
- 118
Syntax
IFFRN(RETCODE,FILE_SPEC,RECNUM,FRN_NAME,%VARBUF,%VARSPEC)
- Compile-only form
- IFCALL function number: 119
IFFRNC(RETCODE,FILE_SPEC,FRN_NAME)
- Execute-only form
- IFCALL function number: 120
IFFRNE(RETCODE,RECNUM,FRN_NAME,%VARBUF,%VARSPEC)
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. |
FILE_SPEC | [I,c,r] The file specification is a required input parameter which identifies the Model 204 file that contains the current record. Specify a character string using a standard Model 204 IN FILE clause. For information about the IN FILE clause, see Record loops.
If a group is specified, a MEMBER clause is required. |
RECNUM | [I,s,r] The record number is a required input parameter which specifies the internal record number. This is the current record to be processed in the specified file. Specify the record number as a short character string. |
FRN_NAME | [I,s,r] The unique name of the IFFRN compilation is a required input parameter. A null string is not valid. Model 204 saves the compilation using this name.
Specify the name as unique, and as a short character string (maximum 32 characters). The first character in the name must be alphanumeric, and the name must begin with a letter (A-Z or a-z) which may be followed by a letter, a digit (0-9), a period (.), or underscore (_). A null value is equivalent to omitting the name parameter, and is not valid. Note: Model 204 allocates a cursor as part of the saved IFFRN compilation. The cursor points to the record specified in the RECNUM parameter. You can reference this cursor using the compilation name in any single record host language function. |
%VARBUF | [I,c,o] The variable buffer is an optional input parameter that addresses a data area which accommodates up to 255 bytes of data per value. The buffer contains values which are defined by the %VARSPEC parameter, below, to be assigned to %variables. Specify a character string.
For information about %variables, see Using variables and values in computation. |
%VARSPEC | [I,c,o] The variable specification describes the format of the data that is contained in the %variable parameter, and lists the %variables to be assigned. %VARSPEC specifies the contents of the variable buffer, described above. Specify a character string which follows a LIST, DATA, or EDIT syntax.
%VARSPEC is a required input parameter if %VARBUF is specified. |
Usage notes
Use the IFFRN call to establish a cursor pointing to a particular record in a particular file. IFFRN opens a cursor to a record which allows the record to be operated on by the IFFTCH and IFUPDT calls.
The IFFRN call is the equivalent of the FOR RECORD NUMBER statement in SOUL and replaces the IFPOINT call in the multiple cursor environment.
For information about the FOR RECORD NUMBER statement, see FOR RECORD NUMBER processing.
Coding example (COBOL)
WORKING-STORAGE SECTION. 01 CALL-ARGS. 05 RETCODE PIC 9(5) COMP SYNC. 05 FILESPEC PIC X(5) VALUE "IN FILE CARS;". 05 RECNUM PIC X(4) VALUE "175;". 05 FRNCURS PIC X(8) VALUE "FRNCURS;". . . . PROCEDURE DIVISION. . . . CALL "IFFRN" USING RETCODE, FILESPEC, RECNUM, FRNCURS.