Most Recent

DDS (Data Description Specifications.)


DB2 keywords

Source from IBM portal

Unknown Saturday 1 June 2013
DB2 Keywords

DB2 Keywords

1.   Keyword entries for physical and logical files (positions 45 through 80)
Keyword entries are typed in positions 45 through 80 (functions).
Most of the keywords are valid for both physical and logical files. Some, however, are valid only for physical files, and some are valid only for logical files. When this is the case, the restriction is noted both in the keyword title and the text.

2. Specific restrictions
The following keywords are valid only for simple and multiple format logical files:
·                PFILE
·                REFACCPTH
The following keywords are valid only for join logical files:
·                JDFTVAL
·                JDUPSEQ
·                JFILE
·                JFLD
·                JOIN
·                JREF
When you use DDS to describe a source file (typically created without DDS, using the CRTSRCPF command) or when a logical file is based on a physical file to be used as a source file, you cannot use the following keywords:
             ABSVAL
             ALTSEQ
             DESCEND
             FCFO
             FIFO
             LIFO
NOALTSEQ
SIGNED
UNIQUE
VARLEN
ZONE

ABSVAL (Absolute Value) keyword for physical and logical files
You can use this key-field level keyword to direct the operating system to ignore the sign of the field when the system sequences the values associated with this numeric field.


ALIAS (Alternative Name) keyword for physical and logical files
You can use this field-level keyword to specify an alternative name for a field. When the program is compiled, the alternative name is brought into the program instead of the DDS field name.


ALL (All) keyword—logical files only
You can use this select/omit field-level keyword to specify the action to be taken after all other select/omit specifications have been processed for this logical file.


ALTSEQ (Alternative Collating Sequence) keyword for physical and logical files
You can use this file-level keyword to direct the operating system to use an alternative collating sequence table when the system sequences the records of a file member for retrieval, if you specified a key for this file.


ALWNULL (Allow Null Value) keyword—physical files only
You can use this field-level keyword to define this field to allow the null value.


CCSID (Coded Character Set Identifier) keyword for physical and logical files
You can use this keyword to specify a coded character set identifier (CCSID) for character fields. The CCSID keyword is a file- or field-level keyword on physical files, and a field-level keyword on logical files.


CHECK (Check) keyword for physical and logical files
You can use this field-level keyword to specify validity checking in display files.


CHKMSGID (Check Message Identifier) keyword for physical and logical files
You can use this field-level keyword to identify an error message that is associated with validity checking keywords.


CMP (Comparison) keyword for physical and logical files
This keyword is equivalent to the COMP keyword.


COLHDG (Column Heading) keyword for physical and logical files
You can use this field-level keyword to specify column headings used as a label for this field by text management, the query utility, the data file utility (DFU), and the screen design aid (SDA).


COMP (Comparison) keyword for physical and logical files
You can use this field-level keyword to specify validity checking for the field you are defining when the field is referred to later during display file creation. The COMP keyword is equivalent to the CMP keyword.


CONCAT (Concatenate) keyword—logical files only
You can use this field-level keyword to combine two or more fields from the physical-file record format into one field in the logical-file record format you are defining. The name of this concatenated field must appear in positions 19 through 28.


DATFMT (Date Format) keyword for physical and logical files
You can use this field-level keyword to specify the format of a date field. This keyword is valid only for date fields (data type L) or for logical-file zoned fields (data type S), packed fields (data type P), or character fields (data type A) whose corresponding physical file fields are date fields (data type L).


DATSEP (Date Separator) keyword for physical and logical files
You can use this field-level keyword to specify the separator character for a date field. This keyword is valid only for date fields (data type L).


DESCEND (Descend) keyword for physical and logical files
You can use this key field-level keyword to specify that the values of this character, hexadecimal, or numeric key field are retrieved in descending sequence.


DFT (Default) keyword—physical files only
You can use this field-level keyword to specify a default value for a field.


DIGIT (Digit) keyword for physical and logical files
If this key field-level keyword is in effect, only the digit portion (farthest right 4 bits) of each byte of the key field is used when the system constructs a value associated with this key field. The zone portion is zero-filled.


DYNSLT (Dynamic Select) keyword—logical files only
You can use this file-level keyword to indicate that the selection and omission tests specified in the file (using select/omit specifications) are done at processing time.


EDTCDE (Edit Code) and EDTWRD (Edit Word) keywords for physical and logical files
You can use these field-level keywords to specify editing for the field you are defining when the field is referenced later during display or printer file creation. The EDTCDE and EDTWRD keywords do not affect the physical or logical file.


FCFO (First-Changed First-Out) keyword for physical and logical files
You can use this file-level keyword to specify that if records with duplicate key values are retrieved from the same physical or logical file member, the record with the key value that was changed first is the first record retrieved. This is in a first-changed first-out (FCFO) order.


FIFO (First-In First-Out) keyword for physical and logical files
You can use this file-level keyword to specify that if records with duplicate key values are retrieved from the same physical or logical file member, they are to be retrieved in a first-in first-out (FIFO) order.


FLTPCN (Floating-Point Precision) keyword for physical and logical files
You can use this field-level keyword to specify the precision of a floating-point field.


FORMAT (Format) keyword for physical and logical files
You can use this record-level keyword to specify that this record format is to share the field specifications for a previously defined record format. The name of the record format you are defining must be the name of the previously defined record format.


JDFTVAL (Join Default Values) keyword—join logical files only
The JDFTVAL keyword is valid only for join logical files. If this keyword is in effect, the system provides default values for fields when a join to a secondary file does not produce any records.


JDUPSEQ (Join Duplicate Sequence) keyword—join logical files only
You can use this join-level keyword to specify the order in which records with duplicate join fields are presented when your program reads a join logical file.


JFILE (Joined Files) keyword—join logical files only
You can use this record-level keyword to identify the physical files that contain the data to be accessed through the join logical file you are defining.


JFLD (Joined Fields) keyword—join logical files only
You can use this join-level keyword to identify the from and to fields whose values are used to join physical files in a join logical file. These fields are both referred to as join fields.


JOIN (Join) keyword—join logical files only
You can use this join-level keyword to identify which pair of files are joined by the join specification in which you specify this keyword.


JREF (Join Reference) keyword—join logical files only
You can use this field-level keyword in join logical files for fields whose names are specified in more than one physical file. This keyword identifies which physical file contains the field.


LIFO (Last-In First-Out) keyword for physical and logical files
You can use this file-level keyword to specify that records with duplicate key values from the same physical file member are retrieved in a last-in first-out (LIFO) order.


NOALTSEQ (No Alternative Collating Sequence) keyword for physical and logical files
You can use this key field-level keyword to specify that the ALTSEQ keyword specified at the file level does not apply to this key field.


PFILE (Physical File) keyword—logical files only
You can use this record-level keyword to identify the physical files that contain the data to be accessed through the record format that you are defining.


RANGE (Range) keyword for physical and logical files
You can specify this keyword at the field level, the select- or omit-field level, or both.


REF (Reference) keyword—physical files only
You can use this file-level keyword to specify the name of the file from which field descriptions are retrieved.


REFACCPTH (Reference Access Path Definition) keyword—logical files only
You can use this file-level keyword to specify that the access path information for this logical file is to be copied from another physical or logical file.


REFFLD (Referenced Field) keyword—physical files only
You can use this field-level keyword to refer to a field under any of these conditions.


REFSHIFT (Reference Shift) keyword for physical and logical files
You can use this field-level keyword to specify a keyboard shift for a field when the field is referred to in a display file or data file utility (DFU) operation.


RENAME (Rename) keyword—logical files only
You can use this field-level keyword to specify that a field name in the logical record format that you are defining is different from its corresponding physical-file field name.


SIGNED (Signed) keyword for physical and logical files
If this key field-level keyword is in effect, when sequencing the values associated with this numeric key field, the operating system considers the signs of the values 

(negative versus positive values).

SST (Substring) keyword—logical files only
You can use this field-level keyword to specify a character string that is a subset of an existing character, hexadecimal, zoned field, or graphic.


TEXT (Text) keyword for physical and logical files
You can use this record- or field-level keyword to supply a text description (or comment) for the record format or field used for program documentation.


TIMFMT (Time Format) keyword for physical and logical files
You can use this field-level keyword to specify the format of a time field.


TIMSEP (Time Separator) keyword for physical and logical files
You can use this field-level keyword to specify the separator character used for a time field. This keyword is valid only for time fields (data type T).


TRNTBL (Translation Table) keyword—logical files only
You can use this field-level keyword to specify the name of a translation table to be used when the system passes this field between the physical file on the PFILE or JFILE keyword and your program.


UNIQUE (Unique) keyword for physical and logical files
You can use this file-level keyword to specify that records with duplicate key values are not allowed within a member of this physical or logical file.


UNSIGNED (Unsigned) keyword for physical and logical files
You can use this key field-level keyword to specify that numeric fields are sequenced as a string of unsigned binary data. The default values of character, date, time, timestamp, and hexadecimal fields are set to unsigned values.


VALUES (Values) keyword for physical and logical files
You can specify this keyword at the field level, the select/omit-field level, or both.


VARLEN (Variable-Length Field) keyword for physical and logical files
You can use this field-level keyword to define this field as a variable-length field.


ZONE (Zone) keyword for physical and logical files
You can use this key field-level keyword to specify that only the zone portion (farthest left 4 bits) of each byte of the key field is used when the operating system is constructing a value associated with this key field. The digit portion is filled with zeros.

Unknown
RPG III,IV OPCODE REFERANCES

RPG Opcodes

Arithmetic Opcodes

                                i.            ADD
                              ii.            SUB
                            iii.            MULT
                            iv.            SQRT
                              v.            DIV
                            vi.            MVR
                          vii.            Z-ADD
                        viii.            Z-SUB

String Opcodes

                            ix.            MOVE
                              x.            MOVEL
                            xi.            CHECK
                          xii.            CHEKR
                        xiii.            CHECKR (ILE)
                        xiv.            CAT
                          xv.            SCAN
                        xvi.            SUBST
                      xvii.            XLATE

Data Base File Operation Opcodes

                    xviii.            READ
                        xix.            READE
                          xx.            READP
                        xxi.            READPE
                      xxii.            CHAIN
                    xxiii.            WRITE
                    xxiv.            DELET (E)
                      xxv.            UPDAT (E)
                    xxvi.            SETLL
                  xxvii.            SETGT

Display/Subfile File Opcodes

                xxviii.            EXFMT
                    xxix.            CLEAR
                      xxx.            RESET
                    xxxi.            READC

Array Related Opcodes

                    xxxi.            XFOOT
                  xxxii.            MOVEA
                xxxiii.            SORTA
                xxxiv.            LOKUP
                  xxxv.            LOOKUP (ILE)
                xxxvi.            DEFN
              xxxvii.            DEFINE

Structured RPG Opcodes

                xxxvi.             DO
                xxxvii.            DOWxx
               xxxviii.            DOUxx
                 xxxix.            IFxx
                          xl.           ELSE
                          xli.         ANDxx
                        xlii.         ORxx
                      xliii.          SELEC(T)
                      xliv.          WHxx
                        xlv.          WHENxx
                      xlvi.           OTHER
                    xlvii.            ENDxx

Others

                  xxxvi.            CALL
                xxxvii.            PARM
               xxxviii.            PLIST
                  xxxix.            KLIST
                           xl.            KFLD
                          xli.            EXSR
                        xlii.            BEGSR
                      xliii.            ENDSR
                      xliv.            COMP
                        xlv.            CASxx
                      xlvi.            CAB
                    xlvii.            ENDCS
                  xlviii.            SETON
                      xlix.            SETOF (F)
                             l.             EXCEP (T)
                            li.            EVAL
                          lii.            TEST
                         liii.           TESTN
                         liv.            TESTZ
                           lv.            ADDDUR
                          lvi.           SUBDUR
                        lvii.            EXTRCT
                      lviii.            GOTO
                          lix.           RETRN
                            lx.            RETURN (ILE)
                          lxi.            LEAVE
                        lxii.            ITER
                      lxiii.            TIME (      )
                      lxiv.            OCCUR



FACTOR 1    OPCODE       FACTOR 2                RESULT        INDICATOR
The following  Opcodes should be of the mentioned format.

1.         XXXX            CHAIN           YYYY
                                    IF                    (%FOUND)
                                    MOVE                        BAS               VAR1
                                    IF                    NOT % FOUND
                                    MOVEL          BAS                           VAR1
                                    ENDIF
                                    ENDIF

2.           VAR1             DIV                 VAR2                        VAR3

3.                                 MVR                                                 VAR1

4.                                 Z-ADD           VAR1                         VAR2

5.                                 MOVE            VAR2                         VAR3

6.                                 SQRT              VAR1                         FLD1

7.         *LIKE             DEFINE         FLD1                          FLD2
{FLD 1 is already defined field FLD 2 is the field to be defined with the attribute of FLD 1}

8.         FLD1              COMP             FLD2                                                  304050

9.                                GOTO             TAGNAM

10.       TAGNAM      TAG

11.       FLD1              CABxx            FLD2                                                  (optional)

12.       Optional          DO                  Optional

13.                               EXCEPT         Recfmt

14.       SRNAM          BEGSR

15.       FLD 1             CASGT           FLD 2                         SRNAM

16.                               CALL             ‘PGM’

17.                               CALL             ‘PGM’                         LSTNAM

18.       LSTNAM        PLIST            

19.       *ENTRY         PLIST

20.                               PARM                                                 PARAMETER

21.       FLD 1             CAT                FLD 2                         FLD

22.       *NAMVAR    DEFINE                                             DTAARANAM

23.       *NAMVAR    DEFINE         DTAARANAM          D.S.NAM
                                                                                                (General DS)
24.       *LOCK (Opt) IN                    DTAARANAM

25.                               OUT                DTAARANAM

26.                               UNLOCK       DTAARANAM
                                                                                                                        HiLoEq          
27.       VAR/ELEM   LOOKUP       ARAYNAM                                                70

28. 70  VAR/ELEM   LOOKUP       ARAYNAM                                                40

29                                XFOOT           ARYNAM                  FLDx

30.                               MOVEA         ARY1, 5                     ARY2, 9

31.                               SORTA           ARY1

32.       ‘AB’                SCAN             ‘MNBABS’                FLDy              (Eq Lo is option)
            Check matching character                                                                   (Found error Seton)

33.       FLD1              SCAN             FLD2                          FLDx                ’’             ’’

                                    (FLDx,y contain the position value in numeric)

34.       5                      SUBST            VAR1: 3                                 FLD2
                        VAR1=TIRUMALAI
                        (Moves ‘RUMAL’ to FLD2)


35.       ‘AB’                CHECK          FLD1                          FLDx                          ”        ”
                        Check non matching character

A logical file is a database file that describes how data records   contained in one or more physical files are presented to a program.  

The logical file does not contain data records.  

Unknown