Input/Output Statements
The input data received from a device by using a Format 1 ACCEPT statement can include DBCS. All DBCS data must be identified by the proper syntax. The input data, excluding shift control characters, replaces the existing contents of a DBCS data item. The shift control characters are included in the contents of the mixed data items. COBOL does not perform special editing or error checking on the data.
If you use the Format 3 ACCEPT statement to get OPEN-FEEDBACK information about a file, that information includes a field showing whether the file has DBCS or mixed data.
Information received from the local data area by a Format 4 ACCEPT statement can include DBCS or mixed character strings. Information received replaces the existing contents. COBOL does not perform any editing or checking for errors. This also applies to information received from the PIP data area by a Format 5 ACCEPT statement, and from a user defined data area by a Format 9 ACCEPT statement.
Using the Format 6 ACCEPT statement, you can get the attributes of a workstation display and its keyboard. For display stations that can display DBCS characters, the system sets the appropriate value in the ATTRIBUTE-DATA data item. You cannot use DBCS characters to name a device.
If you use an extended (Format 7) ACCEPT statement for field-level workstation input, you must ensure that DBCS data is not split across lines. COBOL does not perform any checking for errors or editing, except for the removal of shift in and shift out characters when necessary.
You can specify DBCS or mixed data items or literals in the DISPLAY statement. You can mix the types of data. DBCS and mixed data, from either data items or literals, is sent as it appears to the program device or local data area or user-defined data area that is the target named on the DISPLAY statement.
Because COBOL does not know the characteristics of the device on which data is being displayed, you must make sure that the DBCS and mixed data is correct.
If you use a Format 3 DISPLAY statement or a Format 4 DISPLAY statement for field-level workstation output, you must ensure that DBCS data is not split across lines.
You can use DBCS data items as the RECORD KEY for an indexed file. See Input-Output Section for more information.
You can read a record into a DBCS data item using the INTO phrase. This phrase causes a MOVE statement (without the CORRESPONDING option) to be performed. The compiler moves DBCS data in the same manner that it moves alphanumeric data. It does not make sure that this data is valid.
Use the FROM phrase of this statement to transfer DBCS data from a DBCS data item to an existing record. The FROM phrase causes both types of data to be moved in the same manner as the INTO phrase with the READ statement. (See READ Statement.)
If you use DBCS characters in the key of an indexed file, specify a corresponding data item in the KEY phrase of the START statement.
One of the following must be true:
You can specify valid operators (such as EQUAL, GREATER THAN, NOT LESS THAN) in the KEY phrase. The system can follow either the EBCDIC or a user-defined collating sequence.
Use the FROM phrase of this statement to write DBCS data to a record. This phrase moves the data in the same manner as the REWRITE statement. (See REWRITE Statement.)
You must include the shift control characters when you write the data into a device file.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.