October 24th, 2008

VARGRAPHIC(length) Data

Posted by admin in F. Data Types

In DB2 the VARGRAPHIC data type can have 0 to 127 characters of 16-bit Double Byte Character Set data in variable length format. With DBCS, each two bytes of data represents a graphic character. This data type is also rarely used. Consult your RDBMS systems manual for further details.

Example:    COL1 VARGRAPHIC(50)

COL1 has up to 100 bytes of up to 50 variable double-byte characters.

In COBOL:  05  COL1-GROUP.
               49 COL1-LENGTH   PIC S9(4) COMP.
               49 COL1          PIC G(50) DISPLAY-1.

In COBOL, G(50) means 100 bytes of 50 DBCS characters.

Oracle’s VARCHAR2(length) has a maximum length of 2000.

Comments are closed.

Sorry, the comment form is closed at this time.