Format 2 Considerations

The Format 2 COPY statement (DD, DDR, DDS, or DDSR option) can be used to create COBOL Data Division statements to describe a file that exists on the system. These descriptions are based on the version of the file in existence at compilation time. They do not make use of the DDS source statements for the file.

If a REPLACE statement is in effect, the COPY statement must be the first item on a line of code. This line must also include the text word that specifies the required options, up to at least the initial hyphen.

DDS supports DBCS with formats J (for fields which can contain only DBCS data), E (for fields which can contain either DBCS or alphanumeric data), or O (for fields can contain both DBCS and alphanumeric data). DDS also supports graphic data types with format G. The *PICGGRAPHIC option is used to create COBOL DBCS data items corresponding to format G DDS items. The *PICNGRAPHIC option is used to create COBOL NATIONAL data items with the UCS-2 CCSID specified in the National CCSID compiler option or in the NTLCCSID PROCESS option. All other circumstances produce alphanumeric data items capable of holding the correct number of bytes of data.

The Format 2 COPY statement can be used only in the Data Division, and it is the user’s responsibility to precede the statement with a group level item that has a level-number less than 05.