System i Resources
enskill.com

 

Onsite Classes
Expert System i training comes to you! RPG, SQL, WDSc and more.
 

DVD Training
Self-paced RPG IV classes and labs on your schedule.
 

System i Books
from leading System i authors.
 

e-Learning
Live instructor, no travel. Attend from your office or home.
 

Definition Specification

 *.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
 DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
Columns Description
1–5 Sequence number
6 D
7-21 Data item name. May be blank for filler fields or unnamed data structure.
22 Externally described:
(Blank) = Program described
E = Externally described
23 Data structure type:
(Blank) = Miscellaneous definition
S = Program status data structure
U = Data area data structure
24-25 Type of definition:
(Blank) = Data structure subfield
C = Constant
DS = Data structure
PI = Procedure interface
PR = Prototype
S = Standalone field, array, or table
26-32 From position or reserved word
33-39 To position or length
40 Internal data type:
(Blank) = Character if blank decimal positions entry; otherwise, packed numeric for standalone field or zoned numeric for subfield
A = Character
B = Binary numeric
C = Unicode
D = Date
F = Float numeric
G = Graphic
I = Signed integer numeric
N = Indicator
O = Object
P = Packed-decimal numeric
S = Zoned numeric
T = Time
U = Unsigned integer numeric
Z = Timestamp
* = Basing pointer or procedure pointer
41-42 Decimal positions (0–63, blank)
43 (Reserved)
44–80 File keywords
81–100 Comments

Definition Keywords

ALIGN Aligns data structure subfields of integer or float data type on word boundaries.
ALT(array-name) Names a main array for use with this alternating array.
ALTSEQ(*NONE) Definition ignores alternate collating sequence, if any.
ASCEND Specifies that array or table entries are in ascending order.
BASED(pointer-name) Names a pointer to the address of the data item.
CCSID(*DFT | number) Specifies a character code set identifier.
CLASS(*JAVA:class-name) Names a class for an object definition.
CONST{(constant)}
  1. Specifies the value of a named constant (optional).
  2. Indicates that a parameter is passed by read-only reference.
CTDATA Specifies a compile-time table or array.
DATFMT(format{separator}) Default date format and separator. See Date Formats .
DESCEND Specifies that array or table entries are in descending order.
DIM(numeric-constant) Defines the number of elements in an array or table (1-16773104).
DTAARA{({*VAR:}data-area-name | *LDA
| *PDA)}
Associates the data item with an external data area. May be variable, if *VAR is specified.
EXPORT{(external-name)}
  1. Allows the data item to be accessed by another ILE module, using the IMPORT keyword. This ILE module allocates the storage.
  2. Allows a procedure to be accessed by another ILE module.
EXTFLD(field-name) Renames a subfield in an externally described data structure.
EXTFMT(code) Specifies an external data type for compile-time and pre-runtime numeric arrays and tables:
B = Binary
C = Unicode
F = Float
I = Signed integer
L = Left sign
P = Packed decimal
R = Right sign
S = Zoned decimal
U = Unsigned integer
EXTNAME(file-name{:format-name}{:ALL
| *INPUT | *KEY | *OUTPUT})
Names a file (and optional record format) containing field descriptions used for subfields in data structure. Optionally, may specify fields to use.
EXTPGM(program-name) Names an external program whose prototype is being defined.
EXTPROC({proc-type{:class}:}proc-name) Names an external procedure whose prototype is being defined. Normally takes the format EXTPROC(proc-name), but can also be any of the following:
  1. EXTPROC(*CL:proc-name) for ILE CL procedures that require special data type handling,
  2. EXTPROC(*CWIDEN | *CNOWIDEN:proc-name) for ILE C procedures that require special data type handling,
  3. EXTPROC(*JAVA:class-name:proc-name | *CONSTRUCTOR) for Java methods or for RPG procedures that will be called by Java.
FROMFILE(file-name) Names a file with input data for a pre-runtime array or table.
IMPORT{(external-name)} Indicates that storage for the data item is allocated in another ILE module with the EXPORT keyword. This module can use the same storage.
INZ{(constant) | *EXTDFT | *JOB
| *LIKEDS | *NULL | *SYS |*USER)
Initializes the data item.
LEN(number)

Specifies the data item’s length (1-16773104), for character or graphic data.

LIKE(name)
  1. Specifies that the data item’s attributes (length, type) are based on another variable.
  2. Specifies that an object’s class is the same as another object.
LIKEDS(data-struct-name) Specifies that a data structure, data structure subfield, return value, or parameter has the same subfields as another data structure.
LIKEFILE(file-name) Parameter is a file.
LIKEREC(format-name{:*ALL | *INPUT
| *KEY | *OUTPUT})
Specifies that a data structure, data structure subfield, return value, or parameter has the same subfields as a record format. Optionally, may specify fields to use.
NOOPT Specifies that no optimization be performed for this data item.
OCCURS(numeric-const) Specifies the number of occurrences of a multiple-occurrence data structure (1-16773104).
OPDESC Passes operational descriptors with parameters defined within a prototype.
OPTIONS({*NOPASS} {*NULLIND} {*OMIT}
{*RIGHTADJ} {*STRING} {*TRIM} {*VARSIZE})
Specifies one or more parameter-passing options:

*NOPASS = Parameter need not be passed. *NULLIND = Null byte map will be passed with parameter. *OMIT = *OMIT is allowed for parameter. *RIGHTADJ = Character, graphic, or UCS-2 parameter is right adjusted. *STRING = Parameter may be a pointer or a character expression. *TRIM = Parameter will be trimmed of blanks before being passed. *VARSIZE = Parameter may be shorter than defined length.

OVERLAY(name{:pos | *NEXT}) Specifies that a data structure subfield overlays the storage of another subfield.
PACKEVEN Zeroes out the high-order digit when a packed field has an even number of digits.
PERRCD(numeric-const) Specifies the number of elements per record for an array or table.
PREFIX(prefix-string{:number}) Specifies a string to be prefixed (added or replaced) to subfield names of an externally described data structure.
PROCPTR Defines an item as a procedure pointer.
QUALIFIED Specifies that the subfields in a named date structure must be qualified by the data structure name, i.e., they must be referred to in the format structure.field.
STATIC{(*ALLTHREAD)}
  1. Defines a local variable within static storage, holding its value across procedure calls.
  2. Specifies a Java method as a static method. If not specified, the method is assumed to be an instance method.
TEMPLATE Data item is a template, used only for LIKE or LIKEDS definitions.
TIMFMT(format{separator}) Specifies a time format and separator. See Time Formats .
TOFILE(file-name) Specifies a file to which an array or table is to be written.
VALUE Specifies that a parameter will be passed by value instead of by reference.
VARYING{(2|4)} Indicates a varying-length character or graphic field.

Usage Conventions for syntax tables


Index | HomePage | Programming | RPG IV | Definition Specification