IFDECL (HLI function): Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The conventions used on this page are described in [[HLI: Function | 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:09, 12 July 2016
The conventions used on this page are described in Function call notation conventions.
Summary
- Description
- The IFDECL call lets you declare STRING %variables to support the use and display of double-byte character set (DBCS) characters.
- Thread type
- Multi-cursor IFAM
- IFCALL function number
- Not applicable
Syntax
IFDECL %variable [IS] [EBCDIC | MIXED {DBCS | KANJI} | DBCS | KANJI] [options]
- Compile-only form
- Not available
- Execute-only form
- Not available
The parameters for IFDECL are the same as for the Model 204 DECLARE statement.
Usage notes
To support the use and display of Kanji characters, which require two bytes each, the IFDECL call declares STRING %variables as one of three types for use in an IFFIND:
- STRING EBCDIC: the default type, contains single byte characters, in the EBCDIC collating sequence
- STRING DBCS: can contain only pure DBCS characters (double-byte data only, with no shift sequences)
- STRING MIXED DBCS: Model 204 assumes the field contains both DBCS and EBCDIC data and that all DBCS characters are contained within balanced shift sequence pairs. (The shift sequences define whether a series of bytes is interpreted as DBCS or EBCDIC.)
When you use a pure or mixed DBCS %variable in an IFFIND statement, Model 204:
- Performs the appropriate data type conversions, following the conversion rules for assignment types.
- Compares the pure and mixed DBCS fields.
IFDECL declares only simple string variables. You cannot use IFDECL for arrays, ASCII, FLOAT, or BINARY strings, or for lists, labels, or subroutines.
IFDECL is allowed only on Multi-Cursor IFAM threads.
Coding example (COBOL)
WORKING-STORAGE SECTION. 01 CALL-ARGS. 77 DECLARE-MIXED PIC X(35) VALUE '%MIXED IS STRING MIXED DBCS LEN 20;'. 77 DECLARE-PURE PIC X(28) VALUE '%PURE IS STRING DBCS LEN 20;'. 77 FIND-DBCS PIC X(31) VALUE 'PURE.DBCS = 'Kanji-data';END;'. 77 FIND-NAME PIC X(08) VALUE 'FIND.DBCS;' . . . PROCEDURE DIVISION. . . . CALL IFDECL WITH DECLARE-MIXED. CALL IFDECL WITH DECLARE-PURE. CALL IFFIND WITH RETCODE, FIND-DBCS, FIND