DateModifiedViewsCategory

Characters include letters, numbers, special characters, and other attributes. There are 3 groups of character data type: (1) alpha with letters: A-Z, a-z, and space, (2) numeric characters: 0-9, and (3) any characters. Characters are organized in code pages. Each code page combines a set of characters with a special designation, for example, it can be a region-specific code page. Each character in a code page has a numeric position.

The summary of character data type can be found in COBOL Data Types article.

Storage Description

The character data type represents characters converted from a source code page to the output one. Source code pages are a set of character tables supported by COBOL, for example, ibm037 coding is the most widespread one.

Sample 1

ibm037 code page

The code page is 1 byte. It contains 255 characters.

Converted to uft-8 bytesHelloeverybody!
hex ibm037 bytesc8859393964085a58599a8829684a85a

Sample 2

ibm935 (Chinese) code page

The code page is 2 bytes. It contains 65535 characters.

English characters

Converted to uft-8 bytesHelloeverybody!
hex ibm935 bytesc8859393964085a58599a8829684a85a

Hello everybody! in Chinese

Converted to uft-8 bytesSpecial byte to mark the beginning of a sequence of multi-byte codesSpecial byte to mark the end of a sequence of multi-byte codes!
hex ibm935 bytes0e4af24ed14dc20f5a

COBOL Representation Samples

Alpha Characters

01 VAR-CHARACTER PIC A(5).
01 VAR-CHARACTER PIC A(05).
01 VAR-CHARACTER PIC AAAAA.

Numeric Characters

01 VAR-CHARACTER PIC 9(5).
01 VAR-CHARACTER PIC 9(05).
01 VAR-CHARACTER PIC 99999.

Any Characters

01 VAR-CHARACTER PIC X(5).
01 VAR-CHARACTER PIC X(05).
01 VAR-CHARACTER PIC XXXXX.

Resources

  • ebcdic-parser tool for converting of mainframe EBCDIC data into Unicode ASCII delimited text

Comments

comments powered by Disqus