The values that you select for data types in the Web Interaction or Program Call wizards are Program Call Markup Language (PCML) values. PCML provides a uniform way to specify values or types regardless of the ILE or OPM language being used. For example, the definition for an integer in RPG is I and the definition in C++ is int. In PCML you specify an integer as int regardless of the language being used. The Web Interaction wizard writes the PCML code that interacts with your ILE and OPM objects.
In the Web Interaction or Program Call wizards you need to enter the PCML data type values that match your language data types. The tables below indicate the language data types and their corresponding PCML values. For example, to use a 5-digit integer as one of the parameters in your RPG program, you specify the data type as int, the length as 2, and the precision as 15 in the wizards.
Note that the meanings of length and precision are dependent on the data type in use. For example, for an integer, the length attribute refers to the number of bytes required to hold a value; for packed, length refers to the number of digits in the number. Similarly, for int, precision refers to the number of bits required for the number (this allows PCML to determine if it is a signed or an unsigned value). For packed, precision refers to the number of decimal places required.
When specifying the attributes for data types in iSeries Web components, you can choose numeric or character as the data types. For numeric data types, length refers to the number of digits and decimal refers to the number of decimal places. For example, a number such as 12345.67 would be length 7 and decimal 2. For character data types, length refers to the number of characters. Float values in the iSeries Web components are data type character, with length of 14 or 23 to correspond to single and double precision, respectively.
Click on the links below to view the tables equating RPG, C/C++, and COBOL data types with PCML values.
Description of Data Type | RPG Definition | DB Data Type | PCML Values in the Web Interaction wizard and the Program Call wizard | PCML Values in iSeries Web components (Text Entry and Label attributes) |
---|---|---|---|---|
Character (fixed length) | A | A | character |
Character |
Character (variable length) | A (varying) | VARLEN | Supported in the Program Call wizard. |
Not Supported |
Indicator | N | A |
character |
Character |
Binary 2 bytes (1-4) |
B | B | Not Supported | Not Supported |
Float 4 bytes (single precision) | F | F | float |
Character |
Float 8 bytes (double precision) | F | For 8 bytes use |
float |
Character |
Integer 1 byte = 3 digits | I (use 0 decimals) | None | Not Supported | Not Supported |
Integer 2 bytes = 5 digits | I (use 0 decimals) | None | integer |
Numeric |
Integer 4 bytes = 10 digits | I (use 0 decimals) | None | integer |
Numeric |
Integer 8 bytes = 20 digits | I (use 0 decimals) | None | integer |
Numeric |
Packed |
P | P | packed decimal |
Numeric |
Zoned decimal |
S | S | zoned decimal |
Numeric |
Unsigned 2 bytes = 5 digits | U |
None | integer |
Numeric |
Unsigned 4 bytes = 10 digits | U |
None | integer |
Numeric |
Unsigned 8 bytes = 20 digits | U |
None | Not Supported | Not Supported |
Date | D | L | Not Supported | Not Supported |
Time | T | T | Not Supported | Not Supported |
TimeStamp | Z | Z | Not Supported | Not Supported |
Graphic (fixed) | G | G | character |
Not Supported |
Graphic (variable) | G |
G |
Not Supported | Not Supported |
Pointer | * | None | Not Supported | Not Supported |
Procedure Pointer | * |
None | Not Supported | Not Supported |
Data structure containing subfields | DS | None | structure | Not Supported |
C++ Data Type | PCML Data Type | Structure definition | Length | Precision | Count |
---|---|---|---|---|---|
char[n] |
char |
- | n |
- | - |
char | char | - | 1 | - | - |
wchar_t[n] | char | - | n | - | - |
_Packed struct |
struct | <struct> |
- | - | - |
short int | int | - | 2 | 15 | - |
unsigned short int | int | - | 2 | 16 | - |
int | int | - | 4 | 31 | - |
unsigned int | int | - | 4 | 32 | - |
long int | int | - | 4 | 31 | - |
unsigned long int | int | - | 4 | 32 | - |
long long | int | - | 8 | 63 | - |
struct {unsigned int: n}x | Not Supported | - | - | - | - |
float | float | - | 4 | - | - |
double | float | - | 8 | - | - |
long double | float | - | 8 | - | - |
enum | Not Supported | - | - | - | - |
_Decimal T<n,p> | packed | - | n | p | - |
union.element | Not Supported | - | - | - | - |
dataType[n] | type | - | - | - | n |
struct or class | struct | - | - | - | - |
pointer to function | Not Supported | - | - | - | - |
pointer | Not Supported | - | - | - | - |
COBOL Data Type | COBOL Format | PCML Data Type | Length | Precision | Count |
---|---|---|---|---|---|
Character | X(n) | character | n | - | - |
A(n) | character | n | - | - | |
X(n) OCCURS DEPENDING ON m | structure | - | - | m | |
A(n) OCCURS DEPENDING ON m | structure | - | - | m | |
Numeric | 9(n) DISPLAY | zoned decimal | n | 0 | - |
S9(n-p) V9(p) DISPLAY | zoned decimal | n | p | - | |
9(n-p) V9(p) |
packed decimal | n | p | - | |
S9(n-p) V9(p) |
packed decimal | n | p | - | |
9(4) BINARY See Notes 1, 2 |
integer | 2 | 16 | - | |
S9(4) BINARY See Notes 1, 2 |
integer | 2 | 15 | - | |
9(9) BINARY See Notes 1, 2 |
integer | 4 | 32 | - | |
S9(9) BINARY See Notes 1, 2 |
integer | 4 | 31 | - | |
9(18) BINARY See Notes 1, 2 |
integer | 8 | 63 | - | |
S9(18) BINARY See Notes 1, 2 |
Not Supported | - | - | - | |
9(31) BINARY | Not Supported | - | - | - | |
S9(31) BINARY | Not Supported | - | - | - | |
USAGE COMP-1 | float | 4 | - | - | |
USAGE COMP-2 | float | 8 | - | - | |
UCS2 | N(n) See Note 4 |
UCS-2/graphics | n | - | - |
N(n) OCCURS DEPENDING ON m See Note 4 |
structure | - | - | m | |
Graphic | G(n) | UCS-2/graphics | n | - | - |
G(n) OCCURS DEPENDING ON m | structure | - | - | m | |
Index | USAGE INDEX | integer | 4 | 31 | - |
Boolean | 1 | Not Supported | - | - | - |
Date | FORMAT DATE | Not Supported | - | - | - |
Time | FORMAT TIME | Not Supported | - | - | - |
Timestamp | FORMAT TIMESTAMP | Not Supported | - | - | - |
Pointer | USAGE POINTER | Not Supported | - | - | - |
Procedure Pointer | PROCEDURE - POINTER | Not Supported | - | - | - |
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.