IFDECL (HLI function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with " ==Summary== <dl> <dt>Description</dt> <dd>The IFDECL call lets you declare STRING %variables to support the use and display of double-byte character set (DBCS) characters.</d...")
 
No edit summary
 
(2 intermediate revisions 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==
Line 12: Line 13:
==Syntax==
==Syntax==
<p class="syntax">IFDECL %variable [IS] [EBCDIC | MIXED {DBCS | KANJI} | DBCS | KANJI] [<var class="term">options</var>]</p>
<p class="syntax">IFDECL %variable [IS] [EBCDIC | MIXED {DBCS | KANJI} | DBCS | KANJI] [<var class="term">options</var>]</p>
<dl>
<dt>Compile-only form</dt>
<dd>Not available</dd>
<dt>Execute-only form</dt>
<dd>Not available</dd>
</dl>


<p>The parameters for IFDECL are the same as for the Model 204 <var>[[SOUL_syntax#DECLARE|DECLARE]]</var> statement.</p>
<p>The parameters for IFDECL are the same as for the Model 204 <var>[[SOUL_syntax#DECLARE|DECLARE]]</var> statement.</p>

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:

  1. Performs the appropriate data type conversions, following the conversion rules for assignment types.
  2. 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