Data Definition Language (DDL) Reference Manual Abstract This manual describes the DDL language syntax and the DDL dictionary database. The audience includes application programmers and database administrators. Product Version DDL D40 Supported Release Version Updates (RVUs) This publication supports G02.00 and all subsequent G-series RVUs until otherwise indicated by its replacement publication.
Document History Part Number Product Version Published 098209 DDL D20 September 1993 105918 DDL D30 December 1994 122316 DDL D40 November 1995 426798-001 DDL D40 October 2000 426798-002 DDL D40 November 2004
Data Definition Language (DDL) Reference Manual Glossary Index Figures What’s New in This Manual xi Manual Information xi New and Changed Information About This Manual xiii Audience xiii Organization of This Manual Prerequisite Manuals xiv Related Manuals xv Notation Conventions xv Tables xi xiii 1.
3. Running the DDL Compiler Contents Compiler Listing Comments 2-11 DDL Statements 2-12 DDL Compiler Commands 2-13 3. Running the DDL Compiler DDL Run Command 3-1 Running DDL in Noninteractive Mode 3-2 Running DDL in Interactive Mode 3-3 Completion Code Processing 3-5 4. Named Constants CONSTANT Statement 4-1 Standard SPI Constants 4-9 5.
7. SPI Tokens Contents JUSTIFIED Clause 6-12 KEYTAG Clause 6-13 LN Clause 6-14 MUST BE Clause 6-16 NULL Clause 6-20 OCCURS Clause 6-21 OCCURS DEPENDING ON Clause PICTURE Clause 6-26 REDEFINES Clause 6-32 SPI-NULL Clause 6-35 SQLNULLABLE Clause 6-38 TACL Clause 6-44 TYPE Clause 6-47 UPSHIFT Clause 6-73 USAGE Clause 6-74 VALUE Clause 6-79 66 RENAMES Clause 6-85 88 Condition-Name Clause 6-86 89 Enumeration Clause 6-89 6-24 7.
9.
10.
A. DDL Messages Contents Making Major Modifications 10-12 Changing Dictionary Security 10-14 Moving a Dictionary 10-14 Moving a Nonaudited Dictionary 10-15 Moving an Audited Dictionary 10-15 Purging a Dictionary 10-18 Increasing Dictionary File Size 10-19 Rebuilding a Dictionary 10-20 Rebuilding a Nonaudited Dictionary 10-20 Rebuilding an Audited Dictionary 10-21 Converting a Dictionary 10-21 A. DDL Messages Warnings and Errors A-1 DDL Error and Warning Messages A-1 B.
E. Dictionary Reports Contents DICTOUF Fields D-33 DICTRDF Fields D-35 DICTTKN Fields D-41 DICTTYP Fields D-42 DICTVER Fields D-44 Definition and Record Storage in the Dictionary Dictionary Definition File D-45 Object Definition File D-46 Object Build List D-46 Object Text File D-47 Record Definition File D-47 Key Definition File D-48 Dictionary Structure Link Diagram D-48 D-45 E.
G.
Glossary Contents Glossary Index Figures Figure 1-1. Figure 1-2. Figure 1-3. Figure 1-4. Figure 1-5. Figure 1-6. Figure D-1. Figure D-2. Figure E-1. Figure E-2. DDL Overview 1-2 Creating a Dictionary 1-5 Creating Database Files 1-7 Generating Source Code 1-9 Maintaining a Dictionary 1-11 Examining a Dictionary 1-13 Sample Dictionary Schema for a Definition and a Record Main Links Among Dictionary Files D-49 Creating a Dictionary for DDSCHEMA E-4 Running DDQUERYS to Produce Reports E-6 Tables Table 2-1.
Contents Table D-4. Table D-5. Table E-1. Table G-1.
What’s New in This Manual Manual Information Data Definition Language (DDL) Reference Manual Abstract This manual describes the DDL language syntax and the DDL dictionary database. The audience includes application programmers and database administrators. Product Version DDL D40 Supported Release Version Updates (RVUs) This publication supports G02.00 and all subsequent G-series RVUs until otherwise indicated by its replacement publication.
What’s New in This Manual New and Changed Information Data Definition Language (DDL) Reference Manual—426798-002 xii
About This Manual This manual describes the Data Definition Language (DDL), an HP product for defining data objects and for translating object definitions into source code for programming languages and for other products on HP NonStop systems. DDL objects include constants, field and group definitions, records, and three types of Subsystem Programmatic Interface (SPI) objects: token codes, token maps, and token types.
Prerequisite Manuals About This Manual • • • • • • • • • • • • • • • Section 2, DDL Language Elements, describes the language elements you can use in DDL statements and commands, and the rules for entering statements, commands, and comments associated with statements. Section 3, Running the DDL Compiler, explains how to run DDL with input from a source file and with input from an interactive terminal.
Related Manuals About This Manual • • • • Introduction to Tandem NonStop Systems (K-series systems only) Introduction to HP NonStop S-Series Servers (S-series systems only) Guardian User’s Guide Enscribe Programmer’s Guide If you are an application programmer, these manuals are also prerequisites: • • • Guardian Programmer’s Guide Introduction to Data Management The HP manuals for languages that you want DDL to translate object definitions into.
General Syntax Notation About This Manual UPPERCASE LETTERS. Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required. For example: MAXATTACH lowercase italic letters. Lowercase italic letters indicate variable items that you supply. Items not enclosed in brackets are required. For example: file-name computer type. Computer type letters within text indicate C and Open System Services (OSS) keywords and reserved words.
General Syntax Notation About This Manual … Ellipsis. An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times. For example: M address [ , new-value ]… [ - ] {0|1|2|3|4|5|6|7|8|9}… An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times. For example: "s-char…" Punctuation.
Notation for Messages About This Manual !i:i. In procedure calls, the !i:i notation follows an input string parameter that has a corresponding parameter specifying the length of the string in bytes. For example: error := FILENAME_COMPARE_ ( filename1:length , filename2:length ) ; !i:i !i:i !o:i. In procedure calls, the !o:i notation follows an output buffer parameter that has a corresponding input parameter specifying the maximum length of the output buffer in bytes.
Notation for Management Programming Interfaces About This Manual either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines. For example: obj-type obj-name state changed to state, caused by { Object | Operator | Service } process-name State changed from old-objstate to objstate { Operator Request. } { Unknown. } | Vertical Line.
Change Bar Notation About This Manual Change Bar Notation Change bars are used to indicate substantive differences between this manual and its preceding version. Change bars are vertical rules placed in the right margin of changed portions of text, figures, tables, examples, and so on. Change bars highlight new or revised information. For example: The message types specified in the REPORT clause are different in the COBOL environment and the Common Run-Time Environment (CRE).
1 Introduction to DDL The Data Definition Language (DDL) product enables you to define data objects in Enscribe files and to translate these object definitions into source code for programming languages and other products on HP NonStop systems. The DDL language has statements to define data objects and commands to control how the statements are compiled.
Using DDL Definitions Introduction to DDL file or directly from a terminal. In either case, the DDL compiler checks the syntax and semantics of all statements and commands. The DDL compiler translates the statements that define DDL objects into internal data definition format. If a dictionary is open for read and write access, DDL writes the compiled objects to the dictionary.
Using DDL Definitions Introduction to DDL • Create a data dictionary A DDL dictionary is a DDL database that contains the objects defined in a schema. When you run DDL to compile the source schema, you can direct DDL to store the object definitions from the schema in an open dictionary. • Create a database You can direct DDL to generate FUP commands from the record definitions in a source schema or dictionary and to write these commands to an EDIT file.
Creating a Dictionary Introduction to DDL other objects, and so forth. You can, if you choose, modify the supplied queries or write your own. Creating a Dictionary A DDL dictionary is a database consisting of 14 prenamed and predefined files. Because the files have fixed names, you can have only one dictionary on any subvolume. A DDL data dictionary can be created either by running the DDL compiler or by running Pathmaker, a NonStop™ Transaction Services/MP (NonStop™ TS/MP) application systems generator.
Creating a Database Introduction to DDL 2. Run the DDL compiler using the source schema as the input file, or run DDL interactively, submitting the source schema with a SOURCE command. In either case, use the DICT or DICTN command to open the dictionary on a specified volume and subvolume or on the default volume and subvolume. Optionally, you can specify a print device to receive the compiler listing. Figure 1-2. Creating a Dictionary Build schema in EDIT file 1 10> TEDIT schema DEF. . . . . . RECORD.
Creating a Database Introduction to DDL code. For information on file attributes that you cannot specify in DDL, see the File Utility Program (FUP) Reference Manual. When you finish editing the file creation commands, you can run the FUP program using the FUP command file as the source file. FUP creates the files according to the file attributes originally specified in the DDL RECORD statements.
Generating Source Code Introduction to DDL Figure 1-3. Creating Database Files 1 Generate FUP command file from dictionary 12> DDL DICT !?FUP fupfile !OUTPUT RECORD *. !EXIT 2 Edit FUP command file. (optional step) 13> TEDIT fupfile . . . 3 Create database files Dictionary DDL FUP Command File PS TEXT EDIT Edited FUP Command File Database 14> FUP / IN fupfile / FUP VST003.
Generating Source Code Introduction to DDL the schema, it opens a file for each specified language, translates the subsequent object definition statements into source code for those languages, and writes the code to the language files. You can also generate source code from an existing dictionary. To do this, you could add a language command to your schema and recompile the entire schema.
Generating Source Code Introduction to DDL Figure 1-4. Generating Source Code 1 Generate source code (entire schema) 15> DDL / IN schema / ? DICT ? COBOL Source cobfile Schema DEF . . . . . . RECORD . . . DDL COBOL Source Code Dictionary Dictionary 2 Generate source code (selected records and definitions) 16> DDL DICT !?COBOL cobfile !OUTPUT RECORD rec1 rec2. !OUTPUT DEF def1 def2. !EXIT DDL COBOL Source Code VST004.
Maintaining a Dictionary Introduction to DDL Host-language source files used by native programs and shared with TNS programs must be generated using a version D40 or later DDL compiler. Host-language source files supplied by HP have already been generated by the correct version of the DDL compiler. If your native programs do not share host-language source files with TNS programs, you can direct DDL to align data optimally for the native RISC environment.
Examining a Dictionary Introduction to DDL 2. Change a referenced object. Open the dictionary and a new DDL source schema file. Use an OUTPUT UPDATE statement to identify all objects that refer to the object you want to change and write the necessary statements to the open DDL source schema file. Close the source schema file and edit the DDL file, if necessary. Then compile the source statements into the open dictionary with a SOURCE command. Figure 1-5.
Examining a Dictionary Introduction to DDL object, this report lists its type and size, its byte offset from the start of a group definition, and any definitions referenced by other objects. You can also generate reports on the dictionary itself. HP supplies a set of Enform queries that provide information about any dictionary. These reports are particularly useful for anyone acting as the administrator of a database. The reports: • • • • Show all the components of a dictionary.
Examining a Dictionary Introduction to DDL Figure 1-6. Examining a Dictionary 1 Produce schema report 19> DDL !? REPORT $S.#printer !? SOURCE schema ! EXIT 2 Source Schema DDL Schema Report Produce dictionary reports Dictionary 20> ENFORM / IN $ system.system ddquerys / DICT $system.ddl ENFORM Dictionary Reports VST006.
Introduction to DDL Examining a Dictionary Data Definition Language (DDL) Reference Manual—426798-002 1- 14
2 DDL Language Elements A DDL source schema consists of DDL statements, DDL compiler commands, and comments. You must enter statements, commands, and comments according to strict syntax, or rules of form. This section introduces the DDL syntax by describing the language elements common to statements and commands, the comments associated with statements, and the rules for entering DDL statements and commands. The syntax of the statements and commands is described in sections 4 through 9 of this manual.
DDL File Names DDL Language Elements ° Underscore (_) Note. DDL supports the underscore as a part of the identifier. • • • The name must start with a letter or an underscore. The name must not end with a hyphen. Uppercase letters are not distinguished from lowercase letters unless specified. Some examples of valid DDL names follow: A1 field-2 Employee-record-1 NEW-EMPLOYEENUMBER _EMP _EMP_ ZSPI-TKN-RETCODE SPI name (see note) VST200.vsd Note.
DDL Language Elements Local File Names The syntax of a local file name follows. [$volume-name.][subvolume-name.]file-name volume-name is preceded by a dollar sign ($) and consists of 1 to 7 alphabetic or numeric ASCII characters; the first character must be alphabetic; if volume-name is omitted, the current default volume is used.
DDL Locale Names DDL Language Elements file-identifier consists of 1 to 8 alphabetic or numeric ASCII characters; the first character must be alphabetic. These are examples of valid file names: \DALLAS.$DATA.SALES.CUSTOMER Network file name $DATA.SALES.CUSTOMER Fully qualified local file name $DATA.CUSTOMER Local file name; assumes current default subvolume SALES.CUSTOMER Local file name; assumes current default volume CUSTOMER Local file name; assumes current default volume and subvolume.
DDL Numbers DDL Language Elements charset is a string forming a HP internal character set name. For example, the locale name da_DK.ISO8859-1 would be specified as LN"da_DK.ISO8859-1" and would consist of the language-code da, the territory-code DK, and the charset value ISO8859-1. If there is more than one literal specified with the same locale name for a text item, an error occurs. The literal with the duplicate locale name is ignored.
DDL Keywords and Reserved Words DDL Language Elements If the string contains quotation marks, you must enter each quotation mark twice to distinguish the quotation mark character from the string delimiter. You can use either single or double quotation marks as string delimiters. Examples of DDL strings follow: "C00" "12.650" "Enter a 2-character state code." "M<(999) 999-9999>" "Use quotes "" "" before and after the name." 'Use quotes '' '' to delimit a string.
DDL Reserved Words DDL Language Elements HEADING HOUR HELP HIGH-NUMBER HIGH-VALUE ICOMPRESS IS INDEX INDEXED INTERVAL JUST JUSTIFIED KEY KEY-SEQUENCED KEYTAG LN LOW-VALUES LOGICAL LOW-NUMBER LOW-VALUE MAXEXTENTS MINUTE MONTH MUST N NOVERSION NO NULL NOT NOVALUE OCCURS OUTPUT ODDUNSTR OF ON PHANDLE PIC PACKED-DECIMAL PICTURE QUOTE QUOTES RECORD RENAMES REDEFINES RIGHT REFRESH RELATIVE SECOND SETLOCALENAME SPACES SQL-NULLABLE SEQ SPI-NULL SSID SEQUENCE SHOW SQL SUBVOL
DDL Special Characters DDL Language Elements CHARACTER COMPLEX FILLER FLOAT OF ON TIME TIMESTAMP In addition to checking for reserved words, the DDL compiler checks DDL names to see if they are reserved words in a host language for which DDL is generating source code. If a DDL name is a host-language reserved word, DDL issues an error message and does not generate source code for the object identified by the reserved word or containing an element identified by the reserved word.
DDL Comments DDL Language Elements DDL Comments The DDL compiler supports two kinds of comments: • • Dictionary comments, which DDL stores in the dictionary and in all open language source-code files Listing comments, which appear only in the compiler listing A dictionary comment is indicated by an asterisk in the first column of the source line. A listing comment is preceded by an exclamation point and ended by another exclamation point or by the end of the source line.
DDL Language Elements Dictionary Comments A comment can precede a field or group description within a DEFINITION or RECORD statement; for example: DEFINITION custinfo. * This field contains a unique customer identifier: 02 custnum PIC 9(4). * This group contains the customer name in sequence: 02 custname. 04 last-name PIC X(12). 04 first-name PIC X(8). 04 initial PIC X(2).
Compiler Listing Comments DDL Language Elements Compiler Listing Comments DDL puts listing comments only in its compiler listing, not in the dictionary or in hostlanguage source-code files. Like dictionary comments, DDL has two kinds of listing comments: • • User-defined comments Production comments User-Defined Listing Comments DDL always puts user-defined listing comments in its compiler listing. You cannot suppress these comments as you can dictionary comments.
DDL Statements DDL Language Elements DDL Statements DDL statements define, modify, delete, and display DDL objects. DDL statements must conform to the following rules of form: • • • • Every simple statement except EXIT must end with a period. Every compound statement must end with END, optionally followed by a period.
DDL Compiler Commands DDL Language Elements Table 2-2. DDL Statement Summary Statement Function Section RECORD Defines a record—the record structure and physical characteristics of a disk file. The defined record can be added to an open dictionary, compiled into FUP file creation commands, or compiled into a DDL or hostlanguage source-code file. 5, 6 SHOW USE OF Lists all the DDL objects in an open dictionary that directly or indirectly refer to a specified object.
DDL Language Elements DDL Compiler Commands The DDL compiler commands are described in Section 9, DDL Compiler Commands. Table 9-1 on page 9-1 summarizes the commands.
3 Running the DDL Compiler You can run the DDL compiler in either of two ways: • • Entering an entire source schema to the compiler from a source file Entering individual source lines interactively from the keyboard To initiate either method, invoke the DDL compiler with a command interpreter RUN command. This section provides information about run options, running DDL in noninteractive and interactive mode, and processing completion codes.
Running the DDL Compiler Running DDL in Noninteractive Mode OUT [ listing-destination ] is the name of the output device or disk file to which the DDL compiler writes its listing. If you omit the OUT run option, DDL sends the listing to its home terminal. If you specify OUT but omit listing-destination, DDL does not produce a listing.
Running the DDL Compiler • • • Running DDL in Interactive Mode Compiles the statements in ddl-source-file and produces a compiler listing at listing-destination, which you can specify in the OUT run option of the DDL run command. Performs the actions specified by any compiler control commands in the DDL run command or in ddl-source-file. DDL processes the commands specified in the run command first, then processes the commands specified in the source schema as it encounters them.
Running the DDL Compiler Running DDL in Interactive Mode Guidelines Because errors are difficult to correct while you enter statements interactively, you should not try to enter an entire schema in interactive mode. Rather, you should specify a large source schema in an EDIT file, in which you can correct mistakes as you type. Then, when the schema is correct, specify the EDIT file in a DDL SOURCE command or in the IN run option of the DDL run command.
Running the DDL Compiler • • • • • Completion Code Processing If a dictionary exists on the default subvolume, open the dictionary for update access and delete all the dictionary objects it contains; otherwise, create a dictionary on the current default volume and subvolume. Issue a prompt (!) for input from the terminal. Parse the DEFINITION statement as it is entered, ending with END. Compile the DEFINITION statement and write production comments to the terminal.
Running the DDL Compiler Completion Code Processing Data Definition Language (DDL) Reference Manual—426798-002 3 -6
4 Named Constants A constant is a DDL dictionary object that has a name, a data type, and a value. You define a constant in a CONSTANT statement, and you can refer to a constant value by name in other DDL statements. This section describes the CONSTANT statement and its components. CONSTANT Statement The CONSTANT statement defines a constant and adds it to the currently open DDL dictionary. Having been added to a dictionary, the named constant can then be used as a literal value in other DDL statements.
CONSTANT Statement Named Constants "string" specifies the value of a string constant; string is a string of from 1 to 130 ASCII characters. national-literal is a national literal of the following form: { N } { "2-byte-character..." } { n } { ‘2-byte-character...’ } Each 2-byte-character must be 2 bytes in length internally; the first byte cannot contain the binary equivalent of a quotation mark. You cannot separate the N or n and the opening quotation mark with a space or a line break.
CONSTANT Statement Named Constants TYPE Clause Guidelines Each type of numeric constant has a different range of valid values, as Table 4-1 shows. Table 4-1.
CONSTANT Statement Named Constants If you use the version number for a comparison check with other version numbers, you can use the number as is. If you need to decode the number to determine the specified release, do this: • • Obtain the letter of the release by dividing the number by 256. The quotient is the ASCII decimal representation of the uppercase letter; any remainder is ignored.
CONSTANT Statement Named Constants C Guidelines The following points are guidelines for generating C source code from CONSTANT statements: • • • • If you request C source-code output, by giving the C command, DDL generates #defines for named constants. DDL converts any hyphen in the constant name to an underscore (_) in the #define name. DDL generates uppercase letters for names that follow #define.
CONSTANT Statement Named Constants Pascal Guidelines The following points are guidelines for generating Pascal source code from CONSTANT statements: • • • • • • If you request Pascal source-code output, by giving the PASCAL command, DDL generates Pascal constants. DDL converts any hyphen in the constant name to an underscore (_) in the Pascal constant name. Pascal does not support the TYPE clause in the CONSTANT statement. For a string constant, DDL generates a Pascal FSTRING constant.
CONSTANT Statement Named Constants • • For a version constant, DDL generates a TACL TEXT variable that contains the version number. The internal representation of a DDL constant in TACL differs from the following representations: ° ° The internal representation of DDL constants in pTAL, TAL, and COBOL. The internal representation of all other DDL objects in TACL.
CONSTANT Statement Named Constants CONSTANT Statement Examples The following examples illustrate CONSTANT statements that define string, numeric, and version constants: CONSTANT prog-name VALUE IS "MYPROG". CONSTANT myprog VALUE IS prog-name. CONSTANT zspi-val-tandem-owner VALUE IS "TANDEM ". CONSTANT hundred CONSTANT double-hundred CONSTANT quad-num CONSTANT zspi-val-msghdrsize UNSIGNED. VALUE VALUE VALUE VALUE IS 100. 100 TYPE BINARY 32. 800000 TYPE BINARY 64.
Standard SPI Constants Named Constants Standard SPI Constants Subsystems that use DSM are provided with a set of CONSTANT statements to define standard values for use in SPI messages. For the names and descriptions of standard SPI constants, see the SPI Programming Manualand the SPI Common Extensions Manual.
Named Constants Standard SPI Constants Data Definition Language (DDL) Reference Manual—426798-002 4- 10
5 Definitions and Records Definitions and records are DDL dictionary objects that describe data structures and disk-file record structures, respectively. A definition (or DEF) consists of the name, data type, size, and other attributes of a field (elementary item) or of a named group of fields in a data structure. A record consists of the record structure of an Enscribe disk file. Usually, a record also includes file creation information so that FUP can create a file from the record structure.
Definitions and Records Exceptions for Specifying Definition Clauses This form defines a group of fields or groups. A group DEFINITION statement consists of a name and any of the field definition clauses that are legal for groups, terminated by a period and followed by one or more field or group descriptions. The entire group DEFINITION statement is terminated by END. Reference This form defines a field or group by referring to a previous definition.
Definitions and Records Field Definition Syntax Field Definition Syntax The following is the syntax of the DEFINITION statement when used to define a field: DEF[INITION] def-name { PICTURE clause } { TYPE clause } [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ AS clause ] BEGIN ] DISPLAY clause ] EDIT-PIC clause ] EXTERNAL clause ] HEADING clause ] HELP clause ] JUSTIFIED clause ] MUST BE clause ] NULL clause ] SPI-NULL clause ] [NOT] SQLNULLABLE clause ] TACL clause ] UPSHIFT clause ] USAGE clause ] VALUE clause ] .
Group Definition Syntax Definitions and Records Group Definition Syntax The syntax of the DEFINITION statement when used to define groups of fields follows. DEF[INITION] def-name [ [ [ [ [ [ [ [ DISPLAY clause ] EXTERNAL clause ] HEADING clause ] HELP clause ] NULL clause ] [NOT] SQLNULLABLE clause ] USAGE clause ] VALUE clause ] . Line-item specification line-item specification ... [ 66 RENAMES clause . ] ... END [ .
Definitions and Records Reference Definition Syntax Reference Definition Syntax The following is the syntax of the DEFINITION statement when used to define a reference to a previous definition: DEF[INITION] def-name-1 TYPE def-name-2 [ [ [ [ [ [ [ [ [ [ [ [ [ [ AS clause ] BEGIN ] DISPLAY clause ] EDIT-PIC clause ] EXTERNAL clause ] HEADING clause ] HELP clause ] MUST BE clause ] NULL clause ] SPI-NULL clause ] TACL clause ] UPSHIFT clause ] USAGE clause ] VALUE clause ] . [ 88 condition-name clause .
Definitions and Records Syntax Elements def-name-2 is the name of an existing definition in the open DDL dictionary. { PICTURE clause | TYPE clause} declares the data type and size of a field. A PICTURE clause cannot describe a group. A TYPE clause can refer to an existing definition in the open dictionary. AS clause specifies a default display string for a field of type ENUM.
Definitions and Records Syntax Elements JUSTIFIED clause tells the DDL compiler to output the JUSTIFIED RIGHT clause in COBOL source files. LN clause specifies the language, territory, and character set for a text item. MUST BE clause specifies the set of valid values that can be entered into a field. Requesters generated by the Pathmaker product enforce the MUST BE constraints; userwritten programs must be coded to enforce them.
Definitions and Records Syntax Elements UPSHIFT clause specifies that ASCII characters entered in this field must be upshifted. Requesters generated by the Pathmaker product upshift character strings entered into this field; user-written programs must be coded to upshift them. USAGE clause declares numeric storage allocation for a field or group. VALUE clause declares an initial value for a field or an alphanumeric group.
Definitions and Records Syntax Elements 66 RENAMES clause renames a previously declared field or group or a set of fields or groups, only for COBOL or DDL source code. END [ . ] ends a group DEFINITION statement, or ends a single-field DEFINITION statement that includes BEGIN. Field Definition Guidelines Field DEFINITION statements must conform to the following rules: • • • A field DEFINITION statement must have a PICTURE or TYPE clause to declare its data type and size.
Syntax Elements Definitions and Records Level Number Guidelines Level numbers must conform to the following rules: • • • • • The DEFINITION statement does not have a level number; it is implicitly at the 01 level. Each group and field within a group DEFINITION statement has a level number to indicate its relationship to other groups and fields within the group. A group of level n includes all following groups and fields with level numbers greater than n up to the next group or field of level n or less.
Definition Error Handling Definitions and Records 89 write-error . END. Group Definitions: DEF address . 03 street-address . 05 street-no PIC X (8) . 05 street PIC X (12) . 05 apt-ro PIC X (4) . 03 city PIC X (14) . 03 state-cd PIC X (2) . 03 zip PIC 9 (5) . END . DEF phone . DISPLAY "N<( 999) 9999999>" 03 area-cd PIC 9 (3) . 03 prefix PIC 9 (3) . 03 numb PIC 9 (4) . Note optional period END . DEF cust-info . 03 company-name TYPE * HEADING "Company" . 03 cust-address TYPE "address" HEADING "Address" .
Definitions and Records RECORD Statement RECORD Statement The RECORD statement defines a disk file record; specifies the record’s file name and type; and if the file is structured, identifies the key fields and assigns a key specifier to any alternate keys. If a dictionary is open, DDL stores the record in the dictionary. If a record of the same name already exists, DDL replaces the existing record with the new record.
Definitions and Records Parts of the RECORD Statement The syntax of the RECORD statement is as follows: RECORD record-name . [ file-creation ] record-structure [ key-assignment ] END [ . ] record-name is a DDL name that uniquely identifies the record in a dictionary. No record can have the same name as any other object in the dictionary. For rules governing DDL names, see Section 2, DDL Language Elements.
File-Creation Syntax Definitions and Records File-Creation Syntax The following describes the syntax of the file-creation portion of a RECORD statement. FILE IS { ["]file-name["] } { TEMPORARY } [ creation-attribute ] ...
Definitions and Records File-Creation Syntax { KEY-SEQUENCED | RELATIVE | ENTRY-SEQUENCED | UNSTRUCTURED } specifies an Enscribe file type. The first three specify structured files that can have keys. For a description of file types, see the Enscribe Programmer’s Guide. If the file type is omitted, DDL assigns a default file type, as explained under File Creation Guidelines on page 5-22. AUDIT causes DDL to specify AUDIT when creating FUP source. AUDIT designates the file as audited by the TMF.
Definitions and Records File-Creation Syntax CODE { file-code | constant-name } assigns a file code to a file. The default setting for a file code is 0. file-code is an integer between 0 and 65,535. File codes 100 through 999 are reserved for use by HP. constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid file-code value. { COMPRESS | DCOMPRESS | ICOMPRESS } sets index compression or data compression or both.
Definitions and Records Reference Record Structure Syntax MAXEXTENTS { maximum-extents | constant-name } sets the maximum number of extents the file can have. The default value for MAXEXTENTS is 100. maximum-extents is an integer from 1 to n, in which n is determined by the available free space in the file label. constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid maximum-extents value.
Record Structure Syntax Definitions and Records Record Structure Syntax The following describes the syntax used to define a record structure. Detailed syntax and guidelines for each of the individual clauses are given in Section 6, Definition Attributes. line-item specification ... [ 66 RENAMES clause . ] ...
Definitions and Records Record Structure Syntax group-name is a DDL name that identifies a group of fields or groups in a record. The name must be unique within the record or, if part of a group, within the group. FILLER is an unnamed field that reserves storage space within a record. { PICTURE clause | TYPE clause } declares the data type and size of a field in the record structure. A PICTURE clause cannot describe a group. A TYPE clause can refer to an existing definition in the open dictionary.
Definitions and Records Record Structure Syntax MUST BE clause specifies the set of valid values that can be entered into a field. Requesters generated by Pathmaker enforce the MUST BE constraints; user-written programs must be coded to enforce them. NULL clause assigns a null value to a field or group used as an alternate key in an Enscribe structured file. OCCURS clause declares a subscripted array of like fields or like groups.
Definitions and Records Key Assignment Syntax 89 enumeration clause associates a name with a specified or default enumeration value and, optionally, specifies a display string for the value. 66 RENAMES clause renames a previously declared field, group, or set of fields or groups, only for COBOL or DDL source code. Key Assignment Syntax The following syntax is used to define key assignments.
Definitions and Records Key Assignment Syntax FILE IS ["]file-name["] identifies the alternate key file for the specified key; file-name is a DDL local or network file name. You can enclose the file name in quotation marks. The default file name is the primary file name with a number appended. DUPLICATES [ NOT ] ALLOWED specifies whether to allow duplicate alternate key values. You cannot specify DUPLICATES ALLOWED for a primary key field. The default is to allow duplicate alternate keys.
Key Assignment Syntax Definitions and Records • DDL file creation defaults and those of FUP differ in the following ways: ° If file-creation is omitted, DDL assigns a file type as follows: File Type Condition Key-sequenced If the record has a primary key Unstructured If the record has no keys; an unstructured file can have a SEQUENCE IS clause Entry-Sequenced If the record has one or more alternate keys and a SEQUENCE IS clause but no primary key Relative If the record has one or more alternat
Key Assignment Syntax Definitions and Records • • • • Every field description must have a PICTURE or TYPE clause. A group description cannot have a PICTURE clause. A TYPE clause for a field within a record structure can refer to a field or group definition previously stored in a data dictionary. When a field is defined by referring to a group definition, it effectively becomes a group.
Key Assignment Syntax Definitions and Records Key Assignment Guidelines The following points are guidelines for making key assignments: • • • • • Only key-sequenced records can have a key-specifier with a value of 0, indicating a primary key. Key-sequenced records must have one and only one primary key. A key defined with a nonzero key specifier, such as “NM” or 32000, is an alternate key. Unstructured file records cannot have alternate keys. For COBOL, keys must be alphanumeric.
Key Assignment Syntax Definitions and Records The CUST record derives its record structure from the definition of CUSTINFO: RECORD cust . FILE IS "$data.sales.customer" . KEY-SEQUENCED . File name File type Record structure DEF IS custinfo . Primary Key Alternate Key KEY IS cust.custnum . KEY "nm" IS cust.custname . END . VST502.vsd Notice that the key fields are qualified by the record name. The record SUPPLIER-INFO requires the alternate key to be unique: RECORD supplier-info . FILE IS "$data.
Definitions and Records RECORD Statement Error Handling KEY "KY" IS f-2 FILE IS "AltKy" UPDATE NOT ALLOWED. END.
Definitions and Records RECORD Statement Error Handling Data Definition Language (DDL) Reference Manual—426798-002 5- 28
6 Definition Attributes Definition attributes are part of definitions and records, which are DDL dictionary objects that describe data structures and disk-file record structures. Each definition and record includes attributes such as size, data type, and usage. The definition attributes are defined by clauses in DEFINITION statements or in the record structure portion of RECORD statements.
Definition Attributes Table 6-1. Definition and Record Clauses (page 2 of 2) Clause Function NULL Assigns a null value to a field or group used as an Enscribe alternate key. DDL ignores this clause when generating host-language source code. OCCURS Specifies a subscripted array of like fields or like groups. OCCURS DEPENDING ON Specifies a variable-length array of like fields or like groups. This clause is for COBOL and DDL source code only.
AS Clause Definition Attributes AS Clause The AS clause specifies a display string for an enumeration value when AS is in a level 89 enumeration clause. At the definition level, the AS clause specifies a default display string for a field of type ENUM. This default becomes the display string when the value of the field does not match any of the values specified by level 89 enumeration clauses in the field’s definition or description. DDL ignores the AS clause when generating host-language source code.
DISPLAY Clause Definition Attributes DISPLAY Clause The DISPLAY clause specifies a default format for field or group values listed on an Enform report. DDL ignores the DISPLAY clause when generating host-language source code.
EDIT-PIC Clause Definition Attributes Table 6-2. Display Format Examples Display Format Value Displayed Value “M<99/99/99>” 012791 01/27/91 “M” 0.00 .00 “M” 1.499 1.50 “M<$ZZ,ZZ9.99>” 5246.95 $ 5,246.95 “M<(999) 999-9999>” 4084266974 (408) 426-6974 “M<99,999>” 524695 ******* (overflow) The following examples illustrate using constant names to specify display formats: CONSTANT mdy-date-display CONSTANT phone-display VALUE "M". VALUE "M<(999) 999-9999>".
EDIT-PIC Clause Definition Attributes • • If a field’s data type and the edit picture are defined as two different data elements in the working-storage section of a COBOL85 program, moving the data from one picture to the other must be possible. The edit picture for an alphanumeric field must be alphanumeric, and the edit picture for a numeric field must be numeric. The length of the data in an edit picture must conform to the length of the field’s data type.
EXTERNAL Clause Definition Attributes currency symbol at the beginning. Also, it is valid to display fewer characters to the right of the decimal point than the elementary item contains there. The data length of the second edit picture is invalid because it has too many minus signs. An edit picture can include 1 extra character for a minus sign, but the number of remaining minus signs must be equal to or less than the number of digits in the elementary item.
FILLER Clause Definition Attributes FILLER Clause The FILLER clause assigns a data type and size to a unnamed field. This clause reserves space that will never be referred to directly. FILLER FILLER Clause Guidelines The following points are guidelines for using the FILLER clause: • • • • • • • A FILLER field must have its data type and size specified with a PICTURE or TYPE clause. A FILLER field can be repeated with an OCCURS clause.
HEADING Clause Definition Attributes C Source Code: #pragma section name_struct #pragma fieldalign shared2_name_struct struct name_struct_def { char first_name[10]; char filler_0[6]; char second_name[24]; char filler_1[6]; }; Pascal Source Code: ?Section NAME_STRUCT TYPE NAME_STRUCT_DEF = RECORD FIRST_NAME : FSTRING[10]; FILLER_1 : FSTRING[6]; SECOND_NAME : FSTRING[24]; FILLER_2 : FSTRING[6]; END; FILLER Clause Example Any noncomputational PICTURE clause or nonnumeric TYPE clause can be used to specify t
HEADING Clause Definition Attributes LN clause specifies the locale associated with a value. HEADING Clause Guidelines The following points are guidelines for using the HEADING clause: • • • • A slash within report-heading indicates a line break in an Enform heading. A slash within report-heading indicates a line break in a Pathmaker field only if the item format is tabular. If the item format is compressed or uncompressed, a slash within report-heading is replaced by a blank space.
HELP Clause Definition Attributes HELP Clause The HELP clause enables you to associate help text with a group or elementary item in a DEFINITION or a RECORD statement. DDL ignores the HELP clause when generating host-language source code. HELP { "help-text" | constant-name } [ [ , ] "help-text" | [ , ] constant-name ] ... help-text is any ASCII or national string enclosed in quotation marks. constant-name is the name of a constant in the open DDL dictionary.
JUSTIFIED Clause Definition Attributes HELP Clause Examples The following example illustrates two ways of continuing help text for a field. The first text string is continued with a comma; the second text string is continued without a comma. DEF address 02 02 02 02 END HELP "This is a four-field", "address consisting of street," "city, state code, and ZIP code.". PIC X(30). PIC X(20). PIC X(2). PIC X(5).
KEYTAG Clause Definition Attributes KEYTAG Clause The KEYTAG clause declares that the field or group is an Enscribe key field. Key fields can overlap each other. DDL ignores this clause when generating TACL source code. Keytag {key-specifier} [DUPLICATES [NOT] ALLOWED] {constant-name} key-specifier is any number from -32,768 to 32,767, or 2 ASCII characters enclosed in quotation marks. You can omit key-specifier for a primary key, but if you include it, it must be 0.
LN Clause Definition Attributes KEYTAG Clause Example The PARTINFO record structure is described within the RECORD statement. KEYTAG clauses, rather than key-assignment statements, specify the primary key PARTNUM and the alternate key PARTNAME in the following example: CONSTANT partnum-heading CONSTANT partnum-display VALUE IS "Part/Number". VALUE IS "M". RECORD partinfo. FILE IS "$data.sales.
LN Clause Definition Attributes territory-code is a two-character string forming an ISO 3166:1988 Alpha-2 code entity name. charset is a string forming a HP internal character set name. For example, the locale name da_DK.ISO8859-1 would be specified as LN"da_DK.ISO8859-1" and would consist of the language-code da, the territory-code DK, and the charset value ISO8859-1.
MUST BE Clause Definition Attributes ° ° ° ° ° no_NO.ISO8859-1 Norwegian pt_PT.ISO8859-1 Portuguese sv_SE.ISO8859-1 Swedish tr_TR.ISO8859-9 Turkish zh_TW.eucTW Taiwanese, EUC LN Clause Example The following is an example of the LN clause: DEFINITION custnum PIC 9(4). HEADING "Finnish" LN"fi_FI.ISO8859-1" "Norwegian" LN"no_NO.ISO8859-1" "Danish" LN"da_DK.ISO8859-1". MUST BE Clause The MUST BE clause specifies the set of valid values that can be entered into a field.
MUST BE Clause Definition Attributes figurative-constant is a constant that the DDL compiler has prenamed and predefined. You need not enclose the constant in quotation marks. Singular and plural forms are equivalent in meaning. The figurative constants are listed in Table 6-3 on page 6-17. Table 6-3.
MUST BE Clause Definition Attributes use symbolic literals only for numeric items. The symbolic literals are shown in Table 6-4 on page 6-18. Table 6-4. Symbolic Literals Symbolic Literal Value LOW-NUMBER The minimum numeric value of the type specified for this field HIGH-NUMBER The maximum numeric value of the type specified for this field value-name is the name associated with a value in a level 89 enumeration clause for a field of type ENUM.
MUST BE Clause Definition Attributes • Requesters generated by the Pathmaker product enforce the MUST BE constraints; programs written by users must be coded to enforce these constraints as well. MUST BE Clause Examples In this example, the MUST BE clause defines the acceptable ranges of values for days in a month and months in a year: DEF date. 02 day 02 month 02 year END PIC 9(2) MUST BE 1 THROUGH 31. PIC 9(2). MUST BE 1 THROUGH 12. PIC 9(2).
NULL Clause Definition Attributes NULL Clause The NULL clause specifies a null value for an Enscribe alternate key. If a record being inserted into the database has a null value in the alternate key field, the alternate key is not added to the alternate key file. DDL ignores the NULL clause when generating host-language source code. Note that NULL and SQLNULL are not the same. SQLNULL is described under VALUE Clause on page 6-79.
OCCURS Clause Definition Attributes NULL Clause Examples The following example shows the use of the NULL clause. In this example, if the employee does not have a spouse or dependents, the key is not added to the alternate key file: RECORD employee. FILE IS "employee" key-sequenced. 02 empinfo. 04 empid 04 empname 04 dept PIC 9(4). PIC X(22). PIC X(4). 02 taxinfo 04 spousename 04 dependents NULL 0. PIC X(22). PIC 9(2). KEY IS empid. KEY "ti" is taxinfo.
OCCURS Clause Definition Attributes INDEXED BY index-name specifies the index attribute for COBOL output only; index-name is the name of a field to use as an index. The maximum length of the index name is 30 ASCII characters. OCCURS Clause Guidelines The following points are guidelines for using the OCCURS clause: • • • • • • OCCURS cannot be specified for the first element of a RECORD or DEFINITION statement. OCCURS can be specified only at level number 02 or greater.
OCCURS Clause Definition Attributes OCCURS Clause Examples The following statements declare storage for 52 paycheck values, one for each week of the year: DEF salary. 02 paycheck PIC 9999V99 OCCURS 52 TIMES. END TAL programs with TALBOUND 1 or with no TALBOUND clause access individual paycheck values like this: PAYCHECK [1] Paycheck value for the first week PAYCHECK [52] Paycheck value for the last week VST601.
OCCURS DEPENDING ON Clause Definition Attributes 03 year PIC 99. END The following shows COBOL output for the INDEXED BY attribute: DDL Code COBOL Code DEF xyz 02 abc TYPE BINARY OCCURS 3 TIMES INDEXED BY ix. END. 01 XYZ. 02 ABC NATIVE-2 OCCURS 3 TIMES INDEXED BY IX. OCCURS DEPENDING ON Clause The OCCURS DEPENDING ON clause declares a field or group that is repeated a variable number of times depending on the current value of an integer variable.
OCCURS DEPENDING ON Clause Definition Attributes OCCURS DEPENDING ON Clause Guidelines The guidelines for using an OCCURS clause also apply to OCCURS DEPENDING ON, with the following exceptions: • • • • • For C, FORTRAN, Pascal, pTAL, TACL, and TAL, the DDL compiler generates source code identical to the code it generates for OCCURS max TIMES.
PICTURE Clause Definition Attributes The following shows COBOL output for the DEPENDING ON clause: DDL Code COBOL Code DEF xyz. 02 i TYPE BINARY 02 abc TYPE BINARY OCCURS 1 to 3 TIMES DEPENDING ON i INDEXED BY ix. END. 01 XYZ. 02 I NATIVE-2. 02 ABC NATIVE-2 OCCURS 1 TO 3 TIMES DEPENDING ON I OF XYZ INDEXED BY IX. PICTURE Clause The PICTURE clause declares the data type and size of a single field or of a field within a group or record definition.
PICTURE Clause Definition Attributes length is a one-digit to five-digit integer, enclosed in parentheses, that specifies the number of times the preceding symbol is repeated. You can also specify the length by repeating the symbol (X, A, or 9) a number of times, once for each character position you want in the field. S represents a separate sign character in a signed numeric field. T represents a numeric character with an implied embedded sign.
PICTURE Clause Definition Attributes • • The only symbol you can specify in a national picture string is N or n (except for the parentheses and a number to specify the length, or number of repetitions). The maximum length you can specify for a national data item is half of the maximum internal field length. For definitions, the maximum internal field length is 32,767 bytes.
PICTURE Clause Definition Attributes • • • • • The maximum field length depends on data type: ° If an alphanumeric or national field is used only in working storage (not in a record), the maximum field length is 32,767 bytes.
PICTURE Clause Definition Attributes • • • Most alphanumeric and numeric PICTURE clauses are translated into FORTRAN character strings. The only exceptions are numeric fields described with USAGE IS COMP; these fields are translated into FORTRAN integers. Appendix C, DDL Data Translation, contains a table showing the FORTRAN data types generated from DDL PICTURE clauses. The maximum length of an alphanumeric or a numeric field is 255 bytes.
PICTURE Clause Definition Attributes ° If a numeric, national, or alphanumeric field is not defined in or referenced by a RECORD statement, the maximum field length is 32,767 bytes.
REDEFINES Clause Definition Attributes REDEFINES Clause The REDEFINES clause assigns a new name and data structure to an existing definition or record. REDEFINES { field-name | group-name } field-name identifies the previous field in the definition or record currently being defined; field-name is a DDL name. group-name identifies the previous group in the definition or record currently being defined; group-name is a DDL name.
REDEFINES Clause Definition Attributes NOWARN command. The name of the union has the form u_first_member_name. If the union name generated by DDL is the same as any of its siblings defined in the same group, DDL issues an error message and does not generate output. The following example shows a DDL definition translated into a C declaration: • DDL C Source DEF a. 02 b PIC 9(4) 02 c PIC 9(6). 02 d PIC 9(6) REDEFINES c.
REDEFINES Clause Definition Attributes 02 D. 04 D-1 04 D-2 PIC X. PIC 9 REDEFINES D-1. 02 E PIC 9(5). 02 F 04 F-1 04 F-2 END. REDEFINES E. PIC 9(3). PIC 9(2).
SPI-NULL Clause Definition Attributes SPI-NULL Clause The SPI-NULL clause specifies an Subsystem Programmatic Interface (SPI) null value for a field or group definition of an SPI extensible structured token, or for a field or group description within a group definition. The SPI-NULL clause is specified in a DEFINITION statement referenced in the DEF IS clause of a TOKEN-MAP statement. A field or group with an SPI null value in every byte is considered to have unspecified data.
SPI-NULL Clause Definition Attributes • • • If SPI-NULL is not specified, the default SPI null value is 255; that is, SSNULL sets all bits to 1. An explicit SPI-NULL clause for a field or for a group containing the field overrides the default SPI null value. You should not specify a VALUE clause for a field or group used to define an extensible structured token. Every field in an extensible structured token is initialized to its SPI null value before it is used, so any initial value is overwritten.
SPI-NULL Clause Definition Attributes When a definition refers to another definition and the referring definition contains one or more SPI-NULL clauses, these clauses override any SPI-NULL clauses in the referenced definition. If the referring definition does not have any SPI-NULL clauses, it inherits the SPI null value or values from the referenced definition. For example: DEF assn-ddl-jobcode SPI-NULL 0. 02 prefix TYPE BINARY 16. Inherits SPI null value 0 02 code TYPE BINARY 16.
SQLNULLABLE Clause Definition Attributes SQLNULLABLE Clause The SQLNULLABLE clause specifies whether a line item is to be treated in the same way as an SQL nullable column. { SQLNULLABLE | NOT SQLNULLABLE } In SQL, if a column is not explicitly specified as NOT NULL, it is a nullable column. Internally, a nullable SQL column is composed of the column itself and a numeric flag that indicates whether the column is null.
SQLNULLABLE Clause Definition Attributes • • • • • • • If the DDL clause NULL is specified for a line item, NOT SQLNULLABLE cannot be specified or implied for that item. SQLNULLABLE and NOT SQLNULLABLE cannot be specified on a line item whose data type has been set by a previous definition, nor on a group or subgroup that contains such a line item. A SQL-nullable line item is a word-aligned item regardless of its data type.
SQLNULLABLE Clause Definition Attributes • • • SQLNULLABLE cannot be specified for FILLER or BIT line items; these types of items can never be SQL-nullable. SQLNULLABLE cannot be specified on a group that contains a FILLER or BIT line item unless that line item is explicitly declared to be NOT SQLNULLABLE. Neither SQLNULLABLE nor NOT SQLNULLABLE can be specified on an 88 condition-name line item or an 89 enumeration line item.
SQLNULLABLE Clause Definition Attributes SQL-Nullable Output for C. The following example shows how DDL translates definitions and descriptions of SQL-nullable items into C source code: DDL Type C Type DEF B SQLNULLABLE.
SQLNULLABLE Clause Definition Attributes SQL-Nullable Output for FORTRAN. The following example shows how DDL translates definitions and descriptions of SQL-nullable items into FORTRAN source code: DDL Type FORTRAN Type DEF B SQLNULLABLE. 02 name PIC X(25) NOT SQLNULLABLE. 02 nickname PIC X(10) VALUE SQLNULL. 02 salary TYPE BINARY NOT SQLNULLABLE. 02 hire-date TYPE SQL DATE NOT SQLNULLABLE. 02 subordinate TYPE SQL VARCHAR 15 OCCURS 10 TIMES. RECORD B. CHARACTER*25 NAME FILLER*1 RECORD NICKNAME.
SQLNULLABLE Clause Definition Attributes SQL-Nullable Output for TACL. The following example shows how DDL translates definitions and descriptions of SQL-nullable items into TACL source code: DDL Type TACL Type DEF B SQLNULLABLE. 02 name PIC X(25) NOT SQLNULLABLE. 02 nickname PIC X(10) VALUE SQLNULL. 02 salary TYPE BINARY NOT SQLNULLABLE. 02 hire-date TYPE SQL DATE NOT SQLNULLABLE. 02 subordinate TYPE SQL VARCHAR 15 OCCURS 10 TIMES.
TACL Clause Definition Attributes TACL Clause The TACL clause specifies a high-level TACL data type to which an associated DDL data item is converted when DDL generates TACL source-code output from a DDL definition or record. TACL type type is: { { { { { { { { { { { CRTPID DEVICE ENUM FNAME FNAME32 PHANDLE SSID SUBVOL TRANSID TSTAMP USERNAME } } } } } } } } } } } type is a high-level TACL data type to which the DDL data type is to be converted.
TACL Clause Definition Attributes • If a DDL data item is defined by referring to an existing definition, the following applies: ° When the referring definition does not include a TACL clause, it inherits any TACL data type specified in the referenced definition. ° When the referring definition includes a TACL clause, the specified TACL data type overrides any TACL data type specified in the referenced definition.
TACL Clause Definition Attributes DDL generates the following TACL data structure for the preceding definition: ?Section TERM^ID Struct Begin CHAR BYTE (0:7) End A TACL clause at the group level overrides any TACL clauses specified for fields within the group; for example: DEF fname-def 02 volume 02 subvol 02 file END TACL TYPE TYPE TYPE FNAME. CHARACTER 8 TACL CRTPID. CHARACTER 8. CHARACTER 8.
TYPE Clause Definition Attributes TYPE Clause The TYPE clause performs either of two functions: • • It declares the type and size of a variety of data types. It declares a data structure by referring to a previously defined structure.
TYPE Clause Definition Attributes • • 5,000 bytes for an entire TACL structure, which allows 5,000 ASCII characters or 2,500 national characters Available address space for COBOL and TAL or, for part of a record, the record length BINARY represents a two’s complement binary number, whose size can be specified as 8, 16, 32, or 64 bits. scale for COBOL, pTAL, and TAL only, is an integer that specifies the position of an implied decimal point.
TYPE Clause Definition Attributes SQL VARCHAR length represents an SQL VARCHAR variable-length character string; length is the maximum number of characters allowed in the string. length must be an unsigned integer greater than zero. SQL DATETIME represents an SQL DATETIME data type. An SQL DATETIME data type specifies a point in time according to the Gregorian calendar. SQL DATETIME can contain only date, time, or date and time values.
TYPE Clause Definition Attributes start-date-time and end-date-time must each be one of the following: YEAR MONTH DAY HOUR MINUTE SECOND FRACTION [ end-field-precision ] The start-date-time item must appear earlier in this list than the enddate-time item. For example, SQL INTERVAL DAY TO MINUTE is a valid SQL INTERVAL specification, but SQL INTERVAL MINUTE TO DAY is not valid.
TYPE Clause Definition Attributes TYPE Clause Guidelines In the TYPE clause, you can declare the type and size of an object, group, or field in one of three ways: • • • Specify a data type. Refer to an existing definition that has a different name from the object, group, or field. Refer to an existing definition that has the same name as the object, group, or field. The following subsections give guidelines for using the three forms of the TYPE clause. Specifying a Data Type.
TYPE Clause Definition Attributes • • • • • • • For COBOL, type ENUM is translated into a NATIVE-2 item followed by level 88 items for the level 89 clauses. For FORTRAN, type ENUM is unsupported, and DDL generates an INTEGER*2 followed by comments containing the level 89 items. For Pascal, type ENUM is translated into constants followed by a type declaration of an INT16 item.
TYPE Clause Definition Attributes ° If an SQL VARCHAR field is defined in or referenced by a RECORD statement, the maximum field length is the maximum record length, which depends on the file type: Entry-Sequenced files 4,072 bytes Key-Sequenced files 4,062 bytes Relative files 4,072 bytes Unstructured files 4,096 bytes The maximum length leaves room for a two-byte length field. • • • DDL starts each SQL VARCHAR field on a word boundary, generating a one-byte filler character if necessary.
TYPE Clause Definition Attributes ° SQL INTERVAL data type: • • • • • The syntax for the SQL INTERVAL data type differs from the corresponding SQL syntax. For DDL, you do not use parentheses around the startfield-precision and end-field-precision items; for SQL you do enclose start-field-precision and end-field-precision in parentheses. An SQL INTERVAL field can contain a maximum of 18 digits, ignoring such other characters as colons (:), hyphens (-), and periods (.). For example, “5:2:15:36.
TYPE Clause Definition Attributes ° TAL and Pascal support bit maps outside group structures; however, these bit maps are packed in pTAL or TAL and unpacked in Pascal. To ensure that bit maps outside group structures are compatible between languages, DDL generates 16-bit integer items for bit fields declared as field definitions, with warning messages in all language outputs except Pascal.
TYPE Clause Definition Attributes ° Level 88 clauses following a bit map item are rejected by DDL, because level 88 clauses are meaningful only in COBOL, which does not support bit maps. ° DDL does not generate language output for an ENUM clause specified with type BIT, because DDL emits the output for the enumeration when the clause is defined as type ENUM.
TYPE Clause Definition Attributes • • • • • ° • • • • The output for a bit map declared as a field definition is INT (bit-length) or UNSIGNED (bit-length). The Pascal compiler allocates the whole 16-bit word for the bit fields and treats the unused leading bits as bit fillers. The output for a bit map declared in a group definition or record is INT (bit-length) or UNSIGNED (bit-length) inside a packed record.
TYPE Clause Definition Attributes • • • • • • DDL reads def-name from the dictionary and then places the entire definition at the level of the referring data element. The level number of a data element immediately following the TYPE def-name data element and in the same DEFINITION statement must be equal to or less than the level number of the TYPE def-name data element.
TYPE Clause Definition Attributes TYPE Clause Examples The following example illustrates some TYPE data-type clauses: DEF type-clause-example.• 02 chr TYPE CHARACTER 8. 8 alphanumeric characters Signed integer 02 bin-16 TYPE BINARY 16. 02 bin-16-u TYPE BINARY 16 Unsigned integer UNSIGNED. 02 bin-16-s TYPE BINARY Signed integer, 2 decimal positions 16,2 02 bin-32 TYPE BINARY 32 Signed double integer 02 bin-64 TYPE BINARY Signed 4-word integer, 16 decimal positions 64,16 02 flt TYPE FLOAT.
TYPE Clause Definition Attributes If the TYPE clauses in the ORDERINFO definition were replaced by the structures they represent, the definition would look like this: DEF orderinfo. 02 employee. 03 last-name PIC X(10). 03 first-name PIC X(20). 02 ordernum PIC 9(3) 02 orderdt TYPE SQL DATETIME YEAR TO DAY 02 orderint TYPE SQL INTERVAL MONTH 2 02 delivdate TYPE SQL DATE 02 salesman PIC 9(4) 02 custnum PIC 9(4) HEADING "Order Number". HEADING "Order Date". HEADING "Order Interval".
TYPE Clause Definition Attributes SQL VARCHAR Field Output for COBOL. The following examples show how DDL translates definitions and descriptions of SQL VARCHAR fields into COBOL85 source code: DDL Type DEF name COBOL85 Type TYPE SQL VARCHAR 25 VALUE "Mary". 01 NAME. 02 LEN 02 VAL DEF customer. 02 customer-nameTYPE name. 02 address TYPE SQL VARCHAR 29 OCCURS 10 TIMES. PIC S9(4) COMP VALUE 4. PIC X(25) VALUE "Mary". 01 CUSTOMER. 02 CUSTOMER-NAME. 03 LEN PIC S9(4) COMP VALUE 4.
TYPE Clause Definition Attributes SQL VARCHAR Field Output for Pascal. The following examples show how DDL translates definitions and descriptions of SQL VARCHAR fields into Pascal source code: DDL Type Pascal Type DEF name TYPE NAME_DEF = STRING(25); TYPE SQL VARCHAR 25 VALUE "Mary". DEF customer. 02 customer-name TYPE name. 02 address TYPE SQL VARCHAR 29 OCCURS 10 TIMES. END TYPE CUSTOMER_DEF = RECORD CUSTOMER_NAME: NAME_DEF; ADDRESS:ARRAY[1..
TYPE Clause Definition Attributes SQL VARCHAR Field Output for pTAL and TAL. The following examples show how DDL translates definitions and descriptions of SQL VARCHAR fields into pTAL or TAL source code: DDL Type pTAL or TAL Type DEF name TYPE SQL VARCHAR 25 VALUE "Mary". STRUCT NAME FIELDALIGN (SHARED2); BEGIN INT LEN; STRING VAL[1:25]; END; ! value is "Mary" DEF customer. 02 customer-name TYPE name. 02 address TYPE SQL VARCHAR 29 OCCURS 10 TIMES.
TYPE Clause Definition Attributes In the preceding examples, note that a simple variable of type bit_1_def has a different size from the field bits_0 in a variable having the type bit_struct_def. DDL Type C Type DEF Bit-Fillers #pragma fieldalign shared2 __bit_fillers typedef struct { char field_1[3]; short filler_0:4; short bit_field_1:5; short filler_1[2]; long field_2; } bit_fillers_def; 2 Field-1 TYPE CHARACTER 3. 2 Filler TYPE BIT 4. 2 Bit-Field-1 TYPE BIT 5. 2 Filler TYPE BINARY.
TYPE Clause Definition Attributes Bit Field Output for COBOL. The following examples show how DDL translates definitions and descriptions of bit fields into COBOL85 source code: DDL Type COBOL85 Type DEF Bit-1 TYPE BIT 1. 01 BIT-1 NATIVE-2. DEF New-Bit-1 TYPE Bit-1. 01 NEW-BIT-1 NATIVE-2. DEF Bit-10 TYPE BIT 10 UNSIGNED. 01 BIT-10 NATIVE-2. DEF Bit-Map. 2 Bits-8 TYPE BIT 8. 2 Bits-3 TYPE BIT 3 UNSIGNED. 2 Bits-10 TYPE BIT 10. End. 01 BIT-MAP. 02 FILLER NATIVE-2. 02 FILLER NATIVE-2.
TYPE Clause Definition Attributes Bit Field Output for FORTRAN. The following examples show how DDL translates definitions and descriptions of bit fields into FORTRAN source code: DDL Type FORTRAN Type DEF Bit-1 TYPE BIT 1 INTEGER*2 BIT1 DEF New-Bit-1 TYPE Bit-1. INTEGER*2 NEWBIT1 DEF Bit-10 TYPE BIT 10 UNSIGNED. INTEGER*2 BIT10 DEF Bit-Map. 2 Bits-8 TYPE BIT 8. 2 Bits-3 TYPE BIT 3 UNSIGNED. 2 Bits-10 TYPE BIT 10. End. RECORD BITMAP FILLER*2 FILLER*2 END RECORD DEF Bit-Struct.
TYPE Clause Definition Attributes DDL Type FORTRAN Type DEF Enum-Spec Begin TYPE ENUM. 89 Val-1 Value 1. 89 Val-2 Value 3. 89 Val-3 Value 0. End. INTEGER*2 ENUMSPEC C VAL-1 = 1 C VAL-2 = 3 C VAL-3 = 0 DEF Bits-With-Enums. 02 Bit-Field-1 TYPE BIT 8 ENUM Enum-Spec. 02 Bit-Field-2 TYPE BIT 4. End. RECORD BITSWITHENUMS FILLER*2 END RECORD DEF Reused-Bits. 02 Data-Item Type Binary. 02 Bits-Layout-1 Redefines Data-Item. 03 F-11 TYPE BIT 5. 03 F-12 TYPE BIT 6. 03 F-13 TYPE BIT 4.
TYPE Clause Definition Attributes DDL Type Pascal Type DEF Bit-Map. 2 Bits-8 TYPE BIT 8. 2 Bits-3 TYPE BIT 3 UNSIGNED. 2 Bits-10 TYPE BIT 10. End. TYPE BIT_MAP_DEF = PACKED RECORD BITS_8 : INT(8); BITS_3 : UNSIGNED(3); FILLER_1 : INT(5); BITS_10 : INT(10); FILLER_2 : INT(6); END; DEF Bit-Struct. 2 Bits-0 TYPE Bit-1. 2 Bits-1-To-10 TYPE Bit-10. End. TYPE BIT_STRUCT_DEF = PACKED RECORD BITS_0 : BIT_1_DEF; BITS_1_TO_10 : BIT_10_DEF; FILLER_1 : INT(5); END; DEF Bit-Fillers. 2 Field-1 Type Character 3.
TYPE Clause Definition Attributes In the preceding examples, note that a simple variable of type BIT_1_DEF has a different size from the field BITS_0 in a variable of the record type BIT_STRUCT_DEF. DDL Type Pascal Type DEF Enum-Spec Begin TYPE ENUM. 89 Val-1 Value 1. 89 Val-2 Value 3. 89 Val-3 Value 0. End. CONST VAL_1 = 1; CONST VAL_2 = 3; CONST VAL_3 = 0; TYPE ENUM_SPEC_DEF = INT16; DEF Bits-With-Enums. 02 Bit-Field-1 TYPE BIT 8 ENUM Enum-Spec. 02 Bit-Field-2 TYPE BIT 4. End.
TYPE Clause Definition Attributes DDL Type TACL Type DEF Bit-Map. 2 Bits-8 TYPE BIT 8. 2 Bits-3 TYPE BIT 3 UNSIGNED. 2 Bits-10 TYPE BIT 10. End. ?Section BIT^MAP Struct Begin FILLER 2; FILLER 2; End; DEF Bit-Struct. 2 Bits-0 TYPE Bit-1. 2 Bits-1-To-10 TYPE Bit-10. End. ?Section BIT^STRUCT Struct Begin FILLER 2; End; DEF Bit-Fillers. 2 Field-1 Type Character 3. 2 Filler Type Bit 4. 2 Bit-Field-1 Type Bit 5. 2 Filler Type Binary 16. 2 Field-2 Type Binary 32. End.
TYPE Clause Definition Attributes Bit Field Output for pTAL and TAL. The following examples show how DDL translates definitions and descriptions of bit fields into TAL source code: DDL Type pTAL or TAL Type DEF Bit-1 TYPE BIT 1. INT BIT^1; DEF New-Bit-1 TYPE Bit-1. INT NEW^BIT^1; DEF Bit-10 TYPE BIT 10 UNSIGNED. INT BIT^10; DEF Bit-Map. 2 Bits-8 TYPE BIT 8. 2 Bits-3 TYPE BIT 3 UNSIGNED. 2 Bits-10 TYPE BIT 10. End.
TYPE Clause Definition Attributes In the preceding examples, note that the simple variable BIT^1 has a different size from the field BITS^0 in a variable having the structure BIT^STRUCT^DEF. DDL Type pTAL or TAL Type DEF Enum-Spec Begin TYPE ENUM. 89 Val-1 Value 1. 89 Val-2 Value 3. 89 Val-3 Value 0. End. LITERAL VAL^1 = 1, VAL^2 = 3, VAL^3 = 0; INT ENUM^SPEC; DEF Bits-With-Enums. 02 Bit-Field-1 TYPE BIT 8 ENUM Enum-Spec. 02 Bit-Field-2 TYPE BIT 4. End.
UPSHIFT Clause Definition Attributes UPSHIFT Clause The UPSHIFT clause specifies that ASCII characters entered into a field must be upshifted. UPSHIFT UPSHIFT Clause Guidelines The following points are guidelines for using the UPSHIFT clause: • • • • • • • • Requesters generated by the Pathmaker product translate lowercase characters entered into this field to uppercase characters; user-written programs must be coded to enforce UPSHIFT.
USAGE Clause Definition Attributes USAGE Clause The USAGE clause declares a numeric storage allocation for a field or group or, for COBOL, specifies using a field as an index. [ USAGE [ IS ] ] { { { ( COMP[UTATIONAL] INDEX COMP[UTATIONAL]-3 PACKED-DECIMAL } } } } COMP[UTATIONAL] specifies that the field or group is a numeric item that is to be stored as a computational value. INDEX specifies that a field is to be used as an index for COBOL only.
USAGE Clause Definition Attributes 02 F1 PIC 9999 COMP-3 VALUE 1234. COBOL output produced for EMP.
USAGE Clause Definition Attributes • For TAL and FORTRAN source code, the DDL compiler translates the COMPUTATIONAL clause into the type and scale appropriate to the language. The data type for translation is based on the number of 9’s in the PICTURE: Number of 9’s Type 1 to 4 BINARY 16 5 to 9 BINARY 32 10 to 18 BINARY 64 See the TYPE clause discussion for the TAL and FORTRAN data types that correspond to the BINARY types.
USAGE Clause Definition Attributes • A field can be declared as COMP-3 if the associated PICTURE declaration is of the form: PIC • • • • • [S] 9.....[(length)] [ v 9.....[(length)] ] The symbol “9” can occur a maximum of 18 times in a PICTURE clause for an item declared as COMP-3. When a group is declared as COMP-3, each member is also COMP-3. All elements of the group must have a PICTURE declaration compatible with COMP3.
USAGE Clause Definition Attributes definition or description does not match the storage allocation for index names in the target language. DDL COBOL DEF abc TYPE BINARY 32 USAGE IS INDEX. 01 ABC USAGE IS INDEX. DEF xyz TYPE BINARY USAGE IS INDEX. Invalid - ERROR DEF tst TYPE abc. 01 TST NATIVE-4. DEF grp. 02 item-1 TYPE xyz. 02 item-2 PIC 9(10). END. 01 GRP. 02 ITEM-1 NATIVE-2. 02 ITEM-2 PIC 9(10). The following code examples illustrate the translation of PACKED-DECIMAL items to COBOL-85.
VALUE Clause Definition Attributes VALUE Clause The VALUE clause defines an initial value for a field or group or suppresses any VALUE clause in an item referenced by a TYPE clause. For C, FORTRAN, and TAL, initial values are translated into comments. For COBOL, initial values are translated into comments if a value is declared for a data type not supported by COBOL. DDL ignores the VALUE clause when generating TACL or Pascal source code.
VALUE Clause Definition Attributes The DDL figurative constants are shown in the following table: Name Definition LOW-VALUE One or more of the lowest character in the ASCII or national collating sequence LOW-VALUES HIGH-VALUE HIGH-VALUES QUOTE One or more of the highest character in the ASCII or national collating sequence QUOTES One or more of the ASCII or national quotation mark character SPACE One or more of the ASCII or national space character (blank) SPACES ZERO ZEROS The numeric value 0
VALUE Clause Definition Attributes interval-literal is a character string that conforms to the rules for a NonStop™ SQL/MP interval-literal. For details about the NonStop™ SQL/MP rules, see the discussion about language elements in the NonStop™ SQL/MP Reference Manual or the NonStop™ SQL/MP Programming Reference Manual for the host language you are using. CURRENT initializes a line item to the current timestamp. SQLNULL initializes a line item to an SQL NULL value.
VALUE Clause Definition Attributes • • • • • • • • • • • An initial value must be compatible with the data type of the field or group for which it is declared. An initial value declared at the group level must be alphanumeric. A numeric value must be in the range of values specified by the receiving PICTURE string. If used with MUST BE, an initial value must be in the range of values specified by the MUST BE string.
VALUE Clause Definition Attributes • • • • • • • • • • • If you specify a datetime-literal or an interval-literal for a character field, DDL treats the literal as a regular character string. In such a case, DDL does not check the syntax and semantics of the string. If you specify a datetime-literal or an interval-literal for a numeric field, DDL returns an error. VALUE ZERO and VALUE ZEROES cannot be specified for SQL DATETIME and SQL INTERVAL line items.
VALUE Clause Definition Attributes The following statements override or suppress these initial values: DEF base-price TYPE price VALUE IS 20.00. DEF cust-name TYPE name NOVALUE. Override initial value Suppress initial value VST615.
66 RENAMES Clause Definition Attributes 66 RENAMES Clause The level 66 RENAMES clause renames a previously defined field or group or combination of fields and groups. For C, DDL translates a field with a RENAMES clause into a comment. DDL ignores the RENAMES clause when generating FORTRAN, TACL, or Pascal source code.
88 Condition-Name Clause Definition Attributes Do not use: street of address of employee COBOL qualification VST617.vsd • If the THROUGH option is used, the definition of the first named field or group must precede that of the second named field or group. RENAMES Clause Example In the following example, ORDER-DETAIL renames the definition ODETAIL: DEF odetail. 02 primkey. 03 ordernum TYPE *. 03 partnum TYPE *. 02 quantity PIC 9(3). 66 order-detail RENAMES primkey THRU quantity.
88 Condition-Name Clause Definition Attributes symbolic-literal value-name "character-string" is a string of ASCII characters enclosed in quotation marks. constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid condition-name value but cannot be a figurative constant or symbolic literal. figurative-constant is any figurative constant listed with the VALUE clause. national-literal is a national literal of the following form: { N | n } { "2-byte-character...
88 Condition-Name Clause Definition Attributes • • • • • The syntax for a DDL level 88 clause differs from a COBOL level 88 clause only in its punctuation; DDL requires commas between values or sets of values, whereas COBOL does not. The rules for the VALUE clause apply to the VALUE portion of a level 88 clause. One or more condition-name clauses can follow the definition attribute clauses in a field definition or description.
89 Enumeration Clause Definition Attributes The next example associates the names of enumeration values with condition names: DEF prts-ddl-object-type TYPE 88 bolt VALUE 88 nut VALUE 88 pin VALUE 88 screw VALUE 88 washer VALUE 89 prts-enm-bolt VALUE 89 prts-enm-nut VALUE 89 prts-enm-pin VALUE 89 prts-enm-screw VALUE 89 prts-enm-washer VALUE END. ENUM BEGIN AS "Miscellaneous". prts-enm-bolt. prts-enm-nut. prts-enm-pin. prts-enm-screw. prts-enm-washer. IS prts-obj-bolt AS "Bolt". IS prts-obj-nut AS "Nut".
89 Enumeration Clause Definition Attributes constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid display-string value. LN clause specifies the locale associated with a value. DDL ignores the AS clause when generating host-language source code.
89 Enumeration Clause Definition Attributes • • • • For COBOL85, the level 89 enumeration clauses for a field of type ENUM are translated into level 88 items. These items follow the source code for the ENUM field, a NATIVE-2 clause. For FORTRAN, the level 89 enumeration clauses for a field of type ENUM are translated into comments. These comments follow the source code for the ENUM field, an INTEGER*2 type declaration.
89 Enumeration Clause Definition Attributes C Output. The following shows how DDL translates definitions and descriptions of enumeration clauses into C source code: DDL Type C Type DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error. 89 write-error VALUE 6. END. #pragma section status enum { no_error = 0, read_error = 1, write_error = 6 }; typedef short status_def; DEF old-status TYPE status VALUE no-error. typedef status_def old_status_def; /*value is no_error*/ DEF cpu. 2 state TYPE ENUM.
89 Enumeration Clause Definition Attributes FORTRAN Output. The following shows how DDL translates definitions and descriptions of enumeration clauses into FORTRAN source code: DDL Type FORTRAN Type DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error. 89 write-error VALUE 3. END. C C C INTEGER*2 STATUS NO-ERROR = 0 READ-ERROR = 1 WRITE-ERROR = 3 DEF old-status TYPE status VALUE no-error. C INTEGER*2 OLDSTATUS Initial value is NO-ERROR DEF cpu. 2 state TYPE ENUM. 89 stop. 89 pause. 89 running.
89 Enumeration Clause Definition Attributes Pascal Output. The following shows how DDL translates definitions and descriptions of enumeration clauses into Pascal source code: DDL Type Pascal Type DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error VALUE 3. 89 write-error. END. CONST NO_ERROR = 0; CONST READ_ERROR = 3; CONST WRITE_ERROR = 4; TYPE STATUS_DEF = INT16; DEF old-status TYPE status VALUE no-error. TYPE OLD_STATUS_DEF = STATUS_DEF; DEF cpu. 2 state TYPE ENUM. 89 stop. 89 pause.
89 Enumeration Clause Definition Attributes TACL Output. The following shows how DDL translates definitions and descriptions of enumeration clauses into TACL source code: DDL Type TACL Type DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error. 89 write-error VALUE 6. END. ?Section NO^ERROR Text 0 ?Section READ^ERROR Text 1 ?Section WRITE^ERROR Text 6 ?Section STATUS STRUCT Begin ENUM STATUS; End; DEF old-status TYPE status VALUE no-error.
89 Enumeration Clause Definition Attributes pTAL and TAL Output. The following shows how DDL translates definitions and descriptions of enumeration clauses into TAL source code: DDL Type pTAL or TAL Type DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error. 89 write-error VALUE 6. 89 status-error. END. LITERAL NO^ERROR = 0, READ^ERROR = 1, WRITE^ERROR = 6, STATUS^ERROR = 7; INT STATUS; DEF old-status TYPE status VALUE no-error. INT OLD^STATUS^DEF; Value is NO^ERROR DEF cpu. 2 state TYPE ENUM.
7 SPI Tokens Tokens are units in SPI message buffers. You can use token definitions provided by HP, and you can define your own tokens using DDL. HP supplies standard token definitions in C, COBOL, Pascal, TACL, portable Transaction Application Language (pTAL), and Transaction Application Language (TAL).
DDL Token-Definition Statements SPI Tokens DDL Token-Definition Statements The DDL statements listed in Table 7-1 define the token type and the token code of every simple token and the token map of every extensible structured token used in SPI messages, whether you specify the definitions or they are specified by SPI or other HP software. Note that the precise form of a token value is defined in a DEFINITION statement (described in Section 5, Definitions and Records). Table 7-1.
TOKEN-TYPE Statement SPI Tokens type-name is a DDL name that identifies a particular token type. For the rules governing DDL names, see Section 2, DDL Language Elements. VALUE [ IS ] {token-data-type} {constant-name } identifies the token data type to SPI. token-data-type is a positive integer between 0 and 254 that has been defined by SPI as a tokendata-type identifier. HP supplies a set of predefined constants, defined in the file ZSPIDEF.ZSPIDDL, that you should use to specify token-data-type.
TOKEN-TYPE Statement SPI Tokens OCCURS VARYING [ DEF [ IS ] def-name ] indicates that the length of the token varies. This clause sets the token length to its maximum of 255 bytes; only OCCURS VARYING allows structures greater than 254 bytes. To document the token structure, you can specify a DEF IS clause in the same statement with an OCCURS VARYING clause.
TOKEN-TYPE Statement SPI Tokens • • The following shows the data structures DDL generates for token types in each language: Language Data Structure C #define TYPE_NAME value COBOL 01 type-name NATIVE-2 VALUE IS value Pascal CONST type-name = value TACL ? Section type^name Struct BEGIN INT value END; pTAL or TAL Literal type^name = value DDL replaces any hyphen in a DDL name with a circumflex (^) in a TAL LITERAL name or in a TACL STRUCT name, and with an underscore (_) in a C #define name or
TOKEN-TYPE Statement SPI Tokens The definition ZSPI-DDL-INT specifies the structure of all simple tokens of the token type ZSPI-TYP-INT: DEF zspi-ddl-int TYPE BINARY 16 SPI-NULL 0. These definitions are in the file ZSPIDEF.ZSPIDDL. The following examples illustrate the definition of two token types you might define for your own subsystem.
TOKEN-TYPE Statement SPI Tokens DDL generates the token-type value by left-shifting the token length in the second (low-order) byte and combining it with the token data type in the first (highorder) byte. • TAL source code: Literal ZSPI^TYP^INT = 2 '<<' 8 + 2; Literal ASSN^TYP^STATUS = 2 '<<' 8 + 2; Literal ASSN^TYP^VARIABLE^TOKEN = 3 '<<' 8 + 255; The generated values are identical to the values generated for COBOL or TACL source-code output from the same TOKEN-TYPE statements.
TOKEN-CODE Statement SPI Tokens ?Section ASSN_TYP_VARIABLE_TOKEN CONST ASSN_TYP_VARIABLE_TOKEN = 1023; The generated values are identical to the values generated for COBOL, pTAL, TAL, TACL, or C source-code output from the same TOKEN-TYPE statements. TOKEN-CODE Statement The TOKEN-CODE statement defines a token code used to identify a particular simple token and stores the definition in an open dictionary.
TOKEN-CODE Statement SPI Tokens constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid token-number value. TOKEN-TYPE [ IS ] type-name . identifies the token type of the specified token; type-name is the name of a token type in the open DDL dictionary. [ SSID { “subsystem-id”} ] [ { constant-name } ] identifies the subsystem to which the token belongs.
TOKEN-CODE Statement SPI Tokens [ DISPLAY { “display-format” } ] [ { constant-name } ] specifies the display format for a token. If the DISPLAY clause is omitted, the display format for the token is based on the data type specified in the definition. display-format is a format code described in the DSM Template Services Manual. constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid display-format value.
TOKEN-CODE Statement SPI Tokens • DDL replaces any hyphen in a DDL name with a circumflex (^) in a pTAL or TAL LITERAL name or in a TACL STRUCT name, and with an underscore (_) in a C #define name or a Pascal defined constant name. Standard SPI TOKEN-CODE Definitions. SPI supplies a set of standard token codes to satisfy needs that are common to most programmatic interfaces.
TOKEN-CODE Statement SPI Tokens • COBOL source code: 01 ASSN-TKN-MY-STATUS 01 ASSN-TKN-STAT-REPLY NATIVE-4 NATIVE-4 VALUE IS 184680549. VALUE IS 184680550. The value of the token code is generated from the values specified for the token data type in the referenced TOKEN-TYPE statement and for the token number in the VALUE clause of the TOKEN-CODE statement−the two token codes differ only in their token numbers.
TOKEN-MAP Statement SPI Tokens ?Section ASSN_TKN_STAT_REPLY CONST ASSN_TKN_STAT_REPLY = 184680550; The value of the TOKEN-CODE statement generated for Pascal is the same as that generated for the other host languages. TOKEN-MAP Statement .The TOKEN-MAP statement defines a token map and stores the definition in an open dictionary. If a TOKEN-MAP statement identifies a token map that already exists in the open dictionary, DDL replaces the existing token map with the new token map.
TOKEN-MAP Statement SPI Tokens VALUE [ IS ] { token-number } {constant-name } identifies the extensible structured token. token-number is an integer in the range -32,768 to 32,767. Token numbers for subsystems you write must be in the range 1 to 9,998. Token numbers outside this range are reserved by HP or are previously defined by SPI. constant-name is the name of a constant in the open DDL dictionary. The constant value must be a valid token-number value. DEF [ IS ] def-name.
TOKEN-MAP Statement SPI Tokens [ HEADING { “label“ } ] [ { constant-name} ] specifies a label that identifies a token or field in DSM Template Services. If the HEADING clause is omitted, the label is the token name. label is an ASCII character string. Template Services uses only the first 40 characters of the heading. constant-name is the name of a constant in the open DDL dictionary. The constant name must be a valid label value.
TOKEN-MAP Statement SPI Tokens group-name identifies a group within the definition. TOKEN-MAP Statement Guidelines The following points are guidelines for using the TOKEN-MAP statement: • • • • • • • • • A token map is a special kind of token code used to identify an extensible structured token to which new fields can be added in subsequent versions. You identify a token map by its token-name. You do not specify the token type of a token map.
TOKEN-MAP Statement SPI Tokens • • • • • • ° Derived from the SPI null value of a group definition that contains the elementary item. ° Implicitly specified by default; the default value for SPI-NULL is 255. The null value specification for a group of bit fields that share the same byte or word is generated as one contiguous block having an SPI-NULL value of 255 following the version number.
TOKEN-MAP Statement SPI Tokens • ° If a bit filler or group of contiguous bit fillers is less than a byte long and is contained within one of the two bytes of a word, the filler or group of fillers assumes the same version number as all other bit fields in the containing byte. ° If a bit filler or group of contiguous bit fillers is a byte long or longer and fills either the upper or lower byte of a word, the filler or group of fillers is a NOVERSION field.
TOKEN-MAP Statement SPI Tokens • • • • • • • The following shows the data structures DDL generates for token maps in each language. Language Data Structure C static int map_name = {v1,v2,...,vn}; COBOL 01 map-name. 02 FILLER NATIVE-2 VALUE v1. 02 FILLER NATIVE-2 VALUE v2. • • 02 FILLER NATIVE-2 VALUE vn. END Pascal VAR map_name : ARRAY [1..n] OF INT16 := [v1, v2, ..., vn]; TACL ?Section map^name Struct BEGIN INT2 CODE VALUE v1v2; INT MAP (0:n-3) VALUE v3, ...
TOKEN-MAP Statement SPI Tokens • • SPI does provide a standard token type for all token maps. The standard token type for token maps is ZSPI-TYP-MAP, which consists of the standard token data type ZSPI-TDT-MAP and a token length of 255. Note that you never refer to these definitions when you define a token map. Each field in an extensible structured token must have a size, a type, and an SPI null value.
TOKEN-MAP Statement SPI Tokens • COBOL source code: 01 JOBINFO-MAP. Token type XSPI-TYPE-MAP 02 FILLER NATIVE-2 VALUE 2303. Token number 02 FILLER NATIVE-2 VALUE 3. Token byte length 02 FILLER NATIVE-2 VALUE 12. 02 FILLER NATIVE-2 VALUE 12. Version “C00” 02 FILLER NATIVE-2 VALUE 02 FILLER NATIVE-2 VALUE 17152. 02 FILLER NATIVE-2 VALUE 1024. 02 FILLER NATIVE-2 VALUE 2136. END . VST704.
TOKEN-MAP Statement SPI Tokens NOVERSION FOR jobclass. VERSION "C10" FOR jobusername. END The preceding example assumes that every possible value of the integer field JOBCLASS is legitimate so that an SPI null value cannot be used to indicate its presence or absence. In this case, the Boolean JOBCLASS-IS-PRESENT field indicates whether there is a JOBCLASS value. When this technique is used, a version is specified for JOBCLASS-IS-PRESENT and NOVERSION is specified for JOBCLASS.
TOKEN-MAP Statement SPI Tokens 02 bits-3 02 FILLER 02 bits-2 02 bits-5 02 FILLER 02 bits-4 02 bits-7 END. Type Type Type Type Type Type Type BIT BIT BIT BIT BIT BIT BIT 3. 10. 2. 5. 4. 4. 7. TOKEN-MAP bit-map-ex-c VALUE 111 DEF bit-ddl-ex-c. VERSION "C00" FOR char-3 THRU bits-3. VERSION "C10" FOR bits-2. VERSION "C20" FOR bits-5 THRU bits-4. NOVERSION FOR bits-7. END.
TOKEN-MAP Statement SPI Tokens BIT_FILLER END; 5; ?SECTION BIT^MAP^EX^A DEFINE BIT^MAP^EX^A = [2303,1,4,17152,511,1,17162,511,1, 17172,767 ]#; LITERAL BIT^MAP^EX^A^WLN = 11; ?SECTION BIT^DDL^EX^C STRUCT BIT^DDL^EX^C^DEF (*); BEGIN STRUCT CHAR^3; BEGIN STRING BYTE [0:2]; END; FILLER 1; UNSIGNED(8) BITS^8; UNSIGNED(3) BITS^3; BIT_FILLER 5; BIT_FILLER 10; UNSIGNED(2) BITS^2; BIT_FILLER 4; UNSIGNED(5) BITS^5; BIT_FILLER 4; UNSIGNED(4) BITS^4; BIT_FILLER 3; UNSIGNED(7) BITS^7; BIT_FILLER 9; END; ?SECTION BIT
TOKEN-MAP Statement SPI Tokens Table 7-2.
TOKEN-MAP Statement SPI Tokens VERSION "C10" FOR z-3 THRU z-4. END. *** ERROR *** Inconsistent VERSION within byte - Z-2 In the next example, the field bits-2 cannot have a version number because DDL would put bits-2 in the same byte as bits-3, for which NOVERSION is specified: DEF bit-ddl-ex-b. 02 bits-8 02 bits-3 02 bits-2 02 bits-10 02 bits-1 END. Type Type Type Type Type BIT BIT BIT BIT BIT 8. 3 SPI-NULL 255. 2. 10. 1 SPI-NULL 255. TOKEN-MAP bit-map-ex-b VALUE 1 DEF bit-ddl-ex-b.
8 Dictionary Manipulation Statements The statements described in this section are used to manipulate objects in a DDL dictionary. You use the DDL statements listed in Table 8-1 to perform operations on an open DDL dictionary. Table 8-1. Dictionary Manipulation Statements Statement Function DELETE Deletes one or more DDL objects of a particular object type from an open DDL dictionary. EXIT Terminates an interactive DDL session.
Dictionary Manipulation Statements DELETE Statement record-name is a DDL name that uniquely identifies an existing record in an open DDL dictionary. You can specify up to 50 records. token-name is a DDL name that uniquely identifies an existing token code in an open DDL dictionary. You can specify up to 50 token codes. map-name is a DDL name that uniquely identifies an existing token map in an open DDL dictionary. You can specify up to 50 token maps.
DELETE Statement Dictionary Manipulation Statements references, in which, for example, object B refers to object A and object C refers to object A by referring to object B. DELETE Statement Examples The following example shows how to delete a record interactively: 03> VOLUME $data.sales Go to subvolume with dictionary 04> DDL Run DDL compiler Open dictionary !?DICT !DELETE RECORD employee . Delete record !EXIT VST801.
EXIT Statement Dictionary Manipulation Statements EXIT Statement The EXIT statement terminates a DDL session. EXIT [ . ] EXIT Statement Guidelines The following points are guidelines for using the EXIT statement: • • • • When you run DDL in interactive mode, an EXIT statement terminates DDL and returns you to the command interpreter. When you run DDL in noninteractive mode, an EXIT statement within the source schema terminates DDL at that point and returns you to the command interpreter.
OUTPUT Statement Dictionary Manipulation Statements OUTPUT Statement The OUTPUT statement reads existing objects from an open DDL dictionary and writes them to any open DDL, FUP, REPORT, or host-language source-code files. { CONSTANT { constant-name ... } { { * } { DEF[INITION] { def-name ... } { { * } {RECORD { record-name ... } { { * } OUTPUT { TOKEN-CODE { token-name ... } { { * } { TOKEN-MAP { map-name ... } { { * } { TOKEN-TYPE { type-name ...
OUTPUT Statement Dictionary Manipulation Statements * is a wild-card symbol. Depending on the OUTPUT statement format, the asterisk directs DDL to write all the objects of a specified type in the currently open dictionary or to write all the objects of all types. OUTPUT Statement Guidelines The following points are guidelines for using the OUTPUT statement: • • • • • • • OUTPUT is used to write DDL objects from an open DDL dictionary to any open DDL, FUP, REPORT or language source-code files.
OUTPUT Statement Dictionary Manipulation Statements If you have changed your dictionary and want to make sure your source files correspond exactly to the changed dictionary, you can use an OUTPUT * statement: Run DDL compiler 15> DDL Open dictionary !?DICT Open and clear DDL source file !?DDL ddlsrc ! Write all entries from the dictionary to DDLSRC !OUTPUT * . Close DDL source file !?NODDL Open and clear FUP source file !?FUP fupsrc ! Write all records from the dictionary to FUPSRC !OUTPUT RECORD * .
Dictionary Manipulation Statements OUTPUT UPDATE Statement OUTPUT UPDATE Statement The OUTPUT UPDATE statement produces DDL source code that you can use to modify or delete a referenced object in an open dictionary. { CONSTANT constant-name ... } OUTPUT UPDATE { [ DEF[INITION] ] def-name ... } { TOKEN-TYPE type-name ... } constant-name is the name of a constant in the open DDL dictionary. You can specify up to 50 constants.
Dictionary Manipulation Statements • OUTPUT UPDATE Statement The DDL compiler generates the following sections of source code for each object specified in the OUTPUT UPDATE statement: ° First section DELETE statements to delete any objects that directly or indirectly refer to the specified object. ° Second section A statement to redefine the specified object.
OUTPUT UPDATE Statement Dictionary Manipulation Statements The resulting source code from MYFILE follows: ?Section ZIP-CD-DELETES Delete Record SUPPLIER. Delete Record CUSTOMER. Delete Definition SUPPINFO. Delete Definition CUSTINFO. Delete Definition ADDR. ?Section ZIP-CD Definition ZIP-CD PIC "9(9)".
SHOW USE OF Statement Dictionary Manipulation Statements The following example shows DDL commands and statements that delete the constant MDY-DATE-DISPLAY and all the objects that refer to that constant: 25> DDL DICT !?DDL ddlout ! !OUTPUT UPDATE CONSTANT mdy-date-display. !?NODDL !?SOURCE ddlout (mdy-date-display-deletes) !DELETE CONSTANT mdy-date-display !EXIT This command executes DELETE statements generated by OUTPUT UPDATE statement This command deletes MDY-DATEDISPLAY VST809.
SHOW USE OF Statement Dictionary Manipulation Statements • • If you want to modify or delete a referenced object, you can use the SHOW USE OF statement to list all references to the object you plan to modify or delete. Generally, however, you should use OUTPUT UPDATE to make such changes. SHOW USE OF generates a listing that shows which objects use the specified objects. Objects can refer to other objects as follows: ° ° ° ° ° ° Constants can refer to other constants.
SHOW USE OF Statement Dictionary Manipulation Statements The following diagram illustrates the nesting levels for ZIP-CD: ZIP-CD (1) ADDR (2) CUSTINFO SUPPINFO (3) CUSTOMER SUPPLIER VST811.vsd To illustrate sequence in a SHOW USE OF listing, the following statement displays the objects that refer to the definitions CUSTNUM and NAME. For the definitions of CUSTNUM, NAME, and the objects that refer to them, see the sample schema in Appendix B, Sample Schemas. ?DICT SHOW USE OF DEF custnum, name.
Dictionary Manipulation Statements SHOW USE OF Statement Data Definition Language (DDL) Reference Manual—426798-002 8- 14
9 DDL Compiler Commands Compiler commands provide information to the DDL compiler and select compilation features.
DDL Compiler Commands Table 9-1. DDL Compiler Commands (page 2 of 6) General Function Compilation Control Source Output Command Function COLUMNS Specifies how many character positions on input lines are significant for DDL input (S). COMMENTS NOCOMMENTS Includes (or suppresses) comments in the open dictionary (S). ERRORS Specifies the number of errors allowed before compilation terminates (S). SECTION Identifies sections of DDL source for separate compilation (S).
DDL Compiler Commands Table 9-1. DDL Compiler Commands (page 3 of 6) General Function Source Output (continued) Command Function COBOL NOCOBOL Opens (or closes) a COBOL sourcecode file (A); causes subsequent DDL object definitions to be written to an open COBOL source-code file (S). CPRAGMA NOCPRAGMA Turns on (or off) #pragma generation for C output (S).
DDL Compiler Commands Table 9-1. DDL Compiler Commands (page 4 of 6) General Function Source Output (continued) Command Function FORTRANUNDERSCORE NOFORTRANUNDERSCORE Replaces hyphens in DDL names with underscores in FORTRAN names (or deletes the hyphens). FUP NOFUP Opens (or closes) a FUP file-creation source file (A); causes later record descriptions to be written to an open FUP file (S).
DDL Compiler Commands Table 9-1. DDL Compiler Commands (page 5 of 6) General Function Source Output (continued) Listing control Other commands Command Function TALALLOCATE NOTALALLOCATE Causes (or suppresses) memory allocation in pTAL or TAL for single-field definitions (S). TALBOUND Sets array bounds for pTAL or TAL source-code output (S). TALCHECK NOTALCHECK Causes (or suppresses) pTAL or TAL syntax checking on subsequent data descriptions (S).
ANSICOBOL Command DDL Compiler Commands Table 9-1. DDL Compiler Commands (page 6 of 6) General Function Other commands (continued) Command Function HELP Lists a brief description of any or all compiler commands (A). RESET Stops compiling the current statement (A). TEDIT Suspends compiler execution and starts a PS Text Edit process (A).
C Command DDL Compiler Commands This definition is written to COBSRC as follows: * SCHEMA PRODUCED DATE - TIME : 9/14/2004 - 18:22:07 ?SECTION NAME,ANSI * Definition NAME created on 09/14/2004 at 18:22 01 NAME. 02 LAST-NAME PIC X(12). 02 FIRST-NAME PIC X(8). 02 MIDINIT PIC X(2). NOANSICOBOL Command Example In this example, the DDL compiler opens a COBOL source file, COBSRC1, and adds the definition for NAME to that file. ?NOANSICOBOL ?COBOL COBSRC1! ?OUTPUT DEF NAME. For TANDEM Layout VST937.
DDL Compiler Commands • C Command Write the C source statements to the C source file. { C [ c-source-file [ ! ] ] | NOC } C opens the specified C source file, translates all subsequent DDL objects defined by statements or specified in OUTPUT statements into C source statements, and writes the source statements to the open C source file. If a C source file is already open, this command closes the current file and opens a new source file. c-source-file identifies the C source file.
C Command DDL Compiler Commands • • • • • • • • • With the exception of the TOKEN-MAP statement, DDL does not generate C data definitions that allocate space. Instead, DDL generates C typedefs for scalar types and structure templates for multiple-element DDL records. DDL replaces any hyphen in a DDL name with an underscore (_) before writing the name to the C source file. DDL appends the characters _def to the tag for all C typedefs and structures generated by DDL.
DDL Compiler Commands C Command the source code to the open C file, $DATA.SALES.CSRC. For the definition of the CUSTOMER record and the objects it refers to, see Appendix B, Sample Schemas. 27> DDL !?DICT !?C $data.sales.csrc !OUTPUT CONSTANT custnum-heading. !OUTPUT DEF custnum zip-cd name addr custinfo. !OUTPUT RECORD customer.
DDL Compiler Commands C00CALIGN Command C00CALIGN Command The C00CALIGN command specifies the alignment rules to be used when the DDL compiler generates C code. [ NO ] C00CALIGN C00CALIGN directs DDL to employ the C00 alignment rules used by C. C00CALIGN is the default. NOC00CALIGN directs DDL to employ the alignment rules used by C prior to the C00 release.
CCHECK Command DDL Compiler Commands NOCCHECK terminates the CCHECK checking. If a C source file is not open, NOCCHECK is the default. CCHECK Command Guidelines The following points are guidelines for using the CCHECK command: • • • • If a C source file is open, the compiler performs the C checks whether or not CCHECK is set. You can stop C syntax checking by specifying NOCCHECK; you can restart checking with a subsequent CCHECK.
DDL Compiler Commands CDEFINEUPPER Command DDL orderdate ?NOCCHECK When CCHECK is in effect, DDL issues the following message for each DDL object that passes the syntax check: C CHECK completed for name In the message, name is the name of the object checked by CCHECK. CDEFINEUPPER Command The CDEFINEUPPER command instructs the DDL compiler to generate C #define names in uppercase letters. The NOCDEFINEUPPER command tells the compiler to generate C #define names in lowercase letters.
DDL Compiler Commands CFIELDALIGN_MATCHED2 Command CFIELDALIGN_MATCHED2 Command Guidelines The following points are guidelines when using the CFIELDALIGN_MATCHED2 command: • • • • • The CFIELDALIGN_MATCHED2 command allows members of a structure to be assigned a byte or word address consecutively. If the remaining byte in a two-byte word is not large enough for the next member, then DDL assigns the next word aligned address.
DDL Compiler Commands • • CFIELDALIGN_MATCHED2 Command To suppress the #pragma fieldalign matched2 statements, set the NOCPRAGMA command. When compiling a definition or record with matched2 alignment, all referenced definitions must have been compiled with matched2 alignment; otherwise, DDL returns an error. For more information about alignment rules, see Appendix H, DDL Alignment Rules.
DDL Compiler Commands c[0] c[1] c[2] filler y filler CFIELDALIGN_MATCHED2 Command With CFIELDALIGN_MATCHED2 set, members of the substructure can start on odd byte boundaries: x c[0] c[1] c[2] y filler Data Definition Language (DDL) Reference Manual—426798-002 9- 16
DDL Compiler Commands CIFDEF, CIFNDEF, and CENDIF Commands CIFDEF, CIFNDEF, and CENDIF Commands This subsection describes these three commands as a group. CIFDEF Command The CIFDEF command generates a #ifdef compiler directive for a C source file. It instructs the DDL compiler to generate the #ifdef compiler directive in an opened C output file. CIFNDEF Command The CIFNDEF command generates #ifndef compiler directive for a C source file.
DDL Compiler Commands CIFDEF, CIFNDEF, CENDIF Command Example CIFDEF, CIFNDEF, CENDIF Command Example The following example shows the use of the CIFNDEF, CIFDEF and CENDIF compiler commands. 10> DDL !?C CSRC !?CIFNDEF !CONSTANT !?CIFDEF !CONSTANT !?NOC EMP EMP VALUE "JYOTI". EMP EMP VALUE "RAM". !?C CSRC Output source for C is opened on $ADE101.BUG.CSRC !?CIFNDEF EMP !CONSTANT EMP VALUE "JYOTI". Constant EMP defined. C output produced for EMP. !?CIFDEF EMP !CONSTANT EMP VALUE "RAM".
CLISTIN Command DDL Compiler Commands CLISTIN Command The CLISTIN command instructs the DDL compiler to list (or suppress) dictionary comments specified by the user on the compiler listing. [ NO ] CLISTIN CLISTIN lists all subsequent dictionary comments specified by the user on the compiler listing. CLISTIN is the default setting. NOCLISTIN halts listing of user comments on the listing from NOCLISTIN to any subsequent CLISTIN.
CLISTOUT Command DDL Compiler Commands The DDL compiler listing for this source is: *Comment for AA DEF aa PIC X(24). Definition AA size is 24 bytes. Production comment ?NOCLISTIN DEF bb PIC X(10). Definition BB size is 10 bytes. ?CLISTIN *Comment for CC DEF cc PIC 9(6). Definition CC size is 24 bytes. VST902.vsd CLISTOUT Command The CLISTOUT command reproduces (or suppresses) dictionary comments specified by the user in any open source-code files.
CLISTOUT Command DDL Compiler Commands • • CLISTOUTDETAIL causes DDL to reproduce any comments previously associated with a referenced definition. If a definition or record refers to a definition that has a comment and CLISTOUTDETAIL is in effect, DDL reproduces the comment in the source code just before the referenced definition. CLISTOUTDETAIL does not reproduce comments for definitions referenced by a token map or a token type.
DDL Compiler Commands COBCHECK Command COBCHECK Command The COBCHECK command causes the DDL compiler to: • • Perform COBOL syntax checks as though the compiler were going to produce COBOL source code, but without actually generating the code. List messages describing any error or warning conditions discovered during syntax checking. { NO ] COBCHECK COBCHECK performs the COBOL syntax checks as though COBOL source code were being produced. If a COBOL source file is open, COBCHECK is the default.
COBCHECK Command DDL Compiler Commands TYPE COMPLEX TYPE LOGICAL ° A TYPE BINARY 64 declaration cannot specify a scale factor of -18 (or less); the range is restricted to -17 to 18. ° A data item must not have the same name as a group or record that could be used to qualify the data item. ° No more than 3 levels of nested OCCURS can be in a COBOL datadescription entry. ° An item specified as a key in a RECORD statement must be alphanumeric.
COBLEVEL Command DDL Compiler Commands COBLEVEL Command The COBLEVEL command enables you to specify explicit level numbering for COBOL source output. COBLEVEL [ base [ , increment ] ] COBLEVEL specifies level numbering for COBOL source output. base is the starting level number. The default base value is 1. increment is the number of levels to be skipped. The default increment value is 1.
DDL Compiler Commands COBOL Command COBOL Command The COBOL command instructs the DDL compiler to: • • • • Create and open a COBOL source file or open an existing COBOL source file. Translate any subsequent statements that define DDL objects in the source schema into COBOL source statements. Translate any DDL objects specified in subsequent OUTPUT statements into COBOL source statements. Write the COBOL source statements to the COBOL source file.
COBOL Command DDL Compiler Commands • • • • • Only one COBOL source file can be open at a time. If you use the COBOL command when you already have a COBOL source file open, DDL closes the current source file before opening the new source file. The specified COBOL source file can be an EDIT file, an unstructured file, or a sequential device such as a terminal, a spooler, or a process. If the file exists but is not one of these types, DDL issues an error message and does not open the file.
COLUMNS Command DDL Compiler Commands In the next example, the DDL compiler retrieves the record, CUSTOMER, from the open dictionary, translates it into COBOL source code, and appends the source code to the open COBOL file: Run DDL compiler 28> DDL !?DICT $data.sales Open dictionary !?COBOL $data.sales.cobsrc Open COBOL source file !OUTPUT RECORD customer. Append customer record !EXIT to COBSRC VST906.vsd The record customer is stored in COBSRC as: ?SECTION CUSTOMER,TANDEM 01 CUSTOMER.
DDL Compiler Commands COMMENTS Command COMMENTS Command The COMMENTS command directs the DDL compiler to store dictionary comments specified by the user in an open dictionary. [ NO ] COMMENTS COMMENTS stores any subsequent dictionary comments specified by the user in an open dictionary. NOCOMMENTS halts processing of dictionary comments specified by the user. NOCOMMENTS is the default setting.
COMMENTS Command DDL Compiler Commands * Last name, First DEF name. * Last name 02 last-name * First name 02 first-name * Middle initial 02 midinit END name, Middle initial DEF custname TYPE name. PIC X(12). PIC X(8). PIC X(2). The comment is in the file COBSRC, preceding NAME and CUSTNAME: * An expanded name * Last name, First 01 NAME. * Last name 02 LAST-NAME * First name 02 FIRST-NAME * Middle initial 02 MIDINIT * An expanded name * Last name, First 01 CUSTNAME.
DDL Compiler Commands CPRAGMA Command The generated Pascal code is: { Token type for enumerated tokens } ?Section ZSPI_TYP_ENUM CONST ZSPI_TYP_ENUM = 2818; The generated TACL code is: ?Section ZSPI-TYP-ENUM Struct ==Token type for enumerated tokens BEGIN UINT ZSPI^TYP^ENUM IS 2818; END; The generated pTAL or TAL code is: !Token type for enumerated tokens Literal ZSPI^TYP^ENUM = 11 '<' 8 + 2; CPRAGMA Command The CPRAGMA command turns on #pragma generation for C output.
DDL Compiler Commands CTOKENMAP_ASDEFINE Command CTOKENMAP_ASDEFINE Command The CTOKENMAP_ASDEFINE compiler command controls whether the DDL compiler generates the C output of a TOKEN-MAP as a #define or as a static int array. [ NO ] CTOKENMAP_ASDEFINE CTOKENMAP_ASDEFINE directs the DDL compiler to generate the C output of a TOKEN-MAP as a #define. (By default, DDL generates the C output of a TOKEN-MAP as a static int array.
DDL Compiler Commands CTOKENMAP_ASDEFINE Command !02 F1 PIC XX. !END. Definition EMP size is 2 bytes. Definition EMP added to dictionary. #pragma section emp /* Definition EMP created on 08/02/2000 at 15:03 */ #pragma fieldalign shared2 __emp typedef struct __emp { char f1[2]; } emp_def; #define emp_def_Size 0 C output produced for EMP. !TOKEN-MAP MAP1 VALUE 1 DEF EMP. !VERSION "C00" FOR F1. !END. Token Map MAP1 defined. Token Map MAP1 added to dictionary.
DDL Compiler Commands CTOKENMAP_ASDEFINE Command } emp_def; #define emp_def_Size 0 C output produced for EMP. Loading Token-Map MAP1 #pragma section map1 /* Token Map MAP1 created on 08/02/2000 at 15:03 */ #define MAP1 { 2303, 1, 2, 17152, 767 } C output produced for MAP1. Loading Token-Map MAP2 #pragma section map2 /* Token Map MAP2 created on 08/02/2000 at 15:04 */ #define MAP2 { 2303, 20, 2, 17152, 767 } C output produced for MAP2.
DDL Compiler Commands CUNDEF Command !?NOCTOKENMAP_ASDEFINE !OUTPUT *. Loading Definition EMP #pragma section emp /* Definition EMP created on 08/02/2000 at 15:03 */ #pragma fieldalign shared2 __emp typedef struct __emp { char f1[2]; } emp_def; #define emp_def_Size 0 C output produced for EMP. Loading Token-Map MAP1 #pragma section map1 /* Token Map MAP1 created on 08/02/2000 at 15:03 */ static short map1[] = { 2303, 1, 2, 17152, 767 }; C output produced for MAP1.
DDL Compiler Commands • C_DECIMAL Command It is the user's responsibility to use proper identifiers along with the CUNDEF command. CUNDEF Command Example The following example shows the use of the CUNDEF compiler command: 11> DDL !?C CSRC !CONSTANT EMP VALUE "JYOTI". !?CIFDEF EMP !?CUNDEF EMP !?CENDIF !?NOC !?C CSRC Output source for C is opened on $ADE101.BUG.CSRC !CONSTANT EMP VALUE "JYOTI". Constant EMP defined. C output produced for EMP.
C_DECIMAL Command DDL Compiler Commands NOC_DECIMAL directs the DDL compiler to generate C output as type char for simple numeric items. The NOC_DECIMAL compiler command is used to nullify the effects of the C_DECIMAL compiler command if that command is already in effect. The NOC_DECIMAL command is the default form of the command.
DDL Compiler Commands C_DECIMAL Command !OUTPUT *. Loading Definition EMP #pragma section emp /* Definition EMP created on 03/06/2000 at 17:13 */ #pragma fieldalign shared2 __emp typedef struct __emp { char item1[5]; char item2[6]; } emp_def; C output produced for EMP. !?C_DECIMAL !OUTPUT *.
DDL Compiler Commands C_MATCH_HISTORIC_TAL Command /* Definition EMP1 created on 03/06/2000 at 17:24 */ #pragma fieldalign shared2 __emp1 typedef struct __emp1 { decimal item1[5]; unsigned long item2; } emp1_def; C output produced for EMP1. ! C_MATCH_HISTORIC_TAL Command The C_MATCH_HISTORIC_TAL command causes DDL to generate C source code that corresponds to the TAL and COBOL source generated.
DDL Compiler Commands • • • C_MATCH_HISTORIC_TAL Command DDL word-aligns substructures declared by template with a typedef or structure tag. DDL adds a filler if needed to word-align a referenced definition. DDL word-aligns substructures that refer to other group definitions to make their length even. The C source code for a struct generated with matched2 alignment set is preceded by the following statement: #pragma fieldalign matched2 __struct-name where __struct-name is the name of the struct.
DDL Compiler Commands DO_PTAL_ON Command char filler_0; } a_def; #pragma section e /* Definition E created on 10/13/1995 at 13:23 */ typedef char e_def; #pragma section f /* Definition F created on 10/13/1995 at 13:23 */ #pragma fieldalign shared8 __f typedef struct __f { short g; struct { e_def i; char filler_0; a_def j; } h; char k; char filler_1; short l; } f_def; DO_PTAL_ON Command The DO_PTAL_ON command instructs the DDL compiler to generate a FIELDALIGN clause for each structure in pTAL or TAL outp
DDL Compiler Commands DO_PTAL_ON Command DO_PTAL_ON Command Examples The following examples use the same DDL definition to illustrate the difference between DO_PTAL_ON and DO_PTAL_OFF. The common DDL definition is: DEF FIRST 02 FLD1 PIC X. 02 SUB. 03 FLD2 PIC X. END.
DDL Compiler Commands DDL Command DDL Command The DDL command instructs the DDL compiler to: • • • • Create and open a DDL source file or open an existing DDL output source file. Translate any subsequent DDL object definitions in the source schema into DDL source statements. Translate any DDL objects specified in subsequent OUTPUT statements into DDL source statements. Write the DDL source statements to the DDL source file.
DDL Command DDL Compiler Commands • • • The specified DDL source file must be an EDIT file, an unstructured file, or a sequential device such as a terminal, a spooler, or a process. If the file exists but is not one of these types, DDL issues an error message and does not open the file. Each DDL object translated into DDL source is written to the source file in a separate section that has the same name as the DDL structure it contains.
DEFLIST Command DDL Compiler Commands 02 ZIP-CODE End Pic "9(5)". ?Section CUSTNUM Definition CUSTNUM Pic "X(4)". ?Section CUSTOMER Record CUSTOMER. File is "CUSTOMER" Key-sequenced. 02 CUSTNUM Type *. 02 CUSTNAME Type NAME. 02 CUSTADDR Type ADDR. Key is CUSTNUM Duplicates not allowed. Key "CN" is CUSTNAME. End Subsequently, the DDL source file can be used to reconstruct the dictionary on another subvolume: 30> DDL !?DICT $data.
DEFLIST Command DDL Compiler Commands • The DEFLIST description appears in either of the following formats: level-number field-name (offset:length) [min:max] level-number field-name (offset:length) depending on whether a minimum and maximum (or total) number of occurrences have been defined. The variables in these formats represent the following values: • Variable Value level-number Level number assigned to the field in the referring structure. field-name Name of the included field or group.
DEFLIST Command DDL Compiler Commands The command DEFLIST causes DDL to show the offsets of each item in VARIABLETABLE: DEFLIST OUTPUT DEF variable-table Loading Definition VARIABLE-TABLE Including 01 VARIABLE-TABLE (0:402) Table starts at byte 0 with a maximum length of 402 bytes Including 02 TABLE-SIZE (0:2) Element starts at byte 0 and has a length of 2 bytes Including 02 DATA-TABLE (2:4) [1:100] Element starts at byte 2, has a length of 4 bytes, and occurs 1 to 100 times VST909.
DDL Compiler Commands DICT Command DICT Command The DICT command instructs the DDL compiler to do the following: • • Create and open an audited dictionary on a specified subvolume or open an existing dictionary on a specified subvolume. Enter all subsequent DDL object definitions into the open dictionary. Note. DDL creates an audited dictionary only if the subvolume is audited. A dictionary on a nonaudited subvolume is also nonaudited.
DDL Compiler Commands DICT Command able to use the purge option; otherwise, DDL does not execute the DICT! command.) If there is no dictionary in the specified subvolume, DDL ignores the exclamation point. NODICT directs the DDL compiler to close the currently open dictionary. NODICT is the default setting. DICT Command Guidelines The following points are guidelines for using the DICT command: • • • • • • • • The DDL dictionary consists of 14 files with predefined file names.
DICTN Command DDL Compiler Commands • If an existing dictionary that you open with the DICT command is nonaudited, DDL issues a warning message. DICT Command Examples To open a dictionary on the volume $DATA and subvolume SALES, enter: ?DICT $data.sales If there is no dictionary on $DATA.SALES, DDL creates and then opens the dictionary.
DDL Compiler Commands DICTN Command dict-subvol-name identifies the dictionary subvolume; dict-subvol-name is a subvolume name in this form: [\node-name.][$volume-name.][subvolume-name] If dict-subvol-name is omitted, DDL uses the current system and the current volume and subvolume. If node-name is omitted, DDL uses the current system; if volume-name is omitted, DDL uses the current volume; and if subvolume-name is omitted, DDL uses the current subvolume.
DDL Compiler Commands • • • • • • • DICTR Command If a dictionary already exists on the specified subvolume, DDL opens the dictionary for update access. More than one user can open the dictionary for concurrent update access. If a dictionary already exists, you can do either of the following: ° Purge the dictionary and re-create it by specifying an exclamation point after the subvolume name. ° Add new DDL objects to the dictionary by omitting the exclamation point.
DDL Compiler Commands EDIT Command dict-subvol-name is a dictionary subvolume name in this form: [\node-name.][$volume-name.][subvolume-name] If dict-subvol-name is omitted, DDL uses the current system, volume, and subvolume. If node-name is omitted, DDL uses the current system; if volumename is omitted, the current volume; and if subvolume-name is omitted, the current subvolume.
DDL Compiler Commands EDIT Command edit-parameter is any valid EDIT command. You can enter multiple commands, separated by semicolons. After opening the EDIT file, EDIT executes any subsequent commands until it closes the file. EDIT Command Guidelines The following points are guidelines for using the EDIT command: • • • Issuing the EDIT command within DDL is like issuing the EDIT command from the command interpreter. The EDIT prompt is the same, and you can use all the same functions.
ERRORS Command DDL Compiler Commands EDIT Command Example The following example illustrates using EDIT to change a source file interactively. The example also illustrates how DDL handles a default EDIT-file name and EDIT parameter. 33> DDL DICT !?DDL ddlfil Open DDLFIL !RECORD sum. Add a record . . . Close DDLFIL !?NODDL Start an EDIT process; list DDLFIL !?EDIT ddlfil;LIST ALL CURRENT FILE IS $DATA.PARTS.DDLFIL 1 Record SUM. 2 File is $DATA.SALES.SUM Unstructured. 3 Def is SUM-DEF.
ERRORS Command DDL Compiler Commands • • • If ERRORS is specified but max-errors is omitted, DDL stops compilation after the first error; thus, ERRORS is the same as ERRORS 1. When compilation terminates because the specified number of errors is reached, DDL closes an open dictionary and any open files, issues session statistics, and terminates. The specified maximum number of errors applies only to errors that occur after the appearance of the ERRORS command.
EXPANDC Command DDL Compiler Commands EXPANDC Command The EXPANDC command enables inline expansion of C language output. { EXPANDC | NOEXPANDC } EXPANDC directs the DDL compiler to output a referenced type definition inline instead of as a structure name. NOEXPANDC directs the DDL compiler to output a referenced type definition as a structure name.
EXPANDC Command DDL Compiler Commands def c type a. typedef a_def c_def; typedef char c_def[10]; #pragma fieldalign shared2 __d def d type b. typedef b_def d_def; typedef struct __d short b1; char b2[10]; struct { short b31; char b32[10]; } b3[5]; } d_def; def e. 2 e1 type c. 2 e2 type d Occurs 15 times. end.
DDL Compiler Commands FIELDALIGN_SHARED8 Command FIELDALIGN_SHARED8 Command The FIELDALIGN_SHARED8 command directs DDL to store data structures in the dictionary with shared8 alignment. DDL inserts explicit fillers to ensure proper alignment.
DDL Compiler Commands FILLER Command typedef struct __a { char b; char c; char d; char filler_0; } a_def; #pragma section e /* Definition E created on 10/13/1995 at 13:23 */ typedef char e_def; #pragma section f /* Definition F created on 10/13/1995 at 13:23 */ #pragma fieldalign shared8 __f typedef struct __f { short g; struct { e_def i; char filler_0; a_def j; } h; char k; char filler_1; short l; } f_def; FILLER Command The FILLER command specifies a filler algorithm to be used when the DDL compiler g
DDL Compiler Commands • • • • FILLER Command The DDL compiler compiles source code in several phases. In each phase DDL evaluates records and definitions to see if filler bytes are necessary to make sure the next field or group starts on a word boundary. Where filler bytes are necessary, the DDL compiler inserts FILLER fields according to the specified algorithm.
FILLER Command DDL Compiler Commands • If the group referred to does not start on a word boundary but is described with a REDEFINES clause, DDL inserts a filler byte before the group being redefined. FILLER Command Example The filler algorithm you select affects the structure of the source code; for example, consider the following DEFINITION statements: DEF test1. 02 a 02 b END PIC XX. PIC S9(4) DEF case1. 02 c 02 test1 END PIC X. TYPE *. DEF case2. 02 test1 02 c END TYPE *. PIC X. COMP.
DDL Compiler Commands FORCHECK Command When FILLER 1 is specified, the structure of TEST1 is the same in both CASE1 and CASE2. A COBOL program containing these data structures could successfully execute the following COBOL statement: MOVE TEST1 OF CASE1 to TEST1 OF CASE2. When FILLER 0 is specified, the structure of TEST1 in CASE1 differs from the structure of TEST1 in CASE2. A COBOL program containing these data structures could not successfully execute the preceding MOVE statement. Caution.
FORTRAN Command DDL Compiler Commands • The DDL compiler does not make all the lengthy syntax tests that the FORTRAN compiler makes. The DDL compiler tests the DDL statements to ensure that they do not violate the following rules of form specified by FORTRAN: ° ° An elementary field must not be larger than 255 bytes. An element must not be described as TYPE CHARACTER 8; this data type is not supported in FORTRAN.
DDL Compiler Commands FORTRAN Command FORTRAN source file. If a FORTRAN source file is already open, the command closes the current file and opens a new source file. fortran-source-file identifies the FORTRAN source file. If fortran-source-file is omitted, DDL lists the FORTRAN source statements at the home terminal. ! purges the contents of an existing FORTRAN source file before opening the file. If the specified file does not exist, DDL ignores the exclamation point.
DDL Compiler Commands • • • • • FORTRAN Command FORTRAN does not support unsigned numbers. If you specify an unsigned number, DDL translates it to a FORTRAN signed integer. For the data types that DDL generates for FORTRAN source code, see Table C-3 on page C-6. FORTRAN does not accept FILLER fields greater than 255 single-byte characters.
DDL Compiler Commands FORTRANUNDERSCORE Command The UPSHIFT clause is not recognized by FORTRAN, but is included as a comment. FORTRANUNDERSCORE Command The FORTRANUNDERSCORE command converts hyphens in DDL names into underscores in FORTRAN output. NOFORTRANUNDERSCORE discards the hyphens from FORTRAN output.[ [ NO ] FORTRANUNDERSCORE FORTRANUNDERSCORE converts hyphens in DDL names into underscores in FORTRAN output. NOFORTRANUNDERSCORE deletes hyphens from DDL names for FORTRAN output.
DDL Compiler Commands FUP Command ! purges the contents of an existing FUP source file before opening the file. If the specified file does not exist, DDL ignores the exclamation point. NOFUP closes the currently open FUP source file and thus stops the translation of record file attributes into FUP file-creation commands. NOFUP is the default.
FUP Command DDL Compiler Commands FUP Command Example The following example illustrates an interactive session in which FUP source code is generated from a record in the dictionary. Run DDL and open dictionary 34> DDL DICT Open FUPSRC; if file exists, purge existing data !?FUP fupsrc ! ?NOFUP Get record from dictionary, write FUP filecreation commands to FUPSRC Close FUPSRC !EXIT Exit from DDL !OUTPUT RECORD customer. VST917.
DDL Compiler Commands HELP Command HELP Command The HELP command lists a brief description of any specified command or of all commands. HELP [ command ] command is the name or partial name of a DDL compiler command. If command is omitted, DDL lists a brief description of all the DDL compiler commands. If you specify the first one or more characters of a command, DDL returns information about the first command (in alphabetic order) that matches the string of characters.
DDL Compiler Commands LIST Command LINECOUNT Command Examples This example sets the number of lines per page for the compiler listing pages to 60 lines: 37> DDL/IN myschema,OUT $S.#printer/LINECOUNT 60 The next example sets the number of lines per page for a schema report to 24: 38> DDL !?REPORT $S.#printer !?LINECOUNT 24 !?SOURCE myschema !EXIT LIST Command The LIST command tells the DDL compiler to list subsequent source lines on the listing destination. NOLIST stops the listing of source lines.
NCLCONSTANT Command DDL Compiler Commands LIST Command Example The following example shows placement of LIST and NOLIST commands in the source file to control listing of source lines: *beginning of source file . . . ?NOLIST . . . ?LIST . . . *end of source file List source lines by default Starting with this command, stop listing source lines Resume listing source lines, continue to the end of the source file VST918.
DDL Compiler Commands NCLCONSTANT Command NCLCONSTANT Command Guidelines The following points are guidelines for using the NCLCONSTANT command: • • • • • • • • • When NCLCONSTANT is in effect, DDL translates only DDL Constant objects. DDL record, definition, token type, token code, and token map objects are not translated. The DDL compiler issues a warning message when attempting to output a nonconstant in NCL. A DDL constant name can contain up to 30 ASCII characters.
NEWFUP_FILEFORMAT Command DDL Compiler Commands definition def-1. constant val-4 02 a pic x(10). end. value 4. ?NONCLCONSTANT constant val-5 constant val-6 value 5. value 6. ?NCLCONSTANT $vol.subvol.myncl constant val-7 value 7. constant val-8 value 8. constant large-val value 32768 type binary 32. DDL stores the NCL source code for the preceding example in $vol.subvol.
NEWFUP_FILEFORMAT Command DDL Compiler Commands command) and stores the records in the dictionary, then the user must use the same commands while requesting FUP output of those records. • • • The format specification for both alternate key and main file is the same (file format 2 in this case). DDL does not allow you to define record length more than the maximum allowed length for the particular type of file.
DDL Compiler Commands NEWFUP_FILEFORMAT Command Definition EMP size is 30 bytes. Definition EMP added to dictionary. !?FUP < SCHEMA PRODUCED DATE - TIME : 3/02/2000 17:59:53 Output source for FUP is opened on $ZTNT.#PTVWAT5 !RECORD EMPL. !FILE IS EMPLOYEE. !DEF IS EMP. !KEY IS EMPL.EMP-ID. !KEY "MN" IS EMPL.EMP-NAME. !END. Record EMPL size is 30 bytes. Record EMPL added to dictionary.
NOFILEFORMAT Command DDL Compiler Commands NOFILEFORMAT Command The NOFILEFORMAT command specifies no file format in FUP source files. It: • • Suppresses specification of any file format in FUP source files. Nullifies the effect of the OLDFUP_FILEFORMAT or NEWFUP_FILE FORMAT command if either of those commands is already in use. NOFILEFORMAT NOFILEFORMAT Command Guidelines The following points are guidelines for using the NOFILEFORMAT command: • • • • • By default, DDL uses the NOFILEFORMAT command.
DDL Compiler Commands NOFILEFORMAT Command !END. !?FUP !RECORD EMPL. !FILE IS "EMPLOYEE". !DEF IS EMP. !KEY IS EMPL.EMP-ID. !KEY "MN" IS EMPL.EMP-NAME. !END. !?DICT Dictionary opened on subvol $ADE101.MANUAL for update access. !DEF EMP. !02 EMP-NAME PIC X(20). !02 EMP-ID PIC 9(4) COMP. !02 EMP-SALARY PIC 9(6)V9(2). !END. Definition EMP size is 30 bytes. Definition EMP added to dictionary. !?FUP < SCHEMA PRODUCED DATE - TIME : 3/02/2000 - 18:52:42 Output source for FUP is opened on $ZTNT.
OLDFUP_FILEFORMAT Command DDL Compiler Commands CREATE EMPLOYE0 FUP output produced for EMPL. OLDFUP_FILEFORMAT Command The OLDFUP_FILEFORMAT command specifies file format 1 in all FUP source files. The OLDFUP_FILEFORMAT command instructs the DDL compiler to: • • Specify file format 1 in all FUP source files. Specify file format 1 in all FUP alternate key files.
DDL Compiler Commands OLDFUP_FILEFORMAT Command ?OLDFUP_FILEFORMAT DEF EMP. 02 EMP-NAME PIC X(20). 02 EMP-ID PIC 9(4) COMP. 02 EMP-SALARY PIC 9(6)V9(2). END. ?FUP RECORD EMPL. FILE IS "EMPLOYEE". DEF IS EMP. KEY IS EMPL.EMP-ID. KEY "MN" IS EMPL.EMP-NAME. END. ?DICT! Audited dictionary created on subvol $ADE101.MANUAL. Dictionary opened on subvol $ADE101.MANUAL for update access. DEF EMP. 02 EMP-NAME PIC X(10). 02 EMP-ID PIC 9(6) COMP. 02 EMP-SALARY PIC 9(7)V9(2). END. Definition EMP size is 23 bytes.
DDL Compiler Commands OUT Command CREATE EMPLOYEE RESET SET FORMAT 1 SET TYPE K SET KEYLEN 16 SET REC 16 SET BLOCK 4096 SET IBLOCK 4096 SET EXT( 4, 32 ) SET MAXEXTENTS 100 CREATE EMPLOYE0 OUT Command The OUT command instructs the DDL compiler to list source lines on a listing destination different from the one specified in the DDL run command. OUT [ listing-destination ] listing-destination specifies where listing is sent, either as a file name or the name of an output device.
DDL Compiler Commands OUTPUT_SENSITIVE Command OUT Command Example The following example shows placement of OUT commands in the source file to control printing of source lines and messages: *beginning of source file List source lines on listing destination from . the DDL run command . . ?OUT $S.#printer List source lines and error messages on $S.#printer; . also list error messages on the listing destination from . the DDL run command . Stop listing on $S.
OUTPUT_SENSITIVE Command DDL Compiler Commands • • In order to get case-sensitive output for a particular definition, record, or constant, the OUTPUT_SENSITIVE compiler command should be used before adding that definition, record, or constant to the dictionary. If a definition, record, or constant is defined using the OUTPUT_SENSITIVE (or NOOUTPUT_SENSITIVE) compiler command, then the user must use the same definition while requesting output for that definition, record, or constant.
DDL Compiler Commands OUTPUT_SENSITIVE Command STRUCT CUTNAME; BEGIN STRING BYTE [1:10]; END; STRUCT CDT^ID; BEGIN STRING BYTE [1:6]; END; END; TAL output produced for KISHOY. !?OUTPUT_SENSITIVE !DEF emp. !02 emp-NAME PIC X(10). !02 emp-ID PIC 9(6) COMP. !END. Definition emp size is 14 bytes. Definition emp added to dictionary.
DDL Compiler Commands PAGE Command PAGE Command The PAGE command directs the DDL compiler to list the next input line at the top of the next page. Optionally, the PAGE command can also specify a page title. PAGE [ "listing-title" ] listing-title is an ASCII character string. Quotation marks must enclose the string. PAGE Command Guidelines The following points are guidelines for using the PAGE command: • • • The PAGE command can be placed anywhere in the DDL source listing.
DDL Compiler Commands PASCAL Command PASCAL opens the specified Pascal source file, translates all subsequent DDL objects defined by statements or output from the dictionary into Pascal source statements, and writes them to the open Pascal source file. If a Pascal source file is already open, the command closes the current file and opens a new source file. pascal-source-file identifies the Pascal source file. If pascal-source-file is omitted, DDL lists the Pascal source statements at the home terminal.
PASCAL Command DDL Compiler Commands ° Appends _DEF to every group definition name and record name (but not to any field definition name) ° Appends _KEY to every primary-key name and alternate-key name As a result, the maximum length for the name of a DDL group definition, record, or key that is to be written to Pascal is 27 ASCII characters, not the standard DDL name length of 30 characters. • • • For the data types that DDL generates for Pascal source code, see Table C-4 on page C-8.
DDL Compiler Commands PASCALBOUND Command CONST CUSTOMER_CUSTNAME_KEY = 25454; PASCALBOUND Command The PASCALBOUND command sets the lower bound for Pascal arrays. This value is stored in the dictionary with the field or group definition. PASCALBOUND { 0 | 1 } PASCALBOUND 0 assigns any subsequent Pascal arrays a lower bound of 0. PASCALBOUND 1 assigns any subsequent Pascal arrays a lower bound of 1. PASCALBOUND 1 is the default.
PASCALCHECK Command DDL Compiler Commands PASCALBOUND Command Example This example illustrates both PASCALBOUND settings: ?PASCAL Open Pascal source file . PASCALBOUND is 1 by default . . Change PASCALBOUND to 0 ?PASCALBOUND 0 DEF test0 PIC X(10). ?PASCALBOUND 1 Return to default setting DEF test1 PIC X(10). VST920.
PASCALCHECK Command DDL Compiler Commands ° A name cannot be longer than 31 ASCII characters. A name might become longer because DDL appends _DEF or _KEY to the end of the name of a definition, record, or key. ° ° Pascal reserved words cannot be DDL names. A Pascal named substructure that contains word data must be word aligned.
DDL Compiler Commands PASCALNAMEDVARIANT Command PASCALNAMEDVARIANT Command The PASCALNAMEDVARIANT command generates the last DDL REDEFINES clause for Pascal as a named variant record. NOPASCALNAMEDVARIANT generates the clause as an anonymous variant record.[ [ NO ] PASCALNAMEDVARIANT PASCALNAMEDVARIANT generates the REDEFINES clause in the last element as a named variant record in Pascal output.
REPORT Command DDL Compiler Commands • • • • The REPORT command produces a schema report when DDL compiles the schema; REPORT can be placed in a DDL run command or in the schema itself. Only one report file can be open at a time. If you use the REPORT command when you already have a report file open, DDL closes the current report file before opening the new report file. The report on each DDL object is written to a separate report page.
RESET Command DDL Compiler Commands 001 002 003 004 01 NAME 02 LAST-NAME 02 FIRST-NAME 02 MIDINIT 0 0 12 20 Group 22 Character 12 Character 8 Character 2 Definition size is 22 bytes. If any object is defined by reference to another object, the name of the referenced object appears under the heading “Source Definition.” RESET Command The RESET command stops compilation of a current statement and returns to the state before compilation of that statement began.
DDL Compiler Commands SAVE Command SAVE Command The SAVE command instructs the DDL compiler to save (or purge) the currently open dictionary when the dictionary is closed.[ [ NO ] SAVE SAVE directs the DDL compiler to save the currently open dictionary when the dictionary is closed. SAVE is the default. NOSAVE directs the DDL compiler to purge the contents of the currently open dictionary when the dictionary is closed. The NOSAVE command is ignored if the dictionary is part of a Pathmaker project.
SECTION Command DDL Compiler Commands SAVE Command Example In the following example, ERRORS 1 directs the DDL compiler to cease processing the schema when it encounters the first error. While NOSAVE is in effect, it directs the compiler to purge the dictionary when compilation terminates. The SAVE command is executed only if compilation reaches the ?SAVE line with no errors. 44> DDL First line of DDL source !?ERRORS 1 schema !?NOSAVE !?DICT $data.sales . Body of DDL source . schema .
SETLOCALENAME Command DDL Compiler Commands SECTION Command Example The following source file has two sections: SALES-FILES and EMPLOYEE-FILES. Note that the EMPLOYEE-FILES section is made up of two portions of the source schema separated by the SALES-FILES section. * first line of DDL source schema ?SECTION employee-files . . . ?SECTION sales-files . Sales files section . . ?SECTION employee-files . . . * last line of DDL source schema employee files section VST925.
DDL Compiler Commands SETSECTION Command SETLOCALENAME Command Example The following example shows the use of the SETLOCALENAME command to generate output for text items in French. ? DICT ! ? COBOL COBSRC ! ? SETLOCALENAME no_NO.ISO8859-1 CONSTANT custnum-heading VALUE "Finnish" LN"fi_FI.ISO8859-1" "Norwegian" LN"no_NO.ISO8859-1" "Danish" LN"da_DK.ISO8859-1".
SETSECTION Command DDL Compiler Commands • • • • If SETSECTION is not specified or if SETSECTION is specified without sectionname, DDL precedes each DDL object in the open source-code files with a ?SECTION heading that uses the DDL object name as the section name. The SETSECTION command affects only host-language source files (except TACL source files) and DDL source files opened by the DDL command.
DDL Compiler Commands SOURCE Command SOURCE Command The SOURCE command directs the DDL compiler to compile a DDL source-schema file or specified sections of that file. SOURCE source-name [ ( section-name [ , section-name ] ...) ] source-name identifies the source-schema file to be compiled; source-name is a file name. section-name identifies a section within the source-schema file. If you do not specify a section, DDL compiles the entire source schema.
SPACING Command DDL Compiler Commands SOURCE Command Example In the following example, DDL opens a new DDL source file called NEWSRC. DDL first compiles all of FILE1 and writes it to NEWSRC; then compiles SECT-1 and SECT-3 of FILE2 and appends them to the contents of NEWSRC; and lastly, compiles SECT-1 and SECT-5 of FILE3 and appends them to the end of NEWSRC. 45> DDL !?DICT !?DDL newsrc !?SOURCE file1 !?SOURCE file2 (sect-1, sect-3) !?SOURCE file3 (sect-1,!? Continuation line sect-5) !EXIT VST926.
DDL Compiler Commands TACL Command TACL Command The TACL command instructs the DDL compiler to: • • • • Create and open a TACL source file or open an existing TACL source file. Translate all subsequent statements that define DDL objects into TACL source statements. Translate any DDL objects specified in subsequent OUTPUT statements into TACL source statements. Write the TACL source statements to the TACL source file.
DDL Compiler Commands • • • • • • • • • • TACL Command If the TACL source file already exists and the exclamation point is omitted, DDL appends the DDL objects to the end of the file’s original contents. DDL does not replace any existing structures. The compiler can translate DDL objects specified in an OUTPUT statement only if the dictionary containing these objects is open.
DDL Compiler Commands TACL Command For the definition of the CUSTOMER record, see the sample database schema in Appendix B, Sample Schemas.” ?DICT ?TACL \dallas.$data.sales.taclsrc OUTPUT RECORD customer.
DDL Compiler Commands TACLGEN Command TACLGEN Command The TACLGEN command instructs the DDL compiler to use a specified TACL code generation version. TACLGEN 0 TACLGEN specifies a source code generation version to use when you generate TACL code. The default is 0, which specifies the current version of TACL code. 0 specifies that DDL generates code for the current version of TACL.
DDL Compiler Commands TAL Command tal-source-file identifies the pTAL or TAL source file. If tal-source-file is omitted, DDL lists the pTAL or TAL source code at the home terminal. ! purges the contents of an existing pTAL or TAL source file before opening the file. If the specified file does not exist, DDL ignores the exclamation point. NOTAL closes the currently open pTAL or TAL source file and stops translating subsequent DDL objects. NOTAL is the default.
DDL Compiler Commands ° ° TAL Command Appends ^WLN to every SPI TOKEN-MAP name Appends ^KEY to every primary-key name and alternate-key name As a result, the maximum length for the name of a DDL group definition, record, token map, or key that is to be written to pTAL or TAL is 27 ASCII characters, not the standard DDL name length of 30 characters.
TALALLOCATE Command DDL Compiler Commands END; STRUCT ADDR; BEGIN STRUCT ADDRESS; BEGIN STRING BYTE [1:22]; END; STRUCT CITY; BEGIN STRING BYTE [1:14]; END; STRUCT STATE; BEGIN STRING BYTE [1:2]; END; STRUCT ZIP^CODE; BEGIN STRING BYTE [1:5]; END; END; END; LITERAL CUSTOMER^CUSTNUM^KEY = %000000; LITERAL CUSTOMER^CUSTNAME^KEY = %061556; !"cn" TALALLOCATE Command The TALALLOCATE command allocates memory in pTAL or TAL for single-field definitions.
TALBOUND Command DDL Compiler Commands DEF number Pic "9(5)". STRUCT NUMBER; BEGIN STRING BYTE [1:5]; END; ?NOTALALLOCATE DEF status TYPE ENUM BEGIN. 89 no-error. 89 read-error. 89 write-error VALUE 6. END. LITERAL NO^ERROR = 0, READ^ERROR = 1, WRITE^ERROR = 6; DEFINE STATUS = INT #; DEF letter Pic "X". DEFINE LETTER = STRING #; DEF number Pic "9(5)". STRUCT NUMBER (*); BEGIN STRING BYTE [1:5]; END; TALBOUND Command The TALBOUND command sets the lower bound for pTAL or TAL arrays.
TALCHECK Command DDL Compiler Commands In the array bounds, number is the number of occurrences of a field described with an OCCURS clause, or the number of characters in a field described with an alphanumeric PICTURE or a TYPE CHARACTER clause. If you specify TALBOUND 1, the array bounds are: [1:number] TALBOUND Command Example This example illustrates both TALBOUND settings: ?TAL . . . ?TALBOUND DEF test0 ?TALBOUND DEF test1 Open TAL Source File TALBOUND is 1 by default 0 PIC X(10). 1 PIC X(10).
TALCHECK Command DDL Compiler Commands NOTALCHECK terminates the TALCHECK checking. If a pTAL or TAL source file is not open, NOTALCHECK is the default. TALCHECK Command Guidelines The following points are guidelines for using the TALCHECK command: • • • If a pTAL or TAL source file is open, the compiler performs checks whether or not TALCHECK is set. You can stop pTAL or TAL syntax checking by specifying NOTALCHECK; you can restart checking with a subsequent TALCHECK.
DDL Compiler Commands TALUNDERSCORE Command In the message, name is the name of the object checked by TALCHECK. TALUNDERSCORE Command The TALUNDERSCORE command converts hyphens in DDL names to underscores in pTAL or TAL output. NOTALUNDERSCORE converts hyphens in DDL names into circumflex characters in pTAL or TAL output. [ NO ] TALUNDERSCORE TALUNDERSCORE converts hyphens in DDL names to underscores in pTAL or TAL output.
DDL Compiler Commands TEDIT Command edit-file-name identifies an EDIT file. If you omit edit-file-name, DDL uses the last editfile-name and the last edit-parameter, if any, specified in the current DDL session. edit-parameter is any valid PS Text Edit command. You can enter multiple commands, separated by semicolons. After opening the EDIT file, PS Text Edit executes any subsequent commands until it closes the file.
TIMESTAMP Command DDL Compiler Commands TEDIT Command Example The following example illustrates using TEDIT to change a source file interactively; it also illustrates how DDL handles a default EDIT-file name and PS Text Edit parameter: 48> DDL DICT !?DDL ddlfil !RECORD sum. . . . !?NODDL !?TEDIT ddlfil . . . !?SOURCE ddlfil !?TEDIT . . . Open DDLFIL Add a record Close DDLFIL Start a PS TEXT EDIT process Add the record to the dictionary Use the previous file VST930.
VALUES Command DDL Compiler Commands TIMESTAMP Command Example The following example illustrates selective listing or suppression of the timestamp comments in a COBOL source file: ?COBOL cobsrc DEF aa PIC X(8). ?NOTIMESTAMP DEF bb PIC 9(5). • • • ?TIMESTAMP RECORD rec1. FILE IS $data.sales.rec1 02 aa TYPE *. 02 bb TYPE *. END KEY-SEQUENCED.
VALUES Command DDL Compiler Commands VALUES Command Guidelines The following points are guidelines for using the VALUES command: • • • The VALUES command does not affect VALUE clauses associated with level 88 items or with CONSTANT, TOKEN-CODE, TOKEN-MAP, or TOKEN-TYPE statements. When the VALUES command is specified and DDL is generating source code for FORTRAN, the compiler translates any initial values into comments.
WARN Command DDL Compiler Commands WARN Command .The WARN command directs the DDL compiler to list all warning messages on the DDL compiler listing. NOWARN suppresses warning messages on the listing. [ NO ] WARN WARN writes compilation warnings to the DDL listing. WARN is the default. NOWARN suppresses warning messages on the DDL listing. You can suppress warning messages for selected portions of the source code as follows: *start of source file . By default, list any warning . messages .
WARNINGS Command DDL Compiler Commands • • • • • If WARNINGS is specified but max-warnings is omitted, DDL stops compilation after the first warning; thus, WARNINGS is the same as WARNINGS 1. When compilation terminates because the specified number of warnings is exceeded, DDL closes an open dictionary and any open files, issues session statistics, and terminates. The specified maximum number of warnings applies only to warnings that occur after the appearance of the WARNINGS command.
10 Dictionary Maintenance Dictionary maintenance includes the following functions: • • • • • • • • • • • Generating a new (backup) source schema from an existing dictionary Adding new objects to the dictionary Deleting existing objects from the dictionary Modifying existing dictionary objects Making major modifications to an existing dictionary Changing dictionary security Moving a dictionary from one subvolume to another Purging a dictionary from a subvolume Increasing the size of dictionary files Rebu
Adding New Dictionary Objects Dictionary Maintenance The following example re-creates the database schema for the dictionary on $DATA.SALES and writes it to the new file SCHEMBAK: 39> DDL !?DICT $data.sales !?DDL $data.sales.schembak ! !OUTPUT *. !EXIT Open the dictionary Open a new source file VST1001.vsd Adding New Dictionary Objects Adding a new dictionary object is usually easier than modifying an existing object because a new object cannot be referenced by an existing object.
Deleting Dictionary Objects Dictionary Maintenance The following example adds a new record to the dictionary on $DATA.SALES: Specify a new record 40> EDIT newsrc !; ADD 1 RECORD dependents. 2 FILE IS $data.sales.empdep KEYSEQUENCED 3 AUDIT. 4 02 dep-key. 5 04 empnum TYPE *. 6 04 depnum PIC X(4). 7 02 depname TYPE name. 8 02 age PIC 9(2). 9 02 sex PIC X(2). 10 88 female VALUE "01". 11 88 male VALUE "02". 12 KEY IS dep-key. 13 END 14 // *EXIT VST1002.vsd Return to the command interpreter.
Dictionary Maintenance Deleting Unreferenced Objects objects. The technique for deleting referenced objects is described later in this subsection under Deleting Referenced Objects, following. Deleting Unreferenced Objects When you delete a record, an SPI token code, or an SPI token map, you need not be concerned that the deletion affects other objects in the dictionary. These objects are never referenced by other objects. Other objects that can be referenced might also be unreferenced.
Deleting Referenced Objects Dictionary Maintenance If the object you want to delete is never referenced by another object, use the technique described under Deleting Unreferenced Objects, preceding. If the object you want to delete is referred to, you must first delete the referring objects in an exact sequence. Consider the following example: CONSTANT a DEF b DEF c VALUE IS 1. TYPE BINARY TYPE b. VALUE IS a.
Deleting Referenced Objects Dictionary Maintenance b. Use the EDIT command to examine the DDL source file. Make a note of the name of the section that contains the DELETE statements produced by OUTPUT UPDATE; then exit from the editor. 5. Delete all the referring objects from the dictionary. Use the SOURCE command to submit the DDL source file section containing the DELETE statements for these objects to the DDL compiler.
Modifying Dictionary Objects Dictionary Maintenance The following example of an interactive DDL session shows the DDL statements and commands needed to delete AGE; it also shows the response of the DDL compiler to each statement and command. Run DDL and open 44> DDL DICT $data.sales Dictionary opened on subvol $DATA.SALES for update access dictionary Open new DDL source file !?DDL delfile Output source for DDL is opened on $DATA.SALES.DELFILE !OUTPUT UPDATE age.
Dictionary Maintenance Modifying Unreferenced Objects object is referenced by other objects, then you must first delete and then redefine the referring objects. Objects that can be referenced by other objects are constants, definitions, and SPI token types. Modifying these objects is described under Modifying Referenced Objects on page 10-9. Objects that are never referenced by other objects are records, SPI token codes, and SPI token maps. Modifying these objects is described next.
Modifying Referenced Objects Dictionary Maintenance the record definition, and then compile the record definition back into the dictionary with a SOURCE command; for example: 45> DDL DICT $data.sales Run DDL and open dictionary !?DDL newsrc ! Open and clear source file !OUTPUT RECORD orders. Write record definition to Loading Record ORDERS source file DDL source output produced for ORDERS Close source file !?NODDL List and edit record !?EDIT newsrc;LA ORDERS 3 ?Section ORDERS 6 Record ORDERS.
Modifying Referenced Objects Dictionary Maintenance Before you can modify a referenced object, you must first delete any objects that refer to that object. After you modify the object, you must redefine the deleted objects. The deletion and the redefinition must be done in exact sequence. For example: CONSTANT a DEF b DEF c VALUE IS 1. TYPE BINARY TYPE b. VALUE IS a. To modify the constant A, you must first delete definition C and then delete definition B in that order.
Dictionary Maintenance Modifying Referenced Objects DDL EDIT command; if you exit from DDL, you run the editor from the command interpreter. 6. Compile the DDL source file. If you are still in an interactive session, use the SOURCE command to submit the source file to the compiler. If you exited from DDL after Step 4, run the DDL compiler from the command interpreter specifying the DDL source file as the input file. Suppose postal zip codes must be changed from five digits to nine digits.
Making Major Modifications Dictionary Maintenance Run DDL and open dictionary 47> DDL DICT $data.sales Dictionary opened on subvol $DATA.SALES for update access !?DDL modfile ! Output source for DDL is opened on $DATA.SALES.MODFILE !OUTPUT UPDATE zip-cd.
Making Major Modifications Dictionary Maintenance generate a new schema exactly as described under Generating a Backup Schema on page 10-1. Note. do not use the procedure for generating a new schema to modify a dictionary that is part of a Pathmaker catalog. Pathmaker dictionaries contain application design information that is not in generated DDL schemas.
Changing Dictionary Security Dictionary Maintenance Changing Dictionary Security Dictionary files are created with the default file-creation security of the user who created them. If you are the owner of the files, you can change the security applied to the dictionary files by the DDL compiler with the FUP SECURE command. Follow these steps to change file security: 1. Use the FUP INFO command to determine the current security of the dictionary files. 2.
Moving a Nonaudited Dictionary Dictionary Maintenance Moving a Nonaudited Dictionary To move a nonaudited dictionary: 1. Duplicate the dictionary files on another subvolume using FUP DUP commands. 2. Change the subvolume name of the alternate key file in the file label of each dictionary file that has alternate keys using FUP ALTER commands.
Dictionary Maintenance Moving an Audited Dictionary disable auditing before using FUP DUP to duplicate files, then use FUP ALTER to reenable auditing after duplicating the files. • • When you use FUP ALTER to disable auditing on a file that uses alternate keys, FUP also disables auditing on the associated alternate key file. As a result, any other files that use the same alternate key will be associated with a nonaudited alternate key file.
Moving an Audited Dictionary Dictionary Maintenance For example, to move an audited dictionary from $MKT.SALESDIC to $DATA.SALES, you can build and then execute a source file that contains the following commands: VOLUME $mkt.
Purging a Dictionary Dictionary Maintenance Purging a Dictionary You can purge a dictionary by purging each dictionary file individually or, if the dictionary is open, by entering the NOSAVE command following the DICT or DICTN command. To purge dictionary files individually, you must know the file names. You can see Appendix D, Dictionary Database Structure, for the file names, or you can position yourself on the subvolume that contains the dictionary and use a FILES command to list the dictionary files.
Increasing Dictionary File Size Dictionary Maintenance Increasing Dictionary File Size The DDL compiler creates the dictionary files with the primary and secondary extent sizes listed in Table 10-1. Table 10-1.
Rebuilding a Dictionary Dictionary Maintenance If you are altering only one file, you can use a single FUP command to change MAXEXTENTS. The following commands increase the size of DICTOTF and verify the change: 63> FUP ALTER DICTOTF, MAXEXTENTS 200 64> FUP INFO DICTOTF, DETAIL $DATA.SALES.DICTOTF TYPE K CODE 203 . . . Verify change MAXEXTENTS 200 . . . VST1013.
Rebuilding an Audited Dictionary Dictionary Maintenance To illustrate these procedures, this example rebuilds a dictionary with a schema generated from a corrupted dictionary. 65> DDL !?DICT $data.sales !?DDL $data.newsales.ddlsrc !OUTPUT * !?NODDL !?DICT $data.newsales !?SOURCE $data.newsales.ddlsrc !EXIT In some cases, you cannot generate a source schema from a corrupted dictionary.
Converting a Dictionary Dictionary Maintenance • • • Version 5, used by C20 and C30 versions of the DDL compiler. Version 6, used by D00, D10, and D20 versions of the DDL compiler Version 7, used by D30 and later version of the DDL compiler To have full use of a dictionary created with DDL software prior to version D00 from a D-series version of DDL, follow the conversion procedures described in this subsection. Note.
Dictionary Maintenance Converting a Dictionary Alternately, you can keep a dictionary with the earlier dictionary description in one subvolume and the D-series dictionary or G-series dictionary description in another subvolume. Use the earlier dictionary for Enform reports for unconverted files and the D-series or G-series dictionary for Enform reports on D-series or G-series files. To change the dictionary description, do this: 1. Move to the subvolume $SYSTEM.DDL. 2.
Dictionary Maintenance Converting a Dictionary Data Definition Language (DDL) Reference Manual—426798-002 10 -24
A DDL Messages This appendix lists all of the DDL error and warning messages in alphabetic order. For each message, it gives the cause, describes the action taken by the DDL compiler, and provides a recovery procedure. During DDL processing, you might receive a message from a sequential I/O procedure. Sequential I/O error messages, numbered from 500 to 600, are not documented in this manual.
DDL Error and Warning Messages DDL Messages A non PACKED-DECIMAL item was specified in group - group_name Cause. The group identified by group_name is described with a USAGE IS COMP-3, COMPUTATIONAL-3, or PACKED-DECIMAL clause but contains a field with a data type that is not PACKED-DECIMAL. Effect. DDL rejects the object. For example: !DEF EMP8. !02 FLD8 PIC 9(5). !END. Definition EMP8 size is 5 bytes. Definition EMP8 added to dictionary. !DEF EMP9. !02 FLD9 TYPE EMP8 COMP-3. !END.
DDL Error and Warning Messages DDL Messages Recovery. Qualify the referenced field, or rename one of the fields so that no ambiguity exists, and recompile the object. ***ERROR*** Attribute already specified- attribute Cause. A definition attribute clause is specified more than once for the same field, or a file creation attribute is specified more than once for the same record. Effect. DDL rejects the object. Recovery. Remove the repeated clause or file-creation attribute and recompile the object.
DDL Error and Warning Messages DDL Messages Cause. You specified a bit field as a key. Effect. DDL rejects the object. Recovery. Specify a field of a type other than bit as the key. ***ERROR*** BLOCK must be 512, 1024, 2048, or 4096 bytes Cause. A block length other than 512, 1,024, 2,048, or 4,096 bytes was specified. Effect. DDL rejects the object. Recovery. Specify a valid block length and recompile the object. ***ERROR*** BLOCK specified for an UNSTRUCTURED file Cause.
DDL Error and Warning Messages DDL Messages Recovery. Change the file type to unstructured or change BUFFERSIZE to BLOCK and recompile. ***ERROR*** C DEF or RECORD or union tag name too long Cause. The name of a definition or record exceeds the limit of 31 ASCII characters that C allows for these names. Effect. DDL does not write the definition or record to the C source file. Recovery. Shorten the name and recompile the definition or record. ***WARNING*** C OUTPUT DIAGNOSTICS: Cause.
DDL Error and Warning Messages DDL Messages /* Constant EMP1 created on 07/21/2000 at 19:45 */ #define EMP1 “JYOTI” C output produced for EMP1. ?!NOC Output source for C is closed. ***WARNING*** CIFNDEF or CIFDEF is not ended by CENDIF for C output ! Recovery. No recovery is necessary. Just ensure that the required number of ?CENDIF statements were used. ***WARNING*** COBOL base is not a legal positive int- value not changed Cause.
DDL Error and Warning Messages DDL Messages Recovery. Change the file code to an integer from 0 to 99 or from 1,000 to 65,535 and recompile the statement. ***WARNING*** COLUMNS must be between 12 and 132- value not changed Cause. The COLUMNS command specified fewer than 12 or more than 132 columns. Effect. DDL does not change the number of significant columns in an input line. Recovery. Reissue the COLUMNS command with a value from 12 to 132.
DDL Error and Warning Messages DDL Messages ***ERROR*** COMP item found within VALUE Cause. You have defined a computational item within a group defined with a VALUE clause. For example, the following definition is invalid: Def a. 02 b value zeros. 03 c pic 9 comp. End An initial value at the group level must be alphanumeric. Effect. DDL rejects the object. Recovery. Change the data type of the computational item, or remove the VALUE clause from the group.
DDL Error and Warning Messages DDL Messages *** ERROR *** COMP-3 data item must be of the form PIC [S]9(n)[V9(n)] Last diagnostic on page 1 *** WARNING *** Errors detected - no output produced for EMP ! Recovery. Correct the error and recompile. ***ERROR*** COMP-3 specified with reference item which is not COMP-3 - element_name Cause. The data type of the item identified as element_name is described with a USAGE IS COMP-3, COMPUTATIONAL-3, or PACKED-DECIMAL clause but is not a PACKED-DECIMAL item.
DDL Error and Warning Messages DDL Messages ***ERROR*** CONSTANT in Pascal exceeds DDL’s 130-byte limitconstant-name Cause. A CONSTANT statement has a value that is greater than the 130 ASCII character limit set for DDL. Effect. DDL does not generate Pascal code for the constant or for any object that refers to the constant. Recovery. Shorten the constant value and regenerate the Pascal constant or object that refers to the constant.
DDL Error and Warning Messages DDL Messages ***ERROR*** DCOMPRESS made record one byte too long for block Cause. The record definition of a key-sequenced file contains a DCOMPRESS clause that makes the block size of the record 1 byte longer than specified in the BLOCK clause. Effect. DDL rejects the object. Recovery. Specify a smaller record size, or remove the DCOMPRESS clause. ***ERROR*** DCOMPRESS specified but promary key has nonzero offset Cause.
DDL Error and Warning Messages DDL Messages ***WARNING*** DDL OUTPUT DIAGNOSTICS: Cause. You requested DDL output, but the object does not conform to DDL rules. Effect. A message follows describing the DDL error. DDL does not write the object to the DDL source file. Recovery. Correct the error and recompile. ***ERROR*** DEF or RECORD exceeds C 32767-byte limitobject-name Cause. A definition or record generates a C structure that is greater than 32,767 bytes. Effect.
DDL Error and Warning Messages DDL Messages ***ERROR*** DEFINITION not found Cause. A definition named in a TOKEN-MAP or a TOKEN-TYPE statement cannot be found in the dictionary. Effect. DDL rejects the token map or token type. Recovery. Correct the definition name or add the referenced definition to the dictionary, then recompile the token map or token type. ***ERROR*** Definition or record name already used Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** Dictionary conversion failed Cause. DDL was unable to convert the dictionary. To determine the cause, see the preceding error message in your output listing. Effect. The dictionary is not converted. Recovery. Correct the error and rebuild the dictionary.
DDL Error and Warning Messages DDL Messages ***FATAL ERROR*** DICTIONARY IS CORRUPT- purge and restart Cause. Data stored in the dictionary is in an inconsistent state, or some of the dictionary files are missing. Effect. DDL closes the dictionary and output files and stops processing. Recovery. Purge the dictionary files manually and rebuild the dictionary from a saved source. ***ERROR*** Dictionary is only partially purged in subvolsubvolume-name Cause.
DDL Error and Warning Messages DDL Messages Cause. You attempted to convert a current dictionary. Effect. DDL closes the dictionary and stops processing. Recovery. No recovery is necessary. ***ERROR*** Disk file exists but is not an EDIT file Cause. A COBOL, DDL, FORTRAN, FUP, TACL, TAL, C, or Pascal command specified a file that is not in EDIT format. Effect. DDL does not produce the requested source code. Recovery.
DDL Error and Warning Messages DDL Messages ***WARNING*** EDIT did not recieve the startup message- File error file-error Cause. The EDIT or T4/18/07EDIT process did not receive a startup message because of the file error identified by file-error. Effect. DDL cannot start the EDIT or TEDIT process. Recovery. Reissue the EDIT or TEDIT command. If the problem persists, see your system manager ***WARNING*** EDIT file could not be opened- File error file-error Cause.
DDL Error and Warning Messages DDL Messages Cause. A NEWPROCESS error occurred during creation of the EDIT or TEDIT process. No user error is implied. Effect. DDL cannot start the EDIT or TEDIT process. Recovery. Reissue the EDIT or TEDIT command. If problem persists, consult your system manager. ***WARNING*** EDIT stopped or abnormally ended during execution Cause. Usually, this is a system error. Effect. DDL stops the EDIT or TEDIT process. Recovery. Consult your system manager.
DDL Error and Warning Messages DDL Messages ***ERROR*** Element being redefined redefines another element Cause. An element has a REDEFINES clause redefining an element that also has a REDEFINES clause, and the first element refers to a different field than the second element Effect. DDL rejects the object. Recovery. Change the REDEFINES clause in the first element to refer to the same field as does the REDEFINES clause in the second element.
DDL Error and Warning Messages DDL Messages Recovery. Change the name and recompile for Enform access. If Enform is not to be used, recompilation is not necessary. ***ERROR*** ENUM values out of range for bit fieldfield-name Cause. The enumeration definition specified for a bit field has a value or values that do not fit in the bit field. Effect. DDL rejects the object that includes the bit field. Recovery.
DDL Error and Warning Messages DDL Messages ***WARNING*** Errors detected- no output produced for object-name Cause. DDL detected one or more errors while processing the statement for objectname. Effect. DDL rejects the object. Recovery. Correct the error or errors and recompile. ***WARNING*** ERRORS is not a legal positive integer- value not changed Cause. The ERRORS command specifies an integer that is not in the range 1–32767. Effect. DDL ignores the ERRORS command. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** EXT must be a positive integer Cause. A value for EXT is equal to or less than 0; the extent size must be a positive integer. Effect. DDL rejects the object. Recovery. Correct the extent size and recompile. ***ERROR*** External clause must be on object name level Cause. You specified an EXTERNAL clause for a DEFINITION statement and the clause was not on the object name level. Effect. DDL does not execute the DEFINITION statement. Recovery.
DDL Error and Warning Messages DDL Messages Effect. DDL rejects the object. Recovery. Remove the OCCURS DEPENDING ON clause for the field and recompile. ***WARNING*** File name ignored when opening dictionary Cause. A fully qualified file name was specified as a dictionary subvolume in a DICT, DICTN, or DICTR command. Effect. DDL ignores the file name and opens the dictionary on the specified subvolume. Recovery. No recovery is necessary. ***WARNING*** File name not specified Cause.
DDL Error and Warning Messages DDL Messages Recovery. Remove the HEADING clause and recompile. ***ERROR*** Filler cannot have a HELP clause Cause. A FILLER field is described with a HELP clause. Effect. DDL rejects the object. Recovery. Remove the HELP clause and recompile. ***ERROR*** Filler cannot have a KEYTAG clause Cause. A FILLER field is described with a KEYTAG clause. Effect. DDL rejects the record. Recovery. Remove the KEYTAG clause and recompile.
DDL Error and Warning Messages DDL Messages Recovery. Remove the TACL clause and recompile. ***ERROR*** Filler cannot have an EXTERNAL clause Cause. A FILLER field is described with an EXTERNAL clause. Effect. DDL rejects the object. Recovery. Remove the EXTERNAL clause and recompile. ***ERROR*** Filler cannot have an UPSHIFT clause Cause. A FILLER field is described with an UPSHIFT clause. Effect. DDL rejects the object. Recovery. Remove the UPSHIFT clause and recompile.
DDL Error and Warning Messages DDL Messages ***WARNING*** FORTRAN OUTPUT DIAGNOSTICS: Cause. You requested FORTRAN output, but the object does not conform to FORTRAN syntax rules. Effect. A message follows describing the FORTRAN error. DDL does not write the object to the FORTRAN source file. Recovery. Correct the error and recompile if you want FORTRAN output.
DDL Error and Warning Messages DDL Messages ***WARNING*** FUP OUTPUT DIAGNOSTICS: Cause. You requested FUP output, but the object does not conform to FUP rules. Effect. A message follows describing the FUP error. DDL does not write the object to the FUP source file. Recovery. Correct the error and recompile. ***WARNING*** FUPBLOCKSIZE must be from 1 to 4096- value not changed Cause. A RECORD statement specified a block size less than 1 or greater than 4,096. Effect.
DDL Error and Warning Messages DDL Messages ***ERROR*** Group level initialization VALUE must be alphanumeric Cause. You specified a numeric value with a VALUE clause for a group; group values must be alphanumeric Effect. DDL rejects the object. Recovery. Specify an alphanumeric value and recompile. ***ERROR*** Group with initial VALUE contains MUST BEgroup-name Cause. You specified a VALUE clause for a group that contains a field described with a MUST BE clause.
DDL Error and Warning Messages DDL Messages Recovery. Shorten the name and recompile. ***ERROR*** Improper type of Constant for this usage Cause. A constant is used as a value, but the constant data type is not consistent with the data type of the object receiving the value. Effect. DDL rejects the object. Recovery. Check the data type and use a constant whose value is a number for a numeric type or a string for an alphanumeric type, then recompile the object.
DDL Error and Warning Messages DDL Messages Cause. A field described with the USAGE IS INDEX clause is the wrong size for COBOL85 output. Effect. DDL does not produce the requested output for the object. Recovery. Change the size of the index field, specify an index field of the correct size, or request the output appropriate for the field size. ***ERROR*** INDEXED BY is invalid without OCCURS clauseobject-name Cause.
DDL Error and Warning Messages DDL Messages Cause. An input line contains more than 132 ASCII characters. Effect. DDL truncates the line to 132 characters. Recovery. Break the line into several shorter lines and reenter them. ***ERROR*** Integer conversion error- value Cause. A numeric value is greater than 32,767 or less than -32,768. Effect. DDL rejects the object. Recovery. Change the value and recompile. ***WARNING*** Integer type is generated for bit fieldfield-name Cause.
DDL Error and Warning Messages DDL Messages Recovery. Correct the display format and recompile. ***ERROR*** Invalid EDIT picture Cause. The edit picture you specified in an EDIT-PIC clause does not follow the COBOL85 rules for edit pictures. Effect. DDL rejects the object. Recovery. Specify a valid edit picture and recompile. ***WARNING*** Invalid file name Cause. A compiler command specifies an invalid file name. Effect. DDL ignores the command. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** Invalid locale name Cause. The locale name is invalid. Effect. DDL rejects the text item. Recovery. Use a valid locale name. ***ERROR*** Invalid number Cause. You entered an invalid number; for example, %8. Effect. DDL rejects the object containing the invalid number. Recovery. Specify the number correctly and recompile. ***ERROR*** Invalid OCCURS value Cause. In an OCCURS max TIMES clause, the value max is less than or equal to 1. Effect.
DDL Error and Warning Messages DDL Messages Recovery. Correct the error and recompile. ***ERROR*** Invalid size for element type Cause. A TYPE clause specifies a size that is invalid for the particular data type. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** Invalid SSID format Cause. The subsystem ID you specified in an SSID clause is not in the correct format for a subsystem ID. Effect. DDL rejects the object. Recovery.
DDL Error and Warning Messages DDL Messages Recovery. This error cannot be recovered using DDL alone. Report the error to your service provider. ***ERROR*** Invalid value spedified for MAXEXTENTS Cause. You specified a MAXEXTENTS value that is outside the valid range. As many as 978 maximum extents can be specified, but the actual upper limit depends on the number of alternate keys. For more information about maximum extents, see the Enscribe Programmer’s Guide. Effect. DDL rejects the object. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** Item with UPSHIFT found on nonalphabetic data item- field-name Cause. You specified an UPSHIFT clause for a field that does not have an alphabetic data type; UPSHIFT is allowed only for fields described by PIC A, PIC X, TYPE CHARACTER, TYPE *, or TYPE def-name, in which def-name or * is a definition of an alphabetic or alphanumeric type field. Effect. DDL rejects the object. Recovery. Change the data type of the field or remove the UPSHIFT clause.
DDL Error and Warning Messages DDL Messages Effect. DDL rejects the object. Recovery. Specify a different key attribute. ***ERROR*** Key element invalid- Dictionary is corrupt Cause. A dictionary was updated incorrectly. Effect. DDL rejects the object. Recovery. Rebuild the dictionary. ***ERROR*** Key file name already used- file-name Cause. You specified a file name for an alternate key assignment in a RECORD statement that is not unique.
DDL Error and Warning Messages DDL Messages ***ERROR*** KEYTAG with repeating group or element Cause. A field or group that is a key field has an OCCURS clause. Effect. DDL rejects the record. Recovery. Remove the OCCURS clause or the key specification for the field and recompile. ***WARNING*** Language check redundant: output already being produced Cause.
DDL Error and Warning Messages DDL Messages Recovery. Put the level 88 element after a field description and recompile. ***ERROR*** LEvel 88 value inconsistent with data type Cause. A level 88 value is incompatible with the type of the field that the level 88 clause describes. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** Level 89 clause must follow an item with TYPE ENUM Cause. A field definition or description whose type is not ENUM contains a level 89 clause.
DDL Error and Warning Messages DDL Messages Effect. DDL does not do anything. Recovery. If you want DDL to write the record definition to a pTAL or TAL source file without changing the literal name to a comment, shorten the key name and recompile. ***ERROR*** Logical type mixing not supported by FORTRANobject-name Cause. An object to be written to a FORTRAN source file contains both LOGICAL 2 and LOGICAL 4 data types. Effect.
DDL Error and Warning Messages DDL Messages Cause. You have entered a VALUE clause that contains more than one initial value. Effect. DDL rejects the object. Recovery. Remove all but one initial value and recompile. ***ERROR*** More than one sequence clause specifiedrecord-name Cause. The RECORD statement contains more than one SEQUENCE IS clause. Effect. DDL rejects the object. Recovery. Remove all but one SEQUENCE IS clause and recompile.
DDL Error and Warning Messages DDL Messages Effect. If COBOL output is requested, DDL issues a COBOL error message and suppresses COBOL output. Recovery. Remove all but one key at the same offset and recompile. ***ERROR*** Multiple primary keys Cause. More than one key is identified as a primary key; a key-sequenced file has exactly one primary key. Effect. DDL rejects the record. Recovery. Remove all but one key and recompile. ***ERROR*** Must Be not valid on a non-referencing ENUMeration Cause.
DDL Error and Warning Messages DDL Messages !?cendif ***WARNING*** No CIFNDEF or CIFDEF is used for this CENDIF, no output produced for CENDIF. ! Recovery. No recovery is necessary. ***WARNING*** No DDL output file; no UPDATE output produced Cause. A DDL command was not entered to open a DDL source file before an OUTPUT UPDATE statement was issued. Effect. DDL does not generate DDL source update code. Recovery. Specify the DDL command before issuing the OUTPUT UPDATE statement and recompile.
DDL Error and Warning Messages DDL Messages ***ERROR*** No JUSTIFIED clause allowed within a group with VALUE clause Cause. You specified a JUSTIFIED clause for an elementary item that is subordinate to a group item with a VALUE clause. Effect. DDL rejects the object. Recovery. Remove the JUSTIFIED clause or change the group VALUE clause and recompile. ***ERROR*** No level 89 clauses specified for item with TYPE ENUM- field-name Cause.
DDL Error and Warning Messages DDL Messages Effect. DDL closes the dictionary and output files and stops processing. Recovery. Rebuild the dictionary. ***ERROR*** No REDERINES clause allowed within an object with EXTERNAL Cause. You attempted to specify an EXTERNAL clause and one or more line items in the definition or record have a REDEFINES clause. Effect. DDL rejects the record. Recovery. Remove the EXTERNAL clause or the REDEFINES clause and recompile.
DDL Error and Warning Messages DDL Messages Recovery. If you want to run a test compilation using NOSAVE, you can create a test dictionary on a subvolume unconnected with the Pathmaker project. ***ERROR*** NOVALUE cannot be specified unless referencing a DEF name Cause. A NOVALUE clause describes a field that has a PICTURE or TYPE data-type clause; NOVALUE can be used only in definitions that refer to previous definitions with TYPE * or TYPE name clauses. Effect. DDL rejects the object. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** Object element invalid- Dictionary is corrupt Cause. A dictionary was updated incorrectly. Effect. DDL rejects the object. Recovery. Rebuild the dictionary. ***ERROR*** Object is used by some other object(s)object-name Cause. An object you attempted to create or delete is referenced by another object. Effect. DDL does not create or delete the object. Recovery. Delete the referring object before creating or deleting the specified object.
DDL Error and Warning Messages DDL Messages ***WARNING*** Object type not specified- DEF assumed Cause. An OUTPUT UPDATE or SHOW USE OF statement does not include a keyword to specify an object type; DDL assumes the object is a definition. Effect. DDL attempts to execute the statement for a definition. Recovery. If the object is not a definition, specify the object type and resubmit the statement. ***WARNING*** Object type not supported in FORTRANobject-name Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** OCCURS DEPENDING ON found with or within REDEFINES- name Cause. A definition that contains a REDEFINES clause also contains an OCCURS DEPENDING ON clause when COBOL output is requested. Effect. DDL suppresses COBOL output. Recovery. Remove the REDEFINES or OCCURS DEPENDING ON clause and recompile. ***ERROR*** OCCURS DEPENDING ON is not last element or group Cause. A field or group follows a field or group described with OCCURS DEPENDING ON. Effect.
DDL Error and Warning Messages DDL Messages Recovery. Change the file security and manually purge the remaining dictionary files. ***ERROR*** Only one TYPE clause per element allowed Cause. A field definition or description has more than one PICTURE or TYPE clause. Effect. DDL rejects the object. Recovery. Remove all but one PICTURE or TYPE clause and recompile. ***ERROR*** PACKED-DECIMAL data type is not supported in language_name Cause.
DDL Error and Warning Messages DDL Messages Effect. A message follows describing the Pascal error. DDL does not write the object to the Pascal source file. Recovery. Correct the error and recompile if you want Pascal output. ***WARNING*** PATHMAKER subvol check failed, assuming PATHMAKER subvol- subvolume-name Cause. A file error occurred when DDL attempted to determine if the current subvolume is a Pathmaker subvolume. Effect. DDL assumes that the current subvolume is a Pathmaker subvolume. Recovery.
DDL Error and Warning Messages DDL Messages Recovery. Remove DUPLICATES ALLOWED and recompile. ***ERROR*** Primary key specified but file is not keysequenced- file-name Cause. A primary key is declared in a KEYTAG or KEY IS clause, but the FILE IS clause declares the file as other than key-sequenced. Effect. DDL rejects the object. Recovery. Remove the primary key specification, or specify a different file type, and recompile. ***ERROR*** qualified-name cannot be a Level 66 item Cause.
DDL Error and Warning Messages DDL Messages Recovery. Correct the error and recompile. ***ERROR*** Record size too big for file type Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** REDEFINES not allowed on or with bit fieldselement-name Cause. A REDEFINES clause follows the description of a bit field or is with a bit field. Effect. DDL rejects the object. Recovery. Remove the REDEFINES clause or the bit field and recompile the object. ***ERROR*** REDEFINES too large Cause. A field or group is larger than the field or group it redefines. Effect. DDL rejects the object. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** Referenced Def has incompatible alignment Cause. An attempt was made to compile a record or definition with matched2 alignment, that referenced a definition previously compiled without matched2 alignment. Effect. DDL does not add the new record or definition to the dictionary. Recovery. Recompile the referenced definition with matched2 alignment or recompile the referenced definition without matched2 alignment.
DDL Error and Warning Messages DDL Messages Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** RENAMES elements overlap improperly Cause. In a phrase such as “A RENAMES B THRU C,” either field C starts before field B, or field B ends after field C. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** Reserved word- reserved-word Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** Section name not found in source filesection-name Cause. A SOURCE command specifies a section name in a source file, but the section name is not in the source file. Effect. DDL takes no action. Recovery. Correct the error and recompile. ***ERROR*** SETCOBOL cannot be specified when COBOL output file is open Cause. You entered a SETCOBOL74 or SETCOBOL85 command when a COBOL source-code file is open. Effect. DDL takes no action. Recovery.
DDL Error and Warning Messages DDL Messages Recovery. This error affects only the report listing. No recovery is necessary unless you want a report with a different spacing. Use the OUTPUT statement with a correct SPACING command to produce the report you want. ***ERROR*** SPI-NULL conflict in group- group-name Cause. An SPI-NULL clause is associated with a field in a group, but the group has an SPI-NULL clause. Fields within a group inherit the group’s SPI-NULL clause. Effect.
DDL Error and Warning Messages DDL Messages Recovery. Change the DDL definition so that all character or FILLER items contain an even number of characters, use the C_MATCH_HISTORIC_TAL command, or recompile the definition with the CFIELDALIGN_MATCHED2 command set. ***ERROR*** Structure alignment in Pascal is incompatible with DDL- element-name Cause. A DDL definition cannot be translated into Pascal because word alignment is not maintained.
DDL Error and Warning Messages DDL Messages ***ERROR*** TAL DEF or TOKEN MAP name too long Cause. The name of a definition or token map exceeds the limit of 31 ASCII characters pTAL or TAL allows for these names. Effect. DDL does not write the definition or token map to the pTAL or TAL source file. Recovery. Shorten the name, recompile the definition or token map, and request output to the pTAL or TAL source file. ***ERROR*** TAL name literal too long- commenting out Cause.
DDL Error and Warning Messages DDL Messages Effect. DDL closes the dictionary and output files and stops processing. Recovery. Delete objects from the dictionary and recompile. ***ERROR*** THIS DICTIONARY CANNOT BE UPDATED Cause. You do not have write access to the dictionary. Effect. DDL restricts dictionary access to read-only operations. Recovery. Consult your system manager to obtain write access to the dictionary. ***WARNING*** This dictionary IS audited Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** TOKEN-CODE TOKEN-TYPE not specified Cause. No TOKEN-TYPE clause is specified in a TOKEN-CODE statement. Effect. DDL rejects the token code. Recovery. Specify a TOKEN-TYPE clause. ***ERROR*** TOKEN-MAP DEFINITION multiply defined Cause. The DEF IS clause in a TOKEN-MAP statement is already specified. Effect. DDL rejects the token map. Recovery. Remove one of the DEF IS clauses and recompile. ***ERROR*** TOKEN-MAP DEFINITION not specified Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** TOKEN-MAP exceeds TACL 5000-byte limittoken-map-name Cause. A TOKEN-MAP statement generates a TACL structure that is greater than 5,000 bytes. The entire TACL structure, not just individual fields, must be less than or equal to 5,000 bytes. Effect. DDL does not generate TACL output for the specified token map. Recovery. Shorten the definition referenced in the TOKEN-MAP statement and regenerate the TACL source code.
DDL Error and Warning Messages DDL Messages ***ERROR*** TOKEN-TYPE DEFINITION exceeds 254 bytes Cause. The definition referenced in a TOKEN-TYPE statement is longer than 254 bytes. The total length of the definition is derived from the sum of the length of individual fields in the definition, optionally repeated by an OCCURS n TIMES clause. Effect. DDL rejects the token type. Recovery.
DDL Error and Warning Messages DDL Messages ***ERROR*** TOKEN-TYPE OCCURS multiply defined Cause. An OCCURS clause is already specified in the TOKEN-TYPE statement. Effect. DDL rejects the token type. Recovery. Delete one of the OCCURS clauses and recompile. ***ERROR*** TOKEN-TYPE VALUE multiply defined Cause. A VALUE clause is already specified in the TOKEN-TYPE statement. Effect. DDL rejects the token type. Recovery. Delete one of the VALUE clauses and recompile.
DDL Error and Warning Messages DDL Messages Effect. DDL closes the dictionary and output files and stops processing. Recovery. Correct the errors and recompile. ***ERROR*** Too many names- statement has been ignored Cause. An OUTPUT, OUTPUT UPDATE, DELETE, or SHOW USE OF statement has too many definitions or records. Effect. DDL ignores the statement. Recovery. Break the list of definitions or records into two or more statements. ***ERROR*** Too many text (common) lines Cause.
DDL Error and Warning Messages DDL Messages Effect. The dictionary you were trying to delete still exists. Recovery. Determine the status of the files and proceed accordingly. ***ERROR*** Unable to match locale- locale-name Cause. A text item did not have a literal with a locale name the same as specified either with the SETLOCALENAME command, if set, or with the system default locale, if the SETLOCALENAME was not set. Effect. The programming source language statement will not be emitted. Recovery.
DDL Error and Warning Messages DDL Messages Cause. DDL encountered an unexpected error. Effect. DDL issues this message followed by a fatal error message. Recovery. If the problem persists, consult your system manager. ***ERROR*** Union Alignment in C is incompatible with DDLelement Cause. The size of the union field is not a multiple of the alignment of the widest field in the union.
DDL Error and Warning Messages DDL Messages Cause. The value of an unsigned integer has an invalid form: either a negative number or a decimal or octal value. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** Unspecified value Cause. You specified a VALUE clause that does not contain a value. Effect. DDL rejects the object. Recovery. Correct the VALUE clause and recompile the object. ***WARNING*** UNSUPPORTED data type in element Cause.
DDL Error and Warning Messages DDL Messages ***ERROR*** Unterminated SOURCE command on last line not processed Cause. A SOURCE command does not terminate with a file name or a closing parenthesis following a list of section names, or a comma is missing after a section name. Effect. DDL ignores the SOURCE command. Recovery. Correct the error and recompile if necessary. ***ERROR*** Unterminated string Cause.
DDL Error and Warning Messages DDL Messages ***WARNING*** UPSHIFT on referencing item ignored, UPSHIFT inherited field-name Cause. An UPSHIFT clause describes a field that is defined by reference to an existing definition, and the referenced definition already has an UPSHIFT clause. UPSHIFT cannot be overridden in a referring definition. Effect. DDL continues processing. Recovery. Remove the UPSHIFT clause from the referring definition. ***WARNING*** Valid FILLER parameters are 0 and 1.
DDL Error and Warning Messages DDL Messages ***ERROR*** VALUE invalid or inconsistent with data typevalue Cause. The value specified in a VALUE clause cannot be mapped into the declared data type. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** VALUE item found with or within an OCCURS name Cause. A field definition or description contains both OCCURS and VALUE clauses. A field described with an OCCURS clause cannot have an initial value. Effect.
DDL Error and Warning Messages DDL Messages ***ERROR*** VALUE item found with or within REDEFINES name Cause. A field definition or description contains both REDEFINES and VALUE clauses. A field described with a REDEFINES clause cannot have an initial value. Effect. DDL rejects the object. Recovery. Correct the error and recompile. ***ERROR*** Version FOR name not found Cause. The field or group name following the keyword FOR in a TOKEN-MAP VERSION clause cannot be found in the referenced definition.
DDL Error and Warning Messages DDL Messages Recovery. Check the referenced definition, and correct the VERSION clause to specify a field or group name in the referenced definition; then recompile. ***ERROR*** Version THRU name not unique Cause. A field or group name in a definition referenced by a TOKEN-MAP VERSION clause is not unique within the definition. Effect. DDL rejects the token map. Recovery.
B Sample Schemas This appendix contains two schemas: one to define a database and the other to define SPI tokens. Sample Database Schema .The sample database schema defines a database consisting of nine files. The database files are defined in RECORD statements that refer to previous DEFINITION statements for their record structures. Many of the individual and group fields within each record also refer to previous DEFINITION statements.
Database Schema Listing Sample Schemas Database Schema Listing !*************************************************************** ! COMPILER COMMANDS: !*************************************************************** ? ERRORS 1 ? DICT ! ? COMMENTS ? FUP FUPSRC ! ? COBOL COBSRC85 ! !*************************************************************** ! CONSTANT DEFINITIONS !*************************************************************** CONSTANT custnum-heading en_US.
Database Schema Listing Sample Schemas en_US.ISO8859-1, "Sucursal/Numero"LN.es_ES.ISO8859-1, "Bureau/Numero"LN fr_FR.ISO8859-1. CONSTANT manager-heading VALUE "Manager"LN en_US.ISO8859-1, "Gerente",LN.es_ES.ISO8859-1 "Chef De Service"LN fr_FR.ISO8859-1. CONSTANT salesperson-heading VALUE "Salesperson"LN en_US.ISO8859-1, "Vendedor"LN.es_ES.ISO88591, "Vendeur"LN fr_FR.ISO8859-1. CONSTANT mdy-date-display CONSTANT part-cost-display VALUE "M<99/99/99>". VALUE "M".
Database Schema Listing Sample Schemas UPSHIFT. PIC X(2) UPSHIFT. 02 midinit END DEFINITION addr. 02 address 02 city 02 state PIC X(22). PIC X(14). PIC X(2) HELP "Enter 2-character code". 02 zip END TYPE zip-cd. DEFINITION mdy-date. 02 month 02 day-of-month 02 year END DISPLAY mdy-date-display HELP "Enter date as:" "mm/dd/yy". PIC 99 MUST BE 1 THRU 12. PIC 99 MUST BE 1 THRU 31. PIC 99.
Database Schema Listing Sample Schemas DEFINITION suppinfo. 02 suppnum 02 suppname 02 addr END * Definition for REGION Record DEFINITION reginfo. 02 regnum 02 regname 02 location 02 manager TYPE *. TYPE name. TYPE *. TYPE *. PIC X(12). PIC X(14). TYPE empnum HEADING manager-heading. END * Definition for BRANCH Record DEF branchinfo. 02 primkey. 03 regnum 03 branchnum 02 branchname 02 manager TYPE *. TYPE *. PIC X(14). TYPE empnum HEADING manager-heading.
Database Schema Listing Sample Schemas MAXEXTENTS 100. DEFINITION IS orderinfo. KEY IS orders.ordernum DUPLICATES NOT ALLOWED. KEY "sn" IS orders.salesperson. KEY "cn" IS orders.custnum. END * Contains each order line for each order RECORD odetail. FILE IS "$data.sales.odetail"KEY-SEQUENCED AUDIT MAXEXTENTS 100. 02 primkey. 03 ordernum TYPE *. 03 partnum TYPE *. 02 quantity PIC 9(3). KEY IS primkey DUPLICATES NOT ALLOWED. END * Contains information on each part RECORD parts. FILE IS "$data.sales.
Sample SPI Schema Sample Schemas AUDIT MAXEXTENTS 100. DEFINITION IS reginfo. KEY IS region.regnum DUPLICATES NOT ALLOWED. KEY "rn" IS region.regname. END * Contains information about company's branch offices RECORD branch. FILE IS "$data.sales.branch" KEY-SEQUENCED AUDIT MAXEXTENTS 100. DEFINITION IS branchinfo. KEY IS branch.primkey DUPLICATES NOT ALLOWED. END * Contains information about each employee RECORD employee. FILE IS "$data.sales.employee" KEY-SEQUENCED AUDIT MAXEXTENTS 100.
DDL Commands to Create an SPI Schema Sample Schemas For this example, the DDL definitions that are not part of the standard SPI definition file are contained in the file ASSNDDL. Note that when you write a subsystem, the file name of the file containing the subsystem’s DDL definitions should have this format: ssssDDL In the format, ssss is a code to identify the subsystem. In the preceding example, the subsystem code happens to be ASSN.
Selected ZSPIDDL Statements Sample Schemas The SETSECTION commands in this example divide the host-language source files into sections as recommended in the Distributed Systems Management (DSM) Manual. Selected ZSPIDDL Statements The following DDL statements from the file ZSPIDEF.ZSPIDDL are either used by the DDL statements in the file ASSNDDL or used in examples in this manual. They are included here for documentation only.
ASSNDDL Statements Sample Schemas OCCURS VARYING. TOKEN-CODE zspi-tkn-command VALUE IS zspi-tnm-command TOKEN-TYPE IS zspi-typ-enum. TOKEN-CODE zspi-tkn-retcode VALUE IS zspi-tnm-retcode TOKEN-TYPE IS zspi-typ-enum. ASSNDDL Statements The following DDL statements are in the sample DDL file ASSNDDL. They are the statements needed by the sample subsystem in addition to those provided by ZSPIDEF.ZSPIDDL. ? SECTION assn-defs DEF assn-variable-token. 02 table-size TYPE zspi-ddl-int.
ASSNDDL Statements Sample Schemas ! Token-code definitions: TOKEN-CODE assn-tkn-my-status TOKEN-CODE assn-tkn-stat-reply ! Token-map definition: TOKEN-MAP assn-map-jobinfo VERSION "D00" VERSION "D30" NOVERSION VERSION "D30" VALUE IS assn-tnm-my-status TOKEN-TYPE IS assn-typ-status. VALUE IS assn-tnm-stat-reply TOKEN-TYPE IS assn-typ-status. VALUE IS assn-tnm-jobinfo DEF IS assn-ddl-jobinfo. FOR jnumber THRU location. FOR jobclass-is-present. FOR jobclass. FOR jobusername.
ASSNDDL Statements Sample Schemas Data Definition Language (DDL) Reference Manual—426798-002 B -12
C DDL Data Translation This appendix describes how data defined in DDL is translated into each of the seven supported host languages. The DDL compiler can translate any definition or record into data-declaration source code for host languages (C, COBOL, FORTRAN, Pascal, TACL, TAL, and pTAL).
DDL Data Translation Table C-1.
DDL Data Translation Table C-1.
DDL Data Translation .. Table C-2.
DDL Data Translation Table C-2. Sample DDL/COBOL Data Translation Table (page 2 of 2) Clause Type DDL Clause Specification COBOL85 Data Type TYPE COMPLEX PIC X(8) TYPE LOGICAL [2] PIC X(2) TYPE LOGICAL 4 PIC X(4) TYPE ENUM NATIVE-2 TYPE CHARACTER 8 OCCURS 100 TIMES PIC X(8) Occurs 100 TIMES TYPE BINARY 16 OCCURS 3 TIMES NATIVE-2 Occurs 3 TIMES * Groups bit fields that can fit in the same word and generates a filler in the word’s type.
DDL Data Translation Table C-3.
DDL Data Translation Table C-3.
DDL Data Translation Table C-4.
DDL Data Translation Table C-4. Sample DDL/Pascal Data Translation Table (page 2 of 2) Clause Type DDL Clause Specification Pascal Data Type TYPE LOGICAL 1 BOOLEAN TYPE LOGICAL[2] INT16 TYPE LOGICAL 4 INT32 TYPE ENUM INT16 TYPE CHARACTER 8 OCCURS 100 TIMES Array[1..100] of FSTRING(8) TYPE BINARY 16 OCCURS 3 TIMES Array[1..
DDL Data Translation Table C-5.
DDL Data Translation Table C-5.
DDL Data Translation Table C-6.
DDL Data Translation Table C-6.
DDL Data Translation Data Definition Language (DDL) Reference Manual—426798-002 C -14
D Dictionary Database Structure A DDL dictionary is itself a DDL database consisting of 14 files. DDL supplies the names of the dictionary database files; these names must not be changed.
Elements Dictionary Database Structure DDL assigns each object a unique object number for identification. Object numbers are assigned in ascending order and are never reused. When an object is removed from the dictionary, all references to its object number are also removed. Elements Definitions and records can contain one or more elements.
Dictionary Files Dictionary Database Structure Table D-1 shows the text items described in the following three objects: CONSTANT custnum-heading VALUE "Customer". DEF initials PIC XXX VALUE ALL SPACES HELP "Initials". DEF quantity PIC 999 MUST BE 1 THRU 999. In Table D-1, each text item is assigned a unique text ID number. Note that a single text item can contain more than one text type. Table D-1.
Dictionary Database Structure Field Descriptions Table D-2. Dictionary Files Built for a Source Schema (page 2 of 2) Name Description DICTMAP TOKEN MAP FILE—contains one MAP record for each token map in the dictionary. Each record contains a map identifier, the map token number, and the map definition. The DICTVER file contains additional information about token maps. DICTOBL OBJECT BUILD LIST—contains one OBL record for each element of each definition or record in the dictionary.
DICTCDF Fields Dictionary Database Structure DICTCDF Fields DICTCDF (Constant Definition File) contains one record for each constant in the dictionary. The record links the constant with the constant text in the DICTOTF file. Record CDF. File is "DICTCDF" 02 OBJECT-NUMBER 02 TEXT-ID Key-sequenced Code 207 Audit. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Object/Number". Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Text Id/Number". 02 CONSTANT-TYPE-STRING Pic "XX".
DICTDDF Fields Dictionary Database Structure • CONSTANT-TYPE-EXPLICIT−contains an ASCII character Y (yes) to indicate the constant type was entered explicitly or N (no) to indicate the constant type was inherited from another constant or by default. DICTDDF Fields DICTDDF (Dictionary Definition File) contains a single record, updated every time DDL adds a new object to the dictionary. DICTDDF should not be an audited file. Record DDF.
Dictionary Database Structure DICTKDF Fields The version number encoded in the DDL compiler is checked against this field whenever a dictionary is opened. • • CREATOR-USERID−a group field that describes the user ID of the person who created this dictionary. CREATOR-USERID consists of the next two fields: ° ° GROUP-NAME−the name of the group to which the user belongs. USER-NAME−a name identifying the user within the group.
DICTKDF Fields Dictionary Database Structure Record KDF. File is "DICTKDF" 02 IDENTIFIER. 03 RECORD-NUMBER 03 ELEMENT Key-sequenced Code 206 Audit. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Record/Number". Type Binary 16 Display "I3" Heading "Key/Num". 02 OBL-KEY. 03 OBJECT 02 02 02 02 Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Object/Number". 03 ELEMENT Type Binary 16 Display "I3" Heading "Element/Number". KEYTAG-VALUE Type Binary 16 VALUE 0 Display "I5" Heading "Keytag/Value".
DICTKDF Fields Dictionary Database Structure 02 NULL-VALUE 02 NULL-VALUE-SPECIFIED 02 KEY-CLASS 02 KEY-UNIQUE 02 KEY-UPDATE 02 KEY-FILE-NAME Type Binary 16 Display "I5" Heading "Null/Value". Type ASCII-SWITCH VALUE "N" Heading "Null/Specified". Pic "XXX" VALUE "PRI" Heading "Key/Class". Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "Y" Heading "Key/Uniq". Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "Y" Heading "Key/Update".
DICTKDF Fields Dictionary Database Structure • KEYTAG-STRING−a 2-character string used when the Enscribe key specifier is declared as two ASCII characters. KEYTAG-STRING redefines KEYTAG-VALUE as a 2-byte string. • • • • • KEYTAG-OBJECT−if the keytag value is defined by a constant, contains the object number of the constant. FIELD−a group containing the OFFSET and ELEMENT-SIZE values from the OBL record that describes this key field.
DICTMAP Fields Dictionary Database Structure DICTMAP Fields DICTMAP (Token Map File) is a key-sequenced file containing one record for each SPI token map. Each record contains detailed information about a token map, including its unique token number, and the object number of the definition that describes the extensible structured token associated with the token map. Additional information about token maps is contained in the Version File (DICTVER). Record MAP.
DICTOBL Fields Dictionary Database Structure • • • • TOKEN-NUMBER-CONSTANT−contains the object-number of the constant used to define the token number; if the token number was not specified using a constant, this field is set to 0. MAP-DEF−contains the object number of the definition (DEF) for the token map. The definition defines the data structure of the extensible structured token described by the token map.
DICTOBL Fields Dictionary Database Structure Record OBL. File is "DICTOBL" 02 IDENTIFIER. 03 OBJECT 03 ELEMENT 02 LEVEL 02 LOCAL-NAME 02 COMMENT-TEXT 02 VALUE-TEXT 02 AS-TEXT 02 HEADING-TEXT 02 DISPLAY-TEXT 02 PICTURE-TEXT 02 HELP-TEXT Key-sequenced MaxExtents 500 Code 204 Audit. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Object/Number". Type Binary 16 Display "I3" Heading "Element/Number". Type Binary 16 Display "I2" Heading "LV". Type Character 30 Heading "Element Name".
DICTOBL Fields Dictionary Database Structure 02 MUST-BE-TEXT 02 EDIT-PIC-TEXT 02 TACL-TYPE Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Must Be/Text ID". Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Edit Pic/Text ID". Type Character 2 UPSHIFT Heading "TACL/Type" MUST BE "CP", "DV", "EN", "FN", "F3", "PH", "SI", "SV", "TI", "TS", "UN", " ". 02 SOURCE-DEF 02 ELEMENT-REDEFINED Pic "9(9)" COMP Display "[BZ]I10" Null 0 Heading "Source/Def".
DICTOBL Fields Dictionary Database Structure 02 OCCURS-MIN-OBJECT Pic "9(9)" COMP Display "[BZ]I10" Null 0 Heading "Occurs Min/Object #". 02 OCCURS-MAX-OBJECT Pic "9(9)" COMP Display "[BZ]I10" Null 0 Heading "Occurs Max/Object #". 02 OCCURS-ELEMENT 02 STARTING Type Binary 16 Display "I4" Heading "Occurs/Element". Type Binary 16 Display "I4" Heading "Starting/Element". 02 ENDING 02 TALBOUND 02 NULL-VALUE 02 NULL-VALUE-OBJECT Type Binary 16 Display "I4" Heading "Ending/Element".
DICTOBL Fields Dictionary Database Structure 02 UPSHIFT 02 USER-DEFINED-FILLER Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Upshift". Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "User Defined/Filler". 02 PADDED-FILLER 02 GROUP-COMP 02 SOURCE-DEF-FLAG 02 NOVALUE 02 TACL-INHERITED REDEFINES USER-DEFINED-FILLER Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Padded/Filler".
DICTOBL Fields Dictionary Database Structure 02 SPI-NULL-INHERITED Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" Heading "SPI-Null/Inherited". 02 UPSHIFT-INHERITED Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" Heading "Upshift/Inherited". 02 USAGE-IS-INDEX 02 BIT-LENGTH 02 FIELD-ALIGN 02 BIT-OFFSET 02 ENUM-DEF 02 PASCALBOUND 02 INDEX-NAME 02 EXTERNAL-SPECIFIED 02 JUSTIFY Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Index/Usage".
DICTOBL Fields Dictionary Database Structure 02 JUSTIFY-INHERITED Type Character 1 MUST BE "Y", "N" VALUE "N" UPSHIFT Display "A1" Heading "Just-Right/Inherited". 02 SQLNULLABLE-SPECIFIED 02 INTERVAL-LEADING-PRECISION 02 DATETIME-FRACTION-PRECISION 02 SQLNULLABLE-FLAG 02 GROUP-COMP3 02 FILLER 02 SQLNULLABLE-FILLERS Type Character 1 MUST BE "Y", "N" VALUE "N" UPSHIFT Display "A1" Heading "SqlNull/Spec". Type Binary 16 Display "I4" Heading "Leading/Prec".
Dictionary Database Structure DICTOBL Fields level numbers in the source schema can be incremented by values greater than one, the DDL compiler compresses all level values so that there is no skipping. This field also identifies Level 66 RENAMES and Level 88 clauses, which have reserved level numbers. • • • LOCAL-NAME−a field with 30 ASCII characters, containing the name of this element. COMMENT-TEXT−the text ID of the OTF record that contains any comment for this element.
DICTOBL Fields Dictionary Database Structure • • EDIT-PIC-TEXT−the text ID of the OTF record containing the edit picture value. TACL-TYPE−contains a 2-character ASCII code identifying the high-level TACL data type associated with the element. Valid values for this field are: Code TACL Type CP CRTPID DV DEVICE EN ENUM FN FNAME F3 FNAME32 PH PHANDLE SI SSID SV SUBVOL TI TRANSID TS TSTAMP UN USERNAME If this field is left blank, the item does not have a high-level TACL data type.
Dictionary Database Structure DICTOBL Fields ORDER-DATE in the object ORD-HEADER; in this case, SOURCE-DEF does not indicate that ORDER-DATE in turn refers to DATE. • • • ELEMENT-REDEFINED−the element number of the group or field that this element redefines if this element redefines another element.
Dictionary Database Structure Table D-3.
DICTOBL Fields Dictionary Database Structure Table D-3.
DICTOBL Fields Dictionary Database Structure Table D-4.
DICTOBL Fields Dictionary Database Structure Table D-5.
Dictionary Database Structure • • • • • • • DICTOBL Fields NULL-VALUE−the ASCII value used by DDL when producing FUP source output for an alternate key. NULL-VALUE-OBJECT−if the null value is defined by a constant, contains the object number of the constant; otherwise, it is 0. SPI-NULL-VALUE−contains a user-specified SPI null value used by SPI to process token maps. SPI-NULL-VALUE-OBJECT−if the SPI null value is defined by a constant, contains the object number of the constant; otherwise, it is 0.
Dictionary Database Structure • • • • • • • • • • • • • DICTOBL Fields NULL-INHERITED−contains the ASCII character Y (yes) to indicate the null was inherited from a definition or N (no) to indicate it was explicitly specified. SPI-NULL-INHERITED−contains the ASCII character Y (yes) to indicate the SPI null was inherited from a definition or from the default, or N (no) to indicate the SPI null was explicitly specified.
Dictionary Database Structure • • • • • • DICTODF Fields SQLNULLABLE-SPECIFIED−contains the ASCII character Y (yes) if the line item has the [NOT] SQLNULLABLE clause specified, or N (no) if no such clause is specified. The default value for this field is N. If the value of this field is Y, the value of the SQLNULLABLE-FLAG field, described below, indicates whether SQLNULLABLE or NOT SQLNULLABLE is specified.
DICTODF Fields Dictionary Database Structure Record ODF. File is "DICTODF" 02 OBJECT 02 IDENTIFIER Key-sequenced Code 202 Audit. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Object/Number". Null " " Heading "Object Identifier". 03 OBJ-TYPE Type Character 2 MUST BE "ID","RD",“CD”,“TT”, "TC","TM","SR","SV", "RQ","TB" 03 NAME 02 VERSION 02 DATE-CREATED UPSHIFT Heading "Obj/Type". Type Character 30 Heading "Object Name". Type Binary 16 Unsigned Display "I3" Heading "Cur/Ver".
DICTODF Fields Dictionary Database Structure An explanation of each field follows: • OBJECT−the object number, a system-assigned number that uniquely identifies each object within the dictionary. Each object corresponds to exactly one identifier.
DICTOTF Fields Dictionary Database Structure CREATOR-USERID consists of the next two fields: • ° ° GROUP-NAME−the name of the group to which the user belongs. USER-NAME−a name identifying the user within the group. DATE-MODIFIED−a 6-byte timestamp that is updated every time the object is modified. DATE-MODIFIED is initially set to the same value as DATE-CREATED. • MODIFIER-USERID−a group field that describes the user ID of the last person to modify this dictionary.
DICTOTF Fields Dictionary Database Structure 88 CONSTANT-STRING Value is "ST". 88 CONSTANT-VERSION Value is "VR". 88 CONSTANT-BINARY-16 Value is "2S". 88 CONSTANT-BINARY-UNSIGNED Value is "2U". 88 CONSTANT-BINARY-32 Value is "4S". 88 CONSTANT-BINARY-32-UNSIGNED Value is "4U". 88 CONSTANT-BINARY-64 Value is "8S". 88 CONSTANT-NATIONAL-STRING Value is "NS". 02 CONSTANT-TYPE Redefines CONSTANT-TYPE-STRING Type Binary 16.
Dictionary Database Structure • • • • • • • DICTOUF Fields CONSTANT-ID−if the text element was defined by referring to a constant, contains the object number of the constant; otherwise, it is 0. CONSTANT-TYPE-STRING−a two-character ASCII code that identifies the type of constant. CONSTANT-TYPE−a numeric code identifying the type of constant.
DICTOUF Fields Dictionary Database Structure Record OUF. File is "DICTOUF" 02 IDENTIFIER. 03 OBJECT-USED 04 OBJ-TYPE Key-sequenced Code 208 Audit. Null 0 Heading "Object/Used". Type Character 2 MUST BE "ID","RD","CD" "TT", "TC","TM","SR","SV", "RQ","TB" UPSHIFT Heading "Obj/Type". Type Character 30 Heading "Object Name". Null 0 04 NAME 03 CONSUMER Heading "Consumer/Object".
DICTRDF Fields Dictionary Database Structure • ° Code Object TT SPI Token Type TC SPI Token Code TM SPI Token Map SR Server SV Service RQ Requester TB Table NAME−contains the name of the object.
DICTRDF Fields Dictionary Database Structure Record RDF. File is "DICTRDF" 02 OBJECT 02 DEF-NUMBER 02 RECORD-LENGTH 02 FILE-NAME Key-sequenced Code 205 Audit. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Record/Number". Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Def/Number". Type Binary 16 Heading "Record/Length". Type Character 34 UPSHIFT Heading "Physical File Name". 02 FILE-TYPE 02 FILE-DURATION 02 FILE-CODE 02 FILE-CODE-OBJECT Type Character 1 Heading "File/Type".
DICTRDF Fields Dictionary Database Structure 02 REFRESH 02 02 02 02 Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Refresh". AUDIT Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Audit". BLOCK-SIZE Type Binary 16 VALUE 4096 Display "I4" Heading "Block/Size". BUFFER-SIZE Redefines BLOCK-SIZE Type Binary 16 Display "I4" Heading "Buffer/Size". BLOCK-SIZE-OBJECT Pic "9(9)" COMP Display "[BZ]I10" VALUE 0 Null 0 Display "I5" Heading "Blk Siz/Object".
DICTRDF Fields Dictionary Database Structure 02 MAXEXTENTS-OBJECT Pic "9(9)" COMP VALUE 0 Null 0 Display "I5" Heading "Max Ext/Object". 02 BUFFERED 02 AUDIT-COMPRESS Type Character 1 VALUE "D" Display "A1" Heading "Buffered". Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Audit/Compress". 02 VERIFIED-WRITES Type Character 1 MUST BE "Y", "N" UPSHIFT Display "A1" VALUE "N" Heading "Verifies/Writes".
Dictionary Database Structure • • DICTRDF Fields FILE-TYPE−contains a 1-character ASCII code that indicates the record's file type, as follows: Code File Type U Unstructured R Relative E Entry-sequenced K Key-sequenced FILE-DURATION−a value that indicates whether the file specified by FILE-NAME is permanent, dynamically assigned, or temporary. FILE-DURATION values are: P (permanent) T (temporary) A (assigned) The default for this field is P. • • • FILE-CODE−this record's file code.
Dictionary Database Structure • • • • • • • • DICTRDF Fields BUFFER-SIZE−buffer size of an unstructured file in bytes. BUFFER-SIZE redefines BLOCK-SIZE. Value must be 512, 1,024, 2,048, or 4,096 bytes; the default is 4,096 bytes. BLOCK-SIZE-OBJECT−if block size is defined by a constant, contains the object number of the constant; otherwise, it is 0. BUFFER-SIZE-OBJECT−if buffer size is defined by a constant, contains the object number of the constant; otherwise, it is 0.
DICTTKN Fields Dictionary Database Structure about even unstructured and odd unstructured files, see the File Utility Program (FUP) Reference Manual. DICTTKN Fields DICTTKN (Token Code File) is a key-sequenced file containing one record for each SPI token code. Each record contains the detailed information about a token code, including the object number of the token code, the object number of the associated token type, and the value of the token number that identifies the token code within its type.
DICTTYP Fields Dictionary Database Structure • • TOKEN-TYPE-OBJECT−contains the object number of the SPI token type for the token code. TOKEN-NUMBER-VALUE−contains the token number used by a subsystem to distinguish one token code from another. Token numbers can be in the range -32,768 through 32,767. Any user-supplied token numbers must be in the range 1 through 9,998; the other token numbers are reserved by HP or are previously defined by SPI.
DICTTYP Fields Dictionary Database Structure 88 OCCURS-VARYING 88 OCCURS-0 02 TOKEN-OCCURS-CONSTANT 02 STRUCTURE 02 TOKEN-LENGTH Value is -1. Value is 0. Pic "9(9)" COMP Null 0 Display "[BZ]I10" Heading "Occurs/Object". Type Binary 16 Heading "Structure". Type Binary 16 Unsigned Heading "Token/Length". Key is OBJECT-NUMBER Duplicates not allowed. End An explanation of each field follows: • • • • • • • OBJECT-NUMBER−contains the object number of this record from DICTODF.OBJECT.
DICTVER Fields Dictionary Database Structure • • If TOKEN-OCCURS-VALUE is a positive integer in the range 1 through 254 and if a DEF IS clause was specified, the length from the definition (DEF) is multiplied by the OCCURS value and stored in TOKEN-LENGTH. If no DEF IS clause was specified, the TOKEN-OCCURS-VALUE is stored in TOKEN-LENGTH. A token length of 0 or -1 is considered valid.
Dictionary Database Structure • • • • Definition and Record Storage in the Dictionary VERSION-CONSTANT−if the version number was specified as a constant, this field contains the object number of the constant; otherwise, it is 0. BEG-ELEMENT−contains the element number from DICTOBL for the first element specified in the sequence of fields with this version. END-ELEMENT−contains the element number from DICTOBL for the last element in the sequence of fields with this version.
Object Definition File Dictionary Database Structure entered into the dictionary, it is given the current value of NEXT-OBJ. NEXT-OBJ is then incremented by 1. NEXT-TEXT-ID is used by the DDL compiler to assign text numbers to text items as they are added to the dictionary. Like NEXT-OBJ, NEXT-TEXT-ID has an initial value of 1 and is incremented after a text item is entered into the dictionary. VERSION contains the version number of the dictionary.
Object Text File Dictionary Database Structure IDENTIFIER. OBJECT IDENTIFIER.E LEMENT LOCALNAME PICTURETEXT 2 2 standardprice 3 2 3 location 5 2 4 sanfrancisco HEADINGTEXT VALUETEXT UPSHIFT 4 N Y 6 N Object Text File DICTOTF contains one record for each text item entered into the dictionary.
Key Definition File Dictionary Database Structure For the sample dictionary shown in Figure D-1 on page D-45, DICTRDF contains the following values: OBJECT: 2 DEF-NUMBER: 2 FILE-NAME: $data.sales.parts DICTRDF.OBJECT uniquely identifies each record by its object number. DICTRDF.DEF-NUMBER is equal to the object number of the record, unless it is defined with a DEFINITION IS def-name clause.
Dictionary Structure Link Diagram Dictionary Database Structure Figure D-2. Main Links Among Dictionary Files Legend: DDF **Primary Key *Alternate Key 02 next-object 02 next-text-id . . TKN **02 object-number 02 token-type-object . . 02 ssid-text 02 heading-text 02 display-text ODF **02 object *02 identifier 03 obj-type 03 name . . 02 comment-text RDF **02 object *02 def-number . . KDF TYP OBL **02 object-number . . 02 token-def . . MAP **02 object-number . .
Dictionary Database Structure Dictionary Structure Link Diagram Data Definition Language (DDL) Reference Manual—426798-002 D -50
E Dictionary Reports HP supplies a set of Enform queries that you can use to get information about any DDL dictionary. These queries produce a set of reports that provide the following information: • • • • • A list of all the objects in the dictionary, including any constants, definitions, records, and Subsystem Programmatic Interface (SPI) token codes, token maps, and token types. A description of the structure of each definition and record.
Using Enform Queries for Dictionary Reports Dictionary Reports Table E-1. Summary of Dictionary Reports Query Name Report Description R1 DICTIONARY OBJECTS—R1 describes every constant, definition, record, token code, token map, and token type in the dictionary, giving the time and date of its creation, the time and date of its last modification, and its version number. R2 DEFINITION STRUCTURE—R2 lists every component group and field in every definition in the dictionary.
Producing Dictionary Reports Dictionary Reports Producing Dictionary Reports The Enform report queries use the DDL dictionary that describes the structure of the 14 dictionary files. This dictionary must be compiled before you can produce the Enform dictionary reports. For a description of this dictionary, see Appendix D, Dictionary Database Structure. After the dictionary has been compiled, you can run any or all of the 16 Enform queries to report on any dictionary on any subvolume in the system.
Requesting Reports Dictionary Reports The DDQUERYS queries contain the following command: ?ASSIGN QUERY-COMPILER-LISTING to $NULL If you do not have a $NULL process on your system, or if you want to redirect this output, you can remove or change this line. Figure E-1 illustrates the creation of a dictionary for DDSCHEMA. Figure E-1. Creating a Dictionary for DDSCHEMA DDSCHEMA DDQUERYS 21> DDL / IN $system.system. ddschema / DICT $system.ddl DDL Create dictionary on $SYSTEM.DDL $SYSTEM.
Requesting Reports Dictionary Reports To select particular reports, you must run the Enform program in the interactive mode, specify the output device with the ?OUT command, and specify the reports you want with the ?SOURCE command; for example: 16> VOLUME $data.sales Establish $DATA.SALES as the default subvolume 17> ENFORM Run the ENFORM program interactively 18> ?OUT $S.#printer 19> ?SOURCE $system.system.ddquerys (R2, R6) VSTE03.vsd These commands list two reports on $S.#PRINTER.
Requesting Reports Dictionary Reports Figure E-2. Running DDQUERYS to Produce Reports DDSCHEMA 21> DDL / IN $system.system. ddschema / DICT $system.ddl DDQUERYS ENFORM Run dictionary queries against dictionary on $DATA.SALES $SYSTEM.SYSTEM DICTOBL . . DICTALT $SYSTEM.DDL DICTDDF DICTODF DICTOBL R1 R2 . . . R16 . . . DICTALT $SYSTEM.DDL VSTE04.vsd As shown in Figure E-2, the Enform program reads its source statements from $SYSTEM.SYSTEM.DDQUERYS, reads the dictionary on $SYSTEM.
Requesting Reports Dictionary Reports In the case of the sample database, the file name in the Enform OPEN statement in DDQUERYS is fully qualified by the current default volume and subvolume. For example: OPEN DICTOBL; Statement in DDQUERYS OPEN $data.sales.DICTOBL; Statement as executed VSTE05.vsd The same default volume and subvolume insertion takes place for every OPEN statement in DDQUERYS.
Requesting Reports Dictionary Reports Data Definition Language (DDL) Reference Manual—426798-002 E- 8
F Syntax Summary This appendix presents a summary of the syntax of the statements, statement clauses, and compiler commands that are used in DDL, as well as the TACL implied RUN command that launches DDL. DDL Run Command DDL [ / run-option [ , run-option ] ... / ] [ compiler-command [ , compiler-command ] ...
Group Definition Syntax Summary [ [ [ [ [ [ [ [ [ [ [ [ [ EXTERNAL clause ] HEADING clause ] HELP clause ] JUSTIFIED clause ] LN clause ] MUST BE clause ] NULL clause ] SPI-NULL clause ] [NOT] SQLNULLABLE clause ] TACL clause ] UPSHIFT clause ] USAGE clause ] VALUE clause ] . [ 88 condition-name clause . ] ... [ 89 enumeration clause . ] ... [ END [ .
Reference Definition Syntax Summary [ [ [ [ [ [ [ [ [ [ MUST BE clause ] NULL clause ] { OCCURS clause } ] { OCCURS DEPENDING ON clause } ] REDEFINES clause ] SPI-NULL clause ] [NOT] SQLNULLABLE clause ] TACL clause ] USAGE clause ] VALUE clause ] . [ 88 condition-name clause . ] ... [ 89 enumeration clause . ] ...
OUTPUT Statement Syntax Summary OUTPUT Statement { { { { { { OUTPUT { { { { { { CONSTANT { constant-name ... } { * } DEF[INITION { def-name ... } { * } RECORD { record-name ... } { * } TOKEN-CODE { token-name ... } { * } TOKEN-MAP { map-name ... } { * } TOKEN-TYPE { type-name ... } { * } } } } } } } } . } } } } } OUTPUT UPDATE Statement { CONSTANT constant-name ... } OUTPUT UPDATE { [ DEF[INITION] ] def-name ... } . { TOKEN-TYPE type-name ... } RECORD Statement RECORD record-name .
File-Creation Syntax Syntax Summary File-Creation Syntax { [“] file-name [“] } FILE IS { TEMPORARY } [ creation-attribute ] ... .
Record Structure Syntax Summary Syntax Summary Record Structure Syntax Summary line-item specification ... [ 66 RENAMES clause . ] ...
SHOW USE OF Statement Syntax Summary SHOW USE OF Statement { CONSTANT constant-name [,] ... } SHOW USE [ OF ] { [ DEF[INITION] ] def-name [,] ... } { TOKEN-TYPE type-name [,] ... } TOKEN-CODE Statement TOKEN-CODE token-name VALUE [ IS ] { token-number } { constant-name } TOKEN-TYPE [ IS ] type-name [ SSID { “subsystem-id” } ] [ { constant-name } ] [ HEADING { “label” } ] [ { constant-name } ] [ DISPLAY { “display-format” } ] .
TOKEN-TYPE Statement Syntax Summary TOKEN-TYPE Statement TOKEN-TYPE type-name VALUE [ IS ] { token-data-type } { constant-name } { DEF [ IS ] def-name [ OCCURS { number } TIMES ] } { { constant-name } } { } { OCCURS VARYING [ DEF [IS ] def-name ] } { } { OCCURS 0 TIMES } DEFINITION and RECORD Statement Clauses AS Clause AS { “display-string” } { constant-name } [ LN clause ] DISPLAY Clause DISPLAY { “display-format” } { constant-name } EDIT-PIC Clause EDIT-PIC { “edit-picture-string” } { constant } E
HELP Clause Syntax Summary HELP Clause HELP { “help-text” } [ [ , ] “help-text” ] ... { constant-name } [ [ , ] constant-name ] JUSTIFIED Clause JUST[IFIED] RIGHT KEYTAG Clause KEYTAG { key-specifier } [ DUPLICATES [ NOT ] ALLOWED ] { constant-name } LN Clause { LN locale-name [ value LN clause ] ... MUST BE Clause { value { MUST BE { value-1 { value { { { { { { { } } { THROUGH } value-2 } ...
OCCURS DEPENDING ON Clause Syntax Summary OCCURS DEPENDING ON Clause OCCURS min TO max TIMES DEPENDING ON field-name [ INDEXED BY index-name ] PICTURE Clause PIC[TURE] [“] {picture-string } [“] { national-picture-string } picture-string is: { { { { { { { { { { X...[(length)] A...[(length)] 9...[(length)] N...[(length)] [S]9...[(length)[V[9...[(length)]]]] T[9...[(length)[V[9...[(length)]]]] 9...[(length)[V[9...[(length)]]]]S 9...[(length)[V[9...
TACL Clause Syntax Summary TACL Clause { { { { { TACL { { { { { { CRTPID DEVICE ENUM FNAME FNAME32 PHANDLE SSID SUBVOL TRANSID TSTAMP USERNAME } } } } } } } } } } } TYPE Clause { data-type } TYPE { def-name } { * } data type is : { { { { { { { { { { { { { { { { { { { { { { { { { { { CHARACTER length } } BINARY 8 [ UNSIGNED ] } BINARY [ 16 [ , scale ] ] [ UNSIGNED ] } BINARY 32 [ , scale ] [ UNSIGNED ] } BINARY 64 [ , scale ] } } FLOAT [ 32 ] } FLOAT 64 } } COMPLEX } } LOGICAL 1 } LOGICAL [ 2 ] } LOGI
UPSHIFT Clause Syntax Summary UPSHIFT Clause UPSHIFT USAGE Clause [ USAGE [ IS ] ] { { { { COMP[UTATIONAL] INDEX COMP[UTATIONAL]-3 PACKED-DECIMAL } } } } VALUE Clause { VALUE [ IS ] value } [ LN clause ] { NOVALUE } value is: { { { { { { { { { { } “character-string” [ LN clause ] } constant-name [ LN clause ] } figurative-constant } national-literal [ LN clause ] } number [ LN clause ] } sql-literal } symbolic-literal } value-name } } 66 RENAMES Clause 66 renames-name RENAMES { field-name } { group-
88 Condition-Name Clause Syntax Summary 88 Condition-Name Clause 88 condition-name { VALUE [ IS ] } { VALUES [ ARE ] } { value [ LN clause ] } [ , value ] { value { THROUGH } value } [ , value { THROUGH } value ] ...
Compiler Commands Syntax Summary Compiler Commands { ?C [ c-source-file [ ! ] ] } { ?NOC } ?[NO]C00CALIGN ?[NO]CCHECK ?[NO]CDEFINEUPPER ?CENDIF ?CFIELDALIGN_MATCHED2 { ?CIFDEF identifier_name } { ?CIFNDEF identifier_name } ?[NO]CLISTIN { ?[NO]CLISTOUT } { ?CLISTOUTDETAIL } ?[NO]COBCHECK ?COBLEVEL [ base [ , increment ] ] { ?COBOL [ cobol-source-file [ ! ] ] } { ?NOCOBOL } ?COLUMNS num ?[NO]COMMENTS ?[NO]CPRAGMA Data Definition Language (DDL) Reference Manual—426798-002 F- 14
Compiler Commands Syntax Summary ?[NO]CTOKENMAP_ASDEFINE ?CUNDEF identifier_name ?[NO]C_DECIMAL ?[NO]C_MATCH_HISTORIC_TAL { ?DDL [ ddl-source-file [ ! ] ] } { ?NODDL } ?[NO]DEFLIST { ?DICT [ dict-subvol-name ] [ ! ] } { ?NODICT } ?DICTN [ dict-subvol-name ] [ ! ] ?DICTR [ dict-subvol-name ] ?DO_PTAL_OFF ?DO_PTAL_ON ?EDIT [ edit-file-name [ ; edit-parameter ] ...
Compiler Commands Syntax Summary { ?FORTRAN [ fortran-source-file [ ! ] ] } { ?NOFORTRAN } ?[NO]FORTRANUNDERSCORE { ?FUP [ fup-source-file [ ! ] ] } { ?NOFUP } ?HELP [ command ] ?LINECOUNT number ?[NO]LIST ?[NO]CLCONSTANT ?NEWFUP_FILEFORMAT ?NOFILEFORMAT ?OLDFUP_FILEFORMAT ?OUT [ listing-destination ] ?[NO]OUTPUT_SENSITIVE ?PAGE [ "listing-title" ] { ?PASCAL [ pascal-source-file [ ! ] ] } { ?NOPASCAL } ?PASCALBOUND { 0 } { 1 } ?[NO]PASCALCHECK Data Definition Language (DDL) Reference Manual—42
Compiler Commands Syntax Summary ?[NO]PASCALNAMEDVARIANT { ?REPORT [ report-destination [ ! ] ] } { ?NOREPORT } ?RESET ?[NO]SAVE ?SECTION section-name ?SETLOCALENAME [ locale-name ] ?SETSECTION [ section-name ] ?SOURCE source-name [ ( section-name [, section-name]...
Compiler Commands Syntax Summary { ?TACLGEN } { ?TAL [ tal-source-file [ ! ] ] } { ?NOTAL } ?[NO]TALALLOCATE ?TALBOUND { 0 } { 1 } ?[NO]TALCHECK ?[NO]TALUNDERSCORE ?TEDIT [ edit-file-name [ ; edit-parameter ] ...
G Pathmaker and DDL The Pathmaker product is a NonStop™ Transaction Services/MP (NonStop™ TS/MP) application systems generator. When you start a Pathmaker project, the Pathmaker program installs a DDL dictionary for you as part of the application catalog, which is an integrated system directory for the Pathmaker project.
Pathmaker and DDL Table G-1. DDL Features in the Pathmaker Environment (page 2 of 2) DDL Operation Pathmaker Action Manual Reference ?DDL Command The Pathmaker product cannot use DDL source code created by the ?DDL command to rebuild a Pathmaker dictionary; the DDL source code does not contain essential Pathmaker application design information.
H DDL Alignment Rules This section provides information about alignment rules used by the DDL compiler when generating C code. The DDL compiler supports four types of alignment rules: • • • • Default alignment rules for C00 and later versions of the C compiler. To use these rules, specify the C00CALIGN compiler command. Default alignment rules for versions of the C compiler prior to C00. To use these rules, specify the NOC00CALIGN compiler command.
NOC00CALIGN Alignment Rules DDL Alignment Rules { char x[3]; } ss2; char y; } s1; When C00CALIGN is in effect, DDL does not generate C output for a structure that contains one of the following: • A substructure that begins on an odd byte boundary. Note. The term substructure refers to a structure or union within a structure definition. The only data that DDL allocates starting on an odd byte is character data.
DDL Alignment Rules C_MATCH_HISTORIC_TAL Alignment Rules C_MATCH_HISTORIC_TAL Alignment Rules When you specify the CFIELDALIGN_MATCHED2 compiler command, DDL uses the following alignment rules: • • If a substructure starts on an odd byte boundary or has an odd length, and refers to a previously defined structure, DDL inserts one or more fillers to word-align the substructure and make its length even.
DDL Alignment Rules FIELDALIGN_SHARED8 Alignment Rules Data Definition Language (DDL) Reference Manual—426798-002 H- 4
Glossary alphabetic character. Any uppercase or lowercase letter or a space. alphanumeric character. Any ASCII character. alternate record key. A field other than the primary record key whose value identifies a record in a structured file. command interpreter. A process that manages interactive communication between you and the operating system. In this manual, command interpreter refers to a TACL process. compilation. The process of translating a source file to an object file. constant.
object Glossary object. A data structure stored in a DDL dictionary. DDL objects include constants, definitions, records, SPI token codes, SPI token maps, and SPI token types. Pathmaker. A NonStop™ Transaction Services/MP (NonStop™ TS/MP) application systems generator that can create and manipulate a DDL dictionary. record.
Index Numbers 66 RENAMES clause DEFINITION statement 5-9 RECORD statement 5-21 syntax 6-85 88 condition-name clause and SQL data types 6-83 and SQLNULLABLE clause 6-40 DEFINITION statement 5-8 RECORD statement 5-20 syntax 6-86 89 enumeration clause and SQL data types 6-83 and SQLNULLABLE clause 6-40 DEFINITION statement 5-8 RECORD statement 5-21 syntax 6-89 A ALL literal MUST BE clause 6-17 VALUE clause 6-80 Alternate key allowing duplicates 5-22, 6-13 defining with KEYTAG clause 5-19, 6-13 null value 6-20
C Index C C alignment rules H-1 C command 9-7 C data structure token map 7-19 token type 7-4 C source code 88 condition-name clause 6-86 89 enumeration clause 6-90 bit maps 6-56 COMPUTATIONAL usage 6-76 constant 4-5 data definition PICTURE clause 6-28 TYPE clause 6-51 data translation C-2 generating with C command 1-7, 9-7 OUTPUT statement 8-6 purging with C ! command 9-7 REDEFINES clause 6-32 RENAMES clause 6-85 sectioning with SETSECTION command 9-96 subscript bounds 6-22 suppressing with NOC command 9-
C Index OCCURS clause subscripts 6-22 purging with COBOL ! command 9-25 REDEFINES clause 6-32 sectioning with SETSECTION command 9-96 SIGN LEADING 6-29 SIGN LEADING SEPARATE 6-29 SIGN TRAILING 6-29 SIGN TRAILING SEPARATE 6-29 signed numeric fields 6-29 subscript bounds 6-22 suppressing with NOCOBOL command 9-25 syntax checking with COBCHECK command 9-22 VALUE clause 6-79 COBOL85 data structure constant 4-5 token map 7-19 token type 7-4 COBOL85 source code bit maps 6-56 constant 4-5 data definition PICTURE
C Index COBLEVEL 9-24 COBOL 9-25 COLUMNS 9-27 COMMENTS 9-28 CPRAGMA 9-30 CTOKEN_ASDEFINE 9-31 CUNDEF 9-34 C_DECIMAL 9-35 C_MATCH_HISTORIC_TAL 9-38 DDL 9-42 DEFLIST 9-44 DICT 9-47 DICTN 9-49 DICTR 9-51 DO_PTAL_OFF 9-40 DO_PTAL_ON 9-40 EDIT 9-52 ERRORS 9-54 EXPANDC 9-56 FIELDALIGN_SHARED8 9-58 FILLER 9-59 FORCHECK 9-62 FORTRAN 9-63 FORTRANUNDERSCORE 9-66 FUP 9-66 HELP 9-69 LINECOUNT 9-69 LIST 9-70 NCLCONSTANT 9-71 NEWFUP_FILEFORMAT 9-73 NOC 9-7 NOCCHECK 9-11 NOCDEFINEUPPER 9-13 NOCLISTIN 9-19 NOCLISTOUT 9-2
C Index See also Commands # 9-1 SETLOCALENAME 9-95 SETSECTION 9-96 SOURCE 9-98 SPACING 9-99 TACL 9-100 TACLGEN 9-103 TAL 9-103 TALALLOCATE 9-106 TALBOUND 9-107 TALCHECK 9-108 TALUNDERSCORE 9-110 TEDIT 9-110 TIMESTAMP 9-112 VALUES 9-113 WARN 9-115 WARNINGS 9-115 Compiler errors, controlling 9-54 Compiler warnings controlling 9-115 enabling with WARN command 9-115 suppressing with NOWARN command 9-115 Compilers native 1-9 TNS 1-9 Completion codes 3-5 COMPLEX data type 6-48 Compound statement 2-12 COMPRESS f
D Index C_MATCH_HISTORIC_TAL command 9-38, H-3 D Data compression 5-16 Data definition character PICTURE clause 6-26 TYPE clause 6-47 numeric PICTURE clause 6-26 TYPE clause 6-48 Data translation C source code C-2 COBOL85 source code C-4 FORTRAN source code C-6 Pascal source code C-8 TACL source code C-10 TAL source code C-12 Database creation 1-5 sample schema B-1 DATE data type 6-49 DCOMPRESS file attribute 5-16 DDL alignment rules H-1 DDL command 9-42 DDL compilation, stopping with RESET 9-92 DDL comp
D Index OUTPUT UPDATE statement 8-8 purging with DDL ! command 9-42 suppressing with NODDL command 9-42 uses for 1-10 DDL source schema editing with EDIT command 9-52 editing with TEDIT command 9-110 for backing up dictionary 1-10 generating a backup schema 10-1 generating with SOURCE command 9-98 sample database schema B-1 sectioning with SECTION command 9-94 DDL special characters 2-8 DEF clause TOKEN-MAP statement 7-14 TOKEN-TYPE statement 7-3 DEF statement See DEFINITION statement Definition attribute
E Index Dictionary clearing with NOSAVE command 9-93 closing with NODICT command 9-47 comments adding to source code 2-10 controlling with CLISTOUT 9-20 generated by DDL 2-10 in compiler listing 2-10 storing in dictionary 2-10 user-defined 2-9 converting from earlier versions 10-22 creating 1-4 generating source code from 8-5 increasing size of 10-19 maintenance 1-10 maintenance procedures for 10-1 making major modifications to 10-12 manipulation statements 8-1/8-13 DELETE 8-1 EXIT 8-4 OUTPUT 8-5 OUTPUT U
F Index DEFINITION statement 5-6 RECORD statement 5-19 syntax 6-5 Elements in DDL dictionary D-2 ENABLE screen headings 6-10 END DEFINITION statement 5-9 requirements for use of 5-2 Enforced values, PATHMAKER 6-16 ENFORM display format 6-4 generating dictionary reports with E-3 report headings 6-10 reserved words 2-8 ENSCRIBE alternate key null value 6-20 disk file definition 5-12 file types 5-15 ENTRY-SEQUENCED file attribute 5-15 ENUM data type 6-48 Enumeration clause and SQL data types 6-83 and SQLNULL
G Index label refreshing 5-17 name 2-2, 2-3, 5-14 type defaults 5-23 RECORD statement 5-15 FILE IS clause 5-14 File Utility Program See FUP FILLER clause and SQLNULLABLE clause 6-40 DEFINITION statement 5-8 RECORD statement 5-19 syntax 6-8 FILLER command 9-59 FLOAT data type 6-48 FORCHECK command 9-62 FORTRAN command 9-63 FORTRAN source code 88 condition-name clause 6-86 89 enumeration clause 6-91 bit maps 6-56 COMPUTATIONAL usage 6-76 data definition PICTURE clause 6-29 TYPE clause 6-48, 6-52 data transl
I Index PATHMAKER 6-11 requesting with HELP command 9-69 High-level data types 6-44 HIGH-NUMBER MUST BE clause 6-18 VALUE clause 6-81 HIGH-VALUE(S) MUST BE clause 6-17 VALUE clause 6-80 Host-language data structure token map 7-18 token type 7-4 Host-language source code AS clause 6-3, 6-90 data translation C-1 DELETE statement 8-2 DISPLAY clause 6-4 editing with EDIT command 9-52 editing with TEDIT command 9-110 EDIT-PIC clause 6-5 generating 1-7 HEADING clause 6-9 HELP clause 6-11 MUST BE clause 6-16 NUL
M Index definition 5-8 DEFINITION statement 5-8 guidelines for using 5-10 RECORD statement 5-18 record structure 5-24 RENAMES clause 6-85 LINECOUNT command 9-69 LIST command 9-70 Listing comments, control of 9-19 Literal national CONSTANT statement 4-2 VALUE clause 6-80 repeated 6-80 SQL 6-80 symbolic 88 condition-name clause 6-87 LN clause 6-14 MUST BE clause 6-17 VALUE clause 6-81 LN clause syntax 6-14 Local file names 2-2 Locale names 2-4 locale names 6-14, 9-95 LOGICAL data type 6-48 LOW-NUMBER MUST B
O Index NOFORCHECK command 9-62 NOFORTRAN command 9-63 NOFORTRANUNDERSCORE command 9-66 NOFUP command 9-66 NOLIST command 9-70 Nonaudited dictionary moving to another subvolume 10-15 rebuilding 10-20 NONCLCONSTANT command 9-71 Noninteractive mode DDL compilation 3-2 terminating compilation 8-4 NOOUTPUT_SENSITIVE command 9-81 NOPASCAL command 9-84 NOPASCALCHECK command 9-88 NOPASCALNAMEDVARIANT command 9-90 NOREPORT command 9-90 NOSAVE command 9-93 NOT SQLNULLABLE clause and NULL clause 6-39 syntax 6-38 NO
P Index and bit maps 6-56 and SQLNULLABLE clause 6-39 DEFINITION statement 5-7 nested 6-22 RECORD statement 5-20 syntax 6-21 TOKEN-TYPE statement 7-3, 7-4 OCCURS DEPENDING ON clause DEFINITION statement 5-7 RECORD statement 5-20 syntax 6-24 OLDFUP_FILEFORMAT command 9-78 OUT command 9-80 OUTPUT statement 8-5 OUTPUT UPDATE statement 8-8 OUTPUT_SENSITIVE command 9-81 P PAGE command 9-84 PASCAL command 9-84 Pascal data structure token map 7-19 token type 7-4 Pascal source code 88 condition-name clause 6-86
Q Index TACL data translation C-10 TAL data translation C-12 Primary key, defining with KEYTAG clause 5-19, 6-13 Punctuation in commands 2-13 in statements 2-12 Q Qualified name RENAMES clause 6-85 sort field 5-22 QUOTE(S) MUST BE clause 6-17 VALUE clause 6-80 R Record attributes 5-14 definition 5-1, 5-12 deleting 8-2 generating source code from 8-5, 8-6 key-sequenced 5-25 length 5-24 name 5-13 structure definition 5-13 guidelines 5-23 size 5-24 unstructured 5-25 RECORD statement 5-12/5-27 66 RENAMES cl
S Index SERIALWRITES file attribute 5-17 sort field in 5-22 SPI-NULL clause 5-20 syntax file creation 5-14 key assignment 5-21 record structure 5-18 reference record 5-17 TACL clause 5-20 TEMPORARY file attribute 5-14 TYPE clause 5-19 UNSTRUCTURED file attribute 5-15 UPSHIFT clause 5-20 USAGE clause 5-20 VALUE clause 5-20 VERIFIEDWRITES file attribute 5-17 Redefined field and MUST BE clause 6-18 and UPSHIFT clause 6-73 Redefined group and MUST BE clause 6-18 REDEFINES clause and bit maps 6-56 DEFINITION s
S Index sample database schema B-2 sample SPI user subsystem definitions B-10 sample ZSPIDEF.
T Index TOKEN-CODE statement 7-9 TOKEN-MAP statement 7-14 Statements CONSTANT 4-1, 4-9 constant definition 4-1 data structure definition 5-1 DEFINITION 5-1/5-11 dictionary manipulation 8-1 RECORD 5-12/5-27 record definition 5-1 rules for entering 2-12 summary of 2-12 syntax summary of F-1 token definition 7-2 TOKEN-CODE 7-8/7-13 TOKEN-MAP 7-13, 7-26 TOKEN-TYPE 7-2, 7-8 String constant C source code 4-5 COBOL85 source code 4-5 Pascal source code 4-6 specifying in CONSTANT statement 2-4, 4-2, 6-14 TACL sour
T Index TYPE clause BINARY data type 6-51 ENUM data type 6-52 VALUE clause 6-79 TACLGEN command 9-103 TAL command 9-103 TAL data structure token map 7-19 token type 7-4 TAL source code 88 condition-name clause 6-86 89 enumeration clause 6-91 bit maps 6-57 COMPUTATIONAL usage 6-76 constant 4-7 data definition PICTURE clause 6-30 TYPE clause 6-48, 6-51 data translation C-12 field length 6-30 generating with TAL command 1-7, 9-103 OCCURS clause subscripts 6-22 OCCURS DEPENDING ON clause 6-25 OUTPUT statement
U Index host-language data structures 7-18 naming conventions 7-19 structure 7-16 number TOKEN-CODE statement 7-8 TOKEN-MAP statement 7-14 type deleting 8-2 extensible structured 7-1, 7-16 generating source code from 8-5, 8-6 host-language data structures 7-4 modifying with OUTPUT UPDATE 8-8 names 7-5 showing usage of 8-11 simple 7-1, 7-4 SPI standard definitions 7-5 structure 7-4 TOKEN-CODE statement 7-9 TOKEN-CODE statement 7-8/7-13 TOKEN-MAP statement 7-13, 7-26 TOKEN-TYPE statement 7-2, 7-8 TYPE BINAR
W Index specifying in CONSTANT statement 4-2 TACL source code 4-6 TAL source code 4-7 VERSION option, TOKEN-MAP statement 7-15 W WARN command 9-115 WARNINGS command 9-115 Z ZERO(S) MUST BE clause 6-17 VALUE clause 6-80 ZSPIDEF.
Special Characters Index Data Definition Language (DDL) Reference Manual—426798-002 Index -22