(DDL) Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
Data Definition Language (DDL) Reference Manual Abstract This publication describes the DDL language syntax and the DDL dictionary database. The audience includes application programmers and database administrators. Product Version DDL D40 DDL H01 Supported Release Version Updates (RVUs) This publication supports J06.03 and all subsequent J-series RVUs, H06.03 and all subsequent H-series RVUs, and G06.26 and all subsequent G-series RVUs, until otherwise indicated by its replacement publications. Part Number Published 529431-003 May 2010 Document History Part Number Product Version Published 529431-002 DDL D40, DDL H01 July 2005 529431-003 DDL D40, DDL H01 May 2010 Legal Notices Copyright 2010 Hewlett-Packard Development Company L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. Export of the information contained in this publication may require authorization from the U.S. Department of Commerce. Microsoft, Windows, and Windows NT are U.S. registered trademarks of Microsoft Corporation. Intel, Itanium, Pentium, and Celeron are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java is a U.S. trademark of Sun Microsystems, Inc. Motif, OSF/1, UNIX, X/Open, and the "X" device are registered trademarks and IT DialTone and The Open Group are trademarks of The Open Group in the U.S. and other countries. Open Software Foundation, OSF, the OSF logo, OSF/1, OSF/Motif, and Motif are trademarks of the Open Software Foundation, Inc. OSF MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THE OSF MATERIAL PROVIDED HEREIN, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. OSF shall not be liable for errors contained herein or for incidental consequential damages in connection with the furnishing, performance, or use of this material. © 1990, 1991, 1992, 1993 Open Software Foundation, Inc. This documentation and the software to which it relates are derived in part from materials supplied by the following: © 1987, 1988, 1989 Carnegie-Mellon University. © 1989, 1990, 1991 Digital Equipment Corporation. © 1985, 1988, 1989, 1990 Encore Computer Corporation. © 1988 Free Software Foundation, Inc. © 1987, 1988, 1989, 1990, 1991 Hewlett-Packard Company. © 1985, 1987, 1988, 1989, 1990, 1991, 1992 International Business Machines Corporation. © 1988, 1989 Massachusetts Institute of Technology. © 1988, 1989, 1990 Mentat Inc. © 1988 Microsoft Corporation. © 1987, 1988, 1989, 1990, 1991, 1992 SecureWare, Inc. © 1990, 1991 Siemens Nixdorf Informationssysteme AG. © 1986, 1989, 1996, 1997 Sun Microsystems, Inc. © 1989, 1990, 1991 Transarc Corporation. This software and documentation are based in part on the Fourth Berkeley Software Distribution under license from The Regents of the University of California. OSF acknowledges the following individuals and institutions for their role in its development: Kenneth C.R.C. Arnold, Gregory S. Couch, Conrad C. Huang, Ed James, Symmetric Computer Systems, Robert Elz. © 1980, 1981, 1982, 1983, 1985, 1986, 1987, 1988, 1989 Regents of the University of California. Printed in the US Data Definition Language (DDL) Reference Manual Glossary Index Examples Figures Tables Legal Notices What’s New in This Manual xix Manual Information xix New and Changed Information xix About This Manual xxi Audience xxii Prerequisite Manuals xxii Related Manuals xxiii Notation Conventions xxiii 1. Introduction to DDL Compiling and Translating Data Definitions 1-3 Using DDL Definitions 1-4 Creating a Dictionary 1-5 Creating a Database 1-7 Generating Source Code 1-9 Maintaining a Dictionary 1-12 Examining a Dictionary 1-14 2. DDL Language Elements Names 2-1 Syntax 2-2 Restrictions 2-2 File Names 2-3 Local File Names 2-3 Network File Names 2-4 Locale Names 2-4 Numbers 2-5 Strings 2-5 National Literals 2-6 Keywords 2-6 Hewlett-Packard Company—529431-003 i Contents 2. DDL Language Elements (continued) 2. DDL Language Elements (continued) Reserved Words 2-11 Special Characters 2-12 Comments 2-12 Dictionary Comments 2-13 Compiler Listing Comments 2-15 Statements 2-16 Commands 2-18 3. Running the DDL Compiler RUN DDL Command 3-1 Running the DDL Compiler Noninteractively 3-3 Running the DDL Compiler Interactively 3-4 Completion Codes 3-5 4. Named Constants CONSTANT 4-1 Numeric Constants 4-3 Product Version Constants 4-4 Existing Constants 4-5 C 4-5 COBOL 4-6 Pascal (D-series Systems Only) 4-6 TACL 4-7 TAL 4-8 Examples 4-8 Standard SPI Constants 4-9 5. Definitions and Records DEFINITION 5-1 Order of Clauses 5-2 Definition Length 5-2 Field Definition 5-4 Group Definition 5-5 Reference Definition 5-7 Error Handling 5-8 RECORD 5-8 File-Creation Syntax 5-10 Creation-Attribute Syntax 5-12 Record Structure Syntax 5-15 Data Definition Language (DDL) Reference Manual—529431-003 ii Contents 5. Definitions and Records (continued) 5. Definitions and Records (continued) Record Reference Syntax 5-16 Key Assignment Syntax 5-17 Error Handling 5-18 Examples 5-19 Syntax Elements 5-21 Clauses 5-21 Other Elements 5-23 6. Definition Attributes AS 6-3 DISPLAY 6-4 EDIT-PIC 6-5 EXTERNAL 6-6 FILLER 6-7 HEADING 6-9 HELP 6-10 JUSTIFIED 6-11 KEYTAG 6-12 LN 6-13 MUST BE 6-15 NULL 6-19 OCCURS 6-20 OCCURS DEPENDING ON 6-23 PICTURE 6-25 National Data Items 6-28 C 6-28 COBOL 6-29 FORTRAN 6-30 Pascal (D-series Systems Only) 6-30 pTAL and TAL 6-30 TACL 6-31 REDEFINES 6-31 C 6-32 COBOL 6-33 FORTRAN 6-33 Pascal (D-series Systems Only) 6-34 pTAL or TAL 6-35 TACL 6-36 Data Definition Language (DDL) Reference Manual—529431-003 iii Contents 6. Definition Attributes (continued) 6. Definition Attributes (continued) SPI-NULL 6-37 SQLNULLABLE 6-39 TACL 6-44 TYPE 6-48 Specifying TYPE data-type 6-51 Specifying TYPE def-name 6-66 Specifying TYPE * 6-67 UPSHIFT 6-69 USAGE 6-70 VALUE 6-75 66 RENAMES 6-79 88 Condition-Name 6-81 89 Enumeration 6-84 7. SPI Tokens Defining SPI Tokens 7-2 TOKEN-TYPE 7-2 TOKEN-TYPE Statement Output 7-5 Standard SPI TOKEN-TYPE Definitions 7-5 TOKEN-CODE 7-8 TOKEN-CODE Statement Output 7-10 Standard SPI TOKEN-CODE Definitions 7-10 TOKEN-MAP 7-13 Product Versions for Bit Fields 7-17 TOKEN-MAP Statement Output 7-18 Standard SPI Definitions in Token-Map Definitions 7-19 8. Dictionary-Manipulation Statements DELETE 8-1 EXIT 8-4 OUTPUT 8-5 OUTPUT UPDATE 8-7 SHOW USE OF 8-11 9. DDL Compiler Commands ANSICOBOL 9-7 C 9-8 Data Definition Language (DDL) Reference Manual—529431-003 iv Contents 9. DDL Compiler Commands (continued) 9. DDL Compiler Commands (continued) C00CALIGN 9-12 CCHECK 9-12 CDEFINEUPPER 9-14 CFIELDALIGN_MATCHED2 9-14 CIFDEF, CIFNDEF, and CENDIF 9-18 CLISTIN 9-20 CLISTOUT 9-21 COBCHECK 9-23 COBLEVEL 9-25 COBOL 9-26 COLUMNS 9-29 COMMENTS 9-29 CPRAGMA 9-32 CTOKENMAP_ASDEFINE 9-32 CUNDEF 9-36 C_DECIMAL 9-37 C_MATCH_HISTORIC_TAL 9-40 DDL 9-42 DEFLIST 9-45 DICT 9-47 DICTN 9-49 DICTR 9-51 DO_PTAL_ON 9-52 EDIT 9-53 ERRORS 9-55 EXPANDC 9-56 FIELDALIGN_SHARED8 9-58 FILLER 9-59 FORCHECK 9-62 FORTRAN 9-63 FORTRANUNDERSCORE 9-66 FUP 9-67 HELP 9-70 LINECOUNT 9-70 LIST 9-71 NCLCONSTANT 9-72 NEWFUP_FILEFORMAT 9-75 NOFILEFORMAT 9-77 Data Definition Language (DDL) Reference Manual—529431-003 v Contents 9. DDL Compiler Commands (continued) 9. DDL Compiler Commands (continued) OLDFUP_FILEFORMAT 9-79 OUT 9-82 OUTPUT_SENSITIVE 9-83 PAGE 9-86 PASCAL (D-Series Systems Only) 9-86 PASCALBOUND (D-Series Systems Only) 9-89 PASCALCHECK (D-Series Systems Only) 9-90 PASCALNAMEDVARIANT (D-Series Only) 9-91 REPORT 9-92 RESET 9-94 SAVE 9-94 SECTION 9-96 SETLOCALENAME 9-97 SETSECTION 9-98 SOURCE 9-99 SPACING 9-101 TACL 9-101 TACLGEN 9-104 TAL 9-105 TALALLOCATE 9-108 TALBOUND 9-109 TALCHECK 9-110 TALUNDERSCORE 9-111 TEDIT 9-112 TIMESTAMP 9-113 VALUES 9-115 WARN 9-116 WARNINGS 9-116 10. Dictionary Maintenance Generating a schema From a Dictionary 10-1 Adding Dictionary Objects 10-2 Deleting Dictionary Objects 10-4 Deleting Unreferenced Objects 10-4 Deleting Referenced Objects 10-5 Modifying Dictionary Objects 10-8 Modifying Unreferenced Objects 10-9 Modifying Referenced Objects 10-10 Data Definition Language (DDL) Reference Manual—529431-003 vi Contents 10. Dictionary Maintenance (continued) 10. Dictionary Maintenance (continued) Making Major Modifications 10-13 Changing Dictionary Security 10-14 Moving a Dictionary 10-14 Moving a Nonaudited Dictionary 10-15 Moving an Audited Dictionary 10-16 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-22 A. DDL Messages B. Sample Schemas Sample Database Schema B-1 Host-Language Source Code B-1 Database Schema Listing B-2 Sample SPI Schema B-6 DDL Commands to Create an SPI Schema B-8 Selected ZSPIDDL Statements B-8 ASSNDDL Statements B-10 C.