VMS Help  —  RMU72  rrd_file_syntax
    The record definition files (.rrd) used by the RMU Load, RMU
    Unload, and RMU Analyze commands are used to describe the field
    data types and field ordering for binary and delimited text data
    files. The .rrd files contain a simple language similar to that
    accepted by the CDO interface of the Oracle CDD Repository. The
    RMU Unload command automatically generates a record definition
    file from the table definition in the database.

    This appendix describes the .rrd language which is accepted
    by the RMU Load command. It describes a useful subset of the
    language supported by RMU. Clauses from CDO which RMU accepts but
    ignores are not described.

1  –  DEFINE FIELD statement

    Each record definition file must include at least one DEFINE
    FIELD statement to describe the data type of a field in the
    unloaded record. This statement has two formats:

    o  a format that defines a new name

       define field name_string datatype is text size is 20 characters.

    o  a format that references another, previously defined, field

       define field first_name based on name_string.

    RMU Unload generates the DEFINE FIELD statement with just
    the DATATYPE clause. The full syntax is shown in DEFINE FIELD
    Statement.

    Figure 2  DEFINE FIELD Statement

  (B)0define-field =                                                         
                                                                           
  DEFINE FIELD <name> qwqqqqqqqqqqqqq> BASED ON <name>  qqqqqqqqqqqqqqqqwq> . q>
                       mqwqwq> DATATYPE IS qqqqqqq> datatypes qqqqqqwqwqj 
                         x tq> DESCRIPTION IS qqqq> /* comment */ qqu x   
                         x mq> FILLER qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x   
                         mqqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqqqqj   
                                                                         
                                            

    The following example of the DEFINE FIELD statement is more
    complete, showing the use of annotations (DESCRIPTION clause)
    and based-on fields.

    define field name_string
        description is
            /* This a generic string type to be used for based on */
        datatype is text size is 20 characters.
    define field first_name
        based on name_string.
    define field last_name
        based on name_string.

    define record PERSON
        description is
            /* Record which describes the PERSON.DAT RMS file */.
        first_name.
        last_name.
    end.

2  –  DEFINE RECORD statement

    The DEFINE RECORD statement defines the ordering of the fields
    within the file. A field may only be used once. The name of
    the field is not used for column name matching unless the
    Corresponding qualifier is used with the RMU Load command.

    Figure 3  DEFINE RECORD Statement

  (B)0define-record =                                                          
                                                                             
  DEFINE RECORD <name> qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq> . qk 
                        mq> DESCRIPTION IS qqqqq> /* comment */ qqqqj      x 
    lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq  <qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
    mwq> <fieldname> qq> alignment-clause qqq> . qwqk                        
     mqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqqqqj x                         
    lqqqqqqqqqqqqqqqqqqqqqqqqqq <qqqqqqqqqqqqqqqqqqj                         
    mqq> END qwqqqqqqqqqqqwqwqqqqqqqqqqqqwqq> . qqqqqqqq>                    
              mq> <name> qj mq> RECORD qqj                                   
                                                                            

  (B)0alignment-clause =                                    
                                                          
  qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> 
   mq> ALIGNED ON qqwq> BYTE qqqqqqwqwqqqqqqqqqqqqqwqj    
                    tq> WORD qqqqqqu mq> BOUNDARY qj      
                    tq> LONGWORD qqu                      
                    tq> QUADWORD qqu                      
                    mq> OCTAWORD qqj                      
                                                          

    The ALIGNED ON clause can be used to adjust for alignment added
    explicitly or implicitly by host language applications. For
    instance, on OpenVMS Alpha many 3GL language compilers naturally
    align fields to take advantage of the Alpha processor hardware
    which executes more efficiently when data is well aligned. The
    default is BYTE alignment.

    In the following example, field C is expected to start on a
    quadword boundary, so A is assigned the first longword, the
    second longword is ignored, and finally the C is assigned the
    last longword value.

    define field A datatype is signed longword.
    define field C datatype is signed longword.
    define record RMUTEST.
       A .
       C aligned on quadword boundary.
    end RMUTEST record.

2.1  –  Usage notes

    o  When the DCL verify process is enabled using the DCL SET
       VERIFY command or the DCL F$VERIFY lexical function, RMU Load
       writes the .rrd file being processed to SYS$OUTPUT.

    o  There is no equivalent to the VARCHAR or VARYING STRING data
       types in the record definition language because there is
       no support for these types in the OpenVMS Record Management
       Services (RMS) environment.

    o  The VARCHAR or VARYING STRING data type is a two-part type
       with an UNSIGNED WORD (16 bit integer) length prefix with a
       fixed TEXT portion. The length defines the actual data in the
       string.

       There is no equivalent to the VARCHAR or VARYING STRING data
       types in the record definition language as this type is not
       supported by the OpenVMS Record Management Services (RMS)
       environment.

       If you unload a VARCHAR column then it will be converted to
       a fixed length (space padded) TEXT field. However, TEXT to
       VARCHAR load and unload is handled appropriately when using
       the delimited format. In this format RMU Unload only outputs
       the text as specified by the length prefix of the VARCHAR
       column. Likewise, RMU Load uses the length of the delimited
       string to set the length in the database.

    o  If a field is not to be used during the load into the table,
       it can be ignored during the load using the FILLER attribute.
       This allows RMU Load to use a data file which has more fields
       than there are columns in the database table.

    o  The <name> referenced in the END RECORD clause must be the
       same as the name defined by the DEFINE RECORD statement.

    o  The record definition files are not used when the Record_
       definition qualifier is omitted. In this case RMU Unload
       generates a structured internal file format which contains
       both the record definition and the data. This format allows
       the unloading of LIST OF BYTE VARYING columns and NULL values.
       This format is the same as that generated by SQL EXPORT for
       its interchange (.rbr) file. Use the RMU Dump Export command
       to format the contents of this file for display.

       $ rmu/unload mf_personnel employees employees.unl
       $ rmu/dump/export/nodata employees.unl

3  –  Additional Data Types

 The data types that are supported by Oracle Rdb are described in
 Oracle Rdb SQL Reference Manual.

    Figure 4  Data Types

  (B)0datatypes =                                                             
                                                                            
  qqwq> date-time-types qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
    tq> TEXT qq> character-size-clause qq> character-set-clause qqqqqqqqqu  
    tq> F_FLOATING qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu  
    tq> G_FLOATING qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu  
    tq> LEFT SEPARATE NUMERIC qwq> scale-clause qq> numeric-size-clause qu  
    tq> PACKED DECIMAL qqqqqqqqu                                         x  
    tq> UNSIGNED NUMERIC qqqqqqj                                         x  
    mq> SIGNED qwq> BYTE qqqqqwqq> scale-clause qqqqqqqqqqqqqqqqqqqqqqqqqj  
                tq> WORD qqqqqu                                             
                tq> LONGWORD qu                                             
                mq> QUADWORD qj                                             
                                                                            

  (B)0numeric-size-clause =                           
                                                    
  qwqqqqqqqqqqqqqwqqq> <number> qqwqqqqqqqqqqqwqq> 
   mq> SIZE IS qqj                mq> DIGITS qj    
                                                    

  (B)0character-size-clause =                                
                                                           
  qwqqqqqqqqqqqqqqqwq> <number> qqwqqqqqqqqqqqqqqqwqq> 
   mqq> SIZE IS qqqj              mq> CHARACTERS qj    
                                                           

  (B)0scale-clause =                          
                                            
  qqwqqqqqqqqqqqqqqqqqwqq> <number> qqq> 
    mqq> SCALE IS qqqqj                  
                                            

  (B)0character-set-clause =                          
                                                    
  qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqq> 
   mq> CHARACTER SET IS qqqqqqq> <cset-name> qqj    
                                                    

    The cset-name is any character set supported by Oracle Rdb. These
    character sets are expanded from release to release. Please refer
    to the Oracle Rdb SQL Reference Manual for new character sets and
    more information on the character sets listed below.

    When several character sets are available for the same language
    (such as Kanji and Hanyu), each is based on a different local or
    international standard that differs from the others in format and
    structure. For instance, SHIFT_JIS is widely used with Microsoft
    Windows systems in Japan, but differs in format from the DEC_
    KANJI character set supported by Hewlett Packard Company's
    DECWindows product.

    Table 22 Character sets supported by Oracle RMU Load

    Character
    Set            Description

    ARABIC         Arabic characters as defined by the ASMO 449 and
                   ISO9036 standards
    BIG5           A set of characters used by the Taiwan information
                   industry
    DEC_HANYU      Traditional Chinese characters (Hanyu) as used
                   in Taiwan and defined by standard CNS11643:1986,
                   supplemental characters as defined by DTSCC and
                   ASCII
    DEC_HANZI      Chinese (Bopomofo) characters as defined by
                   standard GB2312:1980 and ASCII characters
    DEC_KANJI      Japanese characters as defined by the JIS
                   X0208:1990 standard, Hankaku Katakana characters
                   as defined by JIS X0201:1976 prefixed by SS2
                   (8E hex), user-defined characters, and ASCII
                   characters
    DEC_KOREAN     Korean characters as defined by standard KS
                   C5601:1987 and ASCII characters
    DEC_MCS        A set of international alphanumeric characters,
                   including characters with diacritical marks
    DEC_SICGCC     Traditional Chinese characters (Hanyu) as used in
                   Taiwan and defined by standard CNS11643:1986 and
                   ASCII
    DEVANAGARI     Devanagari characters as defined by the ISCII:1988
                   standard
    DOS_LATIN1     DOS Latin 1 code
    DOS_LATINUS    DOS Latin US code
    HANYU          Traditional Chinese characters (Hanyu) as used in
                   Taiwan and defined by the standard CNS11643:1986
    HANZI          Chinese (Bopomofo) characters as defined by
                   standard GB2312:1980
    HEX            Translation of text data to and from hexadecimal
                   data
    ISOLATINARABIC Arabic characters as defined by the ISO/IEC 8859-
                   6:1987 standard
    ISOLATINCYRILLICyrillic characters as defined by the ISO/IEC
                   8859-5:1987 standard
    ISOLATINGREEK  Greek characters as defined by the ISO/IEC 8859-
                   7:1987 standard
    ISOLATINHEBREW Hebrew characters as defined by the ISO/IEC 8859-
                   8:1987 standard
    KANJI          Japanese characters as defined by the JIS
                   X0208:1990 standard and user-defined characters
    KATAKANA       Japanese phonetic alphabet (Hankaku Katakana), as
                   defined by standard JIS X0201:1976
    KOREAN         Korean characters as defined by standard KS
                   C5601:1987
    SHIFT_JIS      Japanese characters as defined by the JIS
                   X0208:1990 standard using Shift_JIS specific
                   encoding scheme, Hankaku Katakana characters as
                   defined by JIS X0201:1976, and ASCII characters
    TACTIS         Thai characters based on TACTIS (Thai API
                   Consortium/Thai Industrial Standard) which is
                   a combination of ISO 646-1983 and TIS 620-2533
                   standards
    UNICODE        Unicode characters as described by Unicode
                   Standard and ISO/IEC 10646 transformation format
                   UTF-16
    UTF8           Unicode characters as described by Unicode
                   Standard and ISO/IEC 10646 UTF-encoding form
    WIN_ARABIC     MS Windows Code Page 1256
                   8-Bit Latin/Arabic
    WIN_CYRILLIC   MS Windows Code Page 1251
                   8-Bit Latin/Cyrillic
    WIN_GREEK      MS Windows Code Page 1253
                   8-Bit Latin/Greek
    WIN_HEBREW     MS Windows Code Page 1255
                   8-Bit Latin/Hebrew
    WIN_LATIN1     MS Windows Code Page 1252
                   8-Bit West European

4  –  Date-Time Syntax

    The date-time syntax in .rrd files generated by the RMU
    Unload command with the Record_Definition=(File=file) command
    is compatible with the date-time syntax support of Oracle
    CDD/Repository V6.1 and later versions.

    The date-time data type has the following syntax in the .rrd
    file.

  (B)0date-time-types =                        
                                                
  qqwq> DATE qwqqqqqqqqqqwqqqqqqqqqqqqqqqqqwqq> 
    x         tq> ANSI  qu                 x    
    x         mq> VMS qqqj                 x    
    tq> TIME qqq> scale-clause qqqqqqqqqqqqu
    tq> TIMESTAMP qq> scale-clause qqqqqqqqu
    mq> INTERVAL qqq> interval-qualifier qqj    
                                                

  (B)0interval-qualifier =                                      
                                                            
  qqwq> YEAR qqq> numeric-size-clause qwqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqwq>
    x                                  mq> TO MONTH qj                         x
    tq> MONTH qq> numeric-size-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
    tq> DAY qqqq> numeric-size-clause qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwu
    x                                  mq> TO qwq> HOUR qqqqqqqqqqqqqqqqqqqqqqux
    x                                          tq> MINUTE qqqqqqqqqqqqqqqqqqqqux
    x                                          mq> SECOND q> scale-clause qqqqjx
    tq> HOUR qqq> numeric-size-clause qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqu
    x                                  mq> TO qwq> MINUTE qqqqqqqqqqqqqqqqqqqu x  
    x                                          mq> SECOND q> scale-clause qqqj x
    tq> MINUTE q> numeric-size-clause qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqu  
    x                                  mq> TO SECOND  qqq> scale-clause qqqqj  x  
    mq> SECOND q> seconds-clause qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  

  (B)0scale-clause =                          
                                            
  qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqq
    mq> SCALE <numeric-literal>  qqj        
                                            

  (B)0numeric-size-clause =             
                                    
  qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqq>  
    mqwqqqqqqqqqqqqqwqqqqqqq> <numeric-literal>  qqk x 
      mq> SIZE IS qqj                              x x
    lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
    mqwqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
      mq> DIGITS qqj

  (B)0seconds-clause =                             
                                                
  qqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqq> 
    mqwqqqqqqqqqqqqqwqqqqqqqqqqqq> <numeric-literal-1> qqqqqqqk  x           
      mqq> SIZE IS qj                                         x  x
       lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj  x
       mqwqqqqqqqqqqqqqwqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqqqqj
         mq> DIGITS  qqj  mq> SCALE <numeric-literal-2> qqqqj
                                               

    Note that SCALE values must be between 0 and -2 and that SIZE IS
    values must be between 2 and 9.

    The following are examples of typical field definitions for date-
    time data types in .rrd files:

    DEFINE FIELD A DATATYPE IS DATE.
    DEFINE FIELD B DATATYPE IS DATE ANSI.
    DEFINE FIELD C DATATYPE IS INTERVAL DAY SIZE IS 2 DIGITS.
    DEFINE FIELD D DATATYPE IS INTERVAL DAY SIZE IS 2 DIGITS TO HOUR.
    DEFINE FIELD E DATATYPE IS INTERVAL DAY SIZE IS 2 DIGITS TO
     SECOND SCALE -2.
    DEFINE FIELD F DATATYPE IS INTERVAL HOUR SIZE IS 4 DIGITS.
    DEFINE FIELD G DATATYPE IS INTERVAL HOUR SIZE IS 2 DIGITS TO MINUTE.
    DEFINE FIELD H DATATYPE IS INTERVAL MINUTE SIZE IS 2 DIGITS TO
     SECOND SCALE -2.
    DEFINE FIELD I DATATYPE IS INTERVAL SECOND SIZE IS 2 DIGITS SCALE -2.
    DEFINE FIELD J DATATYPE IS TIME.
    DEFINE FIELD K DATATYPE IS TIME SCALE -1.
    DEFINE FIELD L DATATYPE IS TIMESTAMP SCALE -2.
    DEFINE FIELD M DATATYPE IS INTERVAL YEAR SIZE IS 3 DIGITS TO MONTH.
Close Help