ILE COBOL Language Reference

Elementary Moves

An elementary move is one in which the receiving item is an elementary item, and the sending item is an elementary item or a literal. Any necessary conversion of data from one form of internal representation to another takes place during the move, along with any specified editing in, or de-editing implied by, the receiving item.

De-editing is the logical removal of all editing characters from a numeric-edited data item in order to determine that item's unedited numeric value.

+-------------------------------IBM Extension--------------------------------+

De-editing also occurs for items of class date-time. In this case, all separators, and any conversion specifiers that are not numeric, are removed from the date-time item, resulting in a numeric value.

+----------------------------End of IBM Extension----------------------------+

Each elementary item belongs to one of the following categories:

The following rules outline the execution of valid elementary moves. When the receiving item is:

Alphabetic

Alphanumeric or Alphanumeric-Edited

Numeric or Numeric-Edited

+-------------------------------IBM Extension--------------------------------+

Floating-Point

+----------------------------End of IBM Extension----------------------------+

+-------------------------------IBM Extension--------------------------------+

Date-Time

+----------------------------End of IBM Extension----------------------------+

+-------------------------------IBM Extension--------------------------------+

Boolean

+----------------------------End of IBM Extension----------------------------+

+-------------------------------IBM Extension--------------------------------+

DBCS or DBCS-Edited

+----------------------------End of IBM Extension----------------------------+

+-------------------------------IBM Extension--------------------------------+

National

A national data item may receive data from an alphabetic, alphanumeric, DBCS, or national data item, and also from a nonnumeric, DBCS, or national hexadecimal literal, or the fugurative constant SPACE/SPACES.

Data moved to such an item is aligned at the leftmost character position and, where necessary, truncated or padded to the right with the padding character specified in the Padding Character command option or NTLPADCHAR option of the PROCESS statement. For information about the PROCESS statement, see ILE COBOL for AS/400 Programmer's Guide.

If the data that is being transfered is not national data, it will be converted from its representation in the sending field according to the data translation rule before it is placed in the receving field.

The data translation is performed by mapping each character defined in a source Coded Character Set Identifier (CCSID) to a target CCSID. CCSID 13488 is used to define national data CCSID.

The following rules determine the CCSID associated with other data items:

+----------------------------End of IBM Extension----------------------------+

Valid Elementary Moves

Table 30 shows valid and invalid elementary moves for each category. In the table:


Table 30. Valid Elementary Moves

 
 
 
 
 
Sending Item
Category

 
 
 
 
 
Receiving Item Category
Alphabetic Alphanumeric,
Alphanumeric-edited
Numeric,
Numeric-edited
BOOLEAN (6) DBCS (8) External
Floating-Point (6)
Internal
Floating-Point (6)
Date (6) Time (6) Timestamp (6) National (6)
Alphabetic and SPACE YES YES NO NO NO NO NO NO NO NO YES
Alphanumeric (1) YES YES YES YES (5) NO YES (9) YES (9) YES YES YES YES
Alphanumeric-edited YES YES NO NO NO NO NO YES YES YES NO
Numeric Integer (2) NO YES YES NO NO YES YES YES YES YES NO
Numeric Noninteger (3) NO NO YES NO NO YES YES NO NO NO NO
Numeric-edited NO YES YES NO NO YES YES YES YES YES NO
LOW/HIGH-VALUE, QUOTES NO YES NO NO NO NO NO NO NO NO NO
ZERO NO YES YES YES NO YES YES NO NO NO NO
BOOLEAN (4) (6) NO YES NO YES NO NO NO NO NO NO NO
DBCS (6) (7) (8)
DBCS-edited
NO NO NO NO YES NO NO NO NO NO YES
Floating-Point (10) NO NO YES NO NO YES YES NO NO NO NO
Date (6) NO YES YES NO NO NO NO YES NO YES NO
Time (6) NO YES YES NO NO NO NO NO YES YES NO
Timestamp (6) NO YES YES NO NO NO NO YES YES YES NO
National (6) YES YES NO NO YES NO NO NO NO NO YES

Notes to Table 30:

(1)
Includes nonnumeric literals

(2)
Includes integer numeric literals

(3)
Includes noninteger numeric literals

(4)
Includes Boolean literals

(5)
First character of sending item is moved, regardless of its value

(6)
Boolean, DBCS, DBCS-edited, national, internal and external floating-point, and date-time items are an IBM Extension.

(7)
Includes DBCS literals and SPACE.

(8)
Includes DBCS data-items.

(9)
Figurative constants and nonnumeric literals must consist only of numeric characters and will be treated as numeric integer fields. The ALL literal may not be used as a sending item.

+-------------------------------IBM Extension--------------------------------+

(10)
Includes floating-point literals, external floating-point data items (USAGE DISPLAY), and internal floating-point data items (USAGE COMP-1 or USAGE COMP-2).

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]