RPG/400 Help

Example of Coding DBCS Data in an RPG/400 Program

Here are some RPG/400 specifications that include DBCS data.

In this figure, 'Kn' represents a DBCS character, 'o' represents shift-out character, and 'i' represents a shift-in character.

This is an EBCDIC example.


*...1....+....2....+....3....+....4....+....5....+....6....+....7...
H........1..CDYI....S..............1.F..............................
H                                                  1

You may check transparent literals and constants by specifying a 1 in column 57 of the control specification.


*...1....+....2....+....3....+....4....+....5....+....6....+....7...
E*
E*oK1K2K3K4iABoK1K2K3K4iCDEFGHoK1K2K3K4K5K6K7K8K9i


*...1....+....2....+....3....+....4....+....5....+....6....+....7...
E....FromfileTofile++Name++N/rN/tbLenPDSArrnamLenPDSComments
E                    ARR         4  5 0             oK1K2i ARRoK1i
E*

DBCS data may be mixed with alphanumeric data in comments.


*...1....+....2....+....3....+....4....+....5....+....6....+....7...
CL0N01N02N03Factor1+++OpcdeFactor2+++ResultLenDHHiLoEqComments++++++
C           'oK1K2K3i'COMP FLDA                 161718
C                     MOVE 'oK1K2K3i'FLDB
C           LABELA    TAG                             'oK1K2K3K4i'
C*

Transparent constants and literals are DBCS data enclosed in apostrophes.


*...1....+....2....+....3....+....4....+....5....+....6....+....7...
OName++++DFBASbSaN01N02N03Field+YBEnd+PConstant/editword+++++++++...
O                                    7 'oK1K2i'
O                                   48 'oK1K2K3K4K5K6K7i'
O                         FLDC      57 '$  0. oK1K2K3i'

You may use DBCS constants in your output specifications.

Error status code 450 will be returned if shift-out and shift-in characters are not properly used.

Here are some sample entries from a compile listing. FLDK1 is a DBCS field in an externally described file.

Figure 69. Sample Key Field Information

                           PHYSICAL      LOGICAL
            FILE/RCD       FIELD         FIELD      ATTRIBUTES
 
 
                           FLDK1                    IGC      6
                           AFLD                     CHAR     3

Figure 70. Sample Cross-Reference Listing

            FIELD       ATTR       REFERENCE (M=MODIFIED D=DEFINED)
 
 
            FLDK1       G(6)        1000010D
            AFLD        A(2)        1000004D


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