Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Compiling the Schema DDL

The Schema DDL is compiled with the aid of the DDL compiler; it has to be assigned to the compiler as an input file.

On completing the compilation, the DDL compiler stores the schema description in the DBCOM (database compiler realm).

On the basis of this information, the subsequent BGSIA utility routine creates the SIA and stores it in the DBDIR (database directory).

Once an SSL description has been created, the compiled schema description in the DBCOM forms the basis for further processing by the SSL compiler and the BGSIA utility routine.

If no SSL description has been created, the schema description in the DBCOM is complete.

The DDL compiler also creates the COBOL subschema directory (COSSD), which stores information for the COBOL compiler. This information is needed for generation of the DB application programs. The actual contents of the COSSD are not generated until the Subschema DDL is compiled.

When required, the DDL compiler automatically extends the DBDIR and DBCOM of the database being processed or the DBTTs of the record types in the DBDIR and DBCOM. For details,
please refer to the "Database Operation" manual, Automatic realm extension by means of utility routines.

At startup the DDL compiler takes into account any assigned UDS/SQL pubset declaration (see the "Database Operation" manual, Pubset declaration job variable). Faulty assignment leads to the program aborting.

During execution the DDL compiler uses the linked-in DBH.

Figure 9: System environment for Schema DDL compilation 

Compiler statements:

The DDL compiler is used to compile both the Schema DDL and the Subschema DDL; the SSL, on the other hand, is compiled by the SSL compiler.
The following table is a list of compiler statements for:

  • the Schema DDL, marked with DDL

  • the Subschema DDL, marked with SDDL

  • the SSL, marked with SSL.

Statement                                          

Compiler

Default
value

Meaning

PARLIST IS { YES | NO }

DDL
SDDL
SSL

NO

optional;
YES
all statements are listed on SYSLST
NO
statements are not listed

SORCLIST IS { YES | NO }

DDL
SDDL
SSL

YES

optional;
YES
a listing is printed out on SYSLST, possibly containing error messages
NO
no listing is printed

SOURCE IS
   { 'file-name' |
     'lib(element)' }

DDL
SDDL
SSL

-

not required for inputs in interactive mode or if SYSDTA is assigned as the input file - in this case, it should be noted that all the statements, (at least END) must be entered first followed by the actual source.

assigns the compiler the file containing the Schema DDL/Subschema DDL/SSL.
Instead of ’file-name’ it is also possible to specify an element of a program library
(see "Program libraries" in the "LMS (BS2000)" manual).

lib: name of program library
element: name of element

SYSDTA is switched to the input file. It is reset to SYSCMD upon completion of the compiler run.
The statements “SOURCE IS“ and “DELETE SCHEMA“ or “DELETE SUBSCHEMA“ may not be used within the same DDL compiler run.

SUBSCHEMA FORM IS OLD

SDDL

-

optional;
this statement is only required for subschemas which are used by KDBS applications;
it is permissible only in conjunction with the “SOURCE IS filename” statement and is ignored when compiling schemas.

The “SUBSCHEMA FORM IS OLD” statement causes the transformed subschema and the check table (CHECK-TABLE) to be entered in
the COSSD in an internal format which was the standard format up to and including UDS/SQL V1.2 (“old” form; all reference numbers are 1
byte long).

A subschema can be compiled to a format compatible with UDS/SQL V1.2 only if the following conditions are satisfied:

  • No item of the subschema is of type DATABASE-KEY-LONG.

  • No item of the subschema is of the type NATIONAL.

  • No record type of the subschema is longer than 2020 bytes.

  • All record references and set numbers of the schema are <= 254.

Otherwise, the DDL compiler aborts with syntax errors, and the subschema is not entered in the DBCOM and COSSD.

GENERATE-REC-REF IS
   { YES | NO }

SDDL

NO

optional;
YES
record references are generated

In the IMPLICITLY-DEFINED-DATA-NAMES structure a field REC-REF PIC S9(4) BINARY is defined. For each record reference a condition name (level number 88) is assigned to this field, which matches the following pattern:
REF-record_name.
As the maximum length of a name is 30 characters, record_name, is truncated to 26 characters if necessary. In this case record_name must be unique in the first 26 characters.
The record reference can be used in a COBOL program as follows:
SET REF-record_name IN REC-REF TO TRUE.
MOVE REC-REF TO dbkey.

NO
record references are not generated

This statement is effective only for the generating of subschemas. When generating schemas the statement is ignored.

DELETE SCHEMA 'schema-name'

DDL

-

optional;
deletes the specified schema; useful after restructuring with BALTER if the DDL executes correctly and the SSL compilation reports errors actually attributable to the DDL

schema-name: name of schema

The “SOURCE IS“ and “DELETE SCHEMA“ statements must not be used within the same DDL compiler run.

DELETE [ONLY] SUBSCHEMA
  'subschema-name' {OF | :}
  SCHEMA 'schema-name'

SDDL

-

optional;
deletes the specified subschema. The subschema being compiled may have the same name as the subschema named in the DELETE statement, as it is deleted before the compiler run.

ONLY
if the parameter is omitted, a SOURCE statement must follow the DELETE statement.

If the parameter is specified, any SOURCE statement is ignored.

subschema-name: name of subschema
schema-name: name of schema

Both names have to be given in single quotes

DISPLAY IS { YES | NO }

DDL
SDDL
SSL

NO

optional;

YES
information held in DBCOM relating to record types, sets, etc. is output in unencoded form.

NO
values in DBCOM are not output

CREATE COSSD 'schema-name'

DDL
SDDL

-

Retroactive creation of COSSD.
If this was forgotten during schema compilation or the DDL compiler was terminated abnormally owing to an error when the COSSD was being configured, this can be carried out in a separate run before the first subschema is compiled;
schema-name: has to be given in single quotes.
The COSSD has to be created with a CREATE-FILE command prior to the compiler run.

N.B.:
If the SOURCE IS ... parameter is specified at the same time, compilation will be suppressed.

COMPARE SUBSCHEMAS

SDDL

-

admissible only after restructuring with BALTER.
The subschemas of the old schema are checked for compatibility with the new schema;
for this purpose the DDL compiler reads the subschemas from the old COSSD after the BALTER run.
If an old subschema is compatible with the new schema, it is entered in the new DBCOM and in the new COSSD.

DIAGNOSTIC IS { YES | NO }

SDDL

NO

only meaningful in conjunction with COMPARE
YES
diagnoses incompatibilities between old subschemas and the new schema and lists them in the form of error messages
NO
no error messages are output

QUOTE IS { SINGLE |
           DOUBLE }

DDL
SDDL

DOUBLE

either;
SINGLE
literals in the Schema DDL/ Subschema DDL are given in single quotes
DOUBLE
literals in the Schema DDL/ Subschema DDL are given in double quotes

END

DDL
SDDL
SSL

-

mandatory;
terminates statement input

Table 12: Compiler statements for the Schema DDL/Subschema DDL/SSL

Command sequence for compiling the Schema DDL

It is assumed for the command sequence described here that UDS/SQL was installed with IMON (see section "START commands for the UDS/SQL programs").

01 /CREATE-FILE FILE-NAME=dbname.COSSD ...

02 /ADD-FILE-LINK LINK-NAME=DATABASE,FILE-NAME=dbname.DBDIR

03 /SELECT-PRODUCT-VERSION PRODUCT-NAME=UDS-SQL,VERSION=version,SCOPE=*TASK

04 /CREATE-FILE FILE-NAME=dbname.DBSTAT,SUPPRESS-ERRORS=*FILE-EXISTING

   /CREATE-FILE FILE-NAME=dbname.DBSTAT.SAVE,SUPPRESS-ERRORS=*FILE-EXISTING

05 /START-UDS-DDL

06 ddl-compiler-statements

07 END

01

See section “Setting up COSSD” in chapter "Setting up the compiler database".

03

The version-dependent module of the linked-in DBH of the relevant version is loaded dynamically (see section "Compiling, linking and loading UDS/SQL-TIAM application programs" in the "Application Programming" manual).

04

The DBH requires the DB status files.

If the database name contains more than 8 characters, only the first 8 characters of the database name may be specified for dbname.

05

06

The UDS/SQL utility routine can also be started with the alias DDL.

The individual statements can be entered in one line if they are separated by commas or blanks.


Example

/CREATE-FILE FILE-NAME=TRAVEL.COSSD,SUPPORT=PUBLIC-DISK(SPACE=RELATIVE -
/      (PRIMARY-ALLOCATION=30,SECONDARY-ALLOCATION=10))
/CREATE-FILE FILE-NAME=TRAVEL.DBSTAT,SUPPORT=PUBLIC-DISK(SPACE=RELATIVE -
/      (PRIMARY-ALLOCATION=24,SECONDARY-ALLOCATION=48))
/CREATE-FILE FILE-NAME=TRAVEL.DBSTAT.SAVE,SUPPORT=PUBLIC-DISK(SPACE=RELATIVE -
/      (PRIMARY-ALLOCATION=24,SECONDARY-ALLOCATION=48))
/ADD-FILE-LINK LINK-NAME=DATABASE,FILE-NAME=TRAVEL.DBDIR
***** START        DDLCOMP      (UDS/SQL  V2.9 1801  )     2019-01-29   09:26:53
*  DDLCOMP: INPUT SYSTEMPARAMETERS
SOURCE IS 'S.TRAVEL.DDL'                                                
END                                                                     
*  DDLCOMP: READ SCHEMA/SUBSCHEMA       
%  UDS0215 UDS STARTING UDS/SQL V2.9 (LINKED-IN), DATE=2019-01-29 (ILL2038,09:26:53/4TE7) 
%  UDS0746 UDS PUBSET DECLARATION (CURRENT) FOLLOWS (ILL1746,09:26:53/4TE7) 
4TE7: UDS-PUBSET-JV:  :IUDS:$XXXXXXXX.PUBSDECL.PUBS                         
4TE7: PUBSETS:        IUDS                      
4TE7: DEFAULT PUBSET: IUDS
4TE7: ------------------------------------------
*  DDLCOMP: START SCHEMA-PHASE
*  DDLCOMP: CHECK SCHEMA RULES
*  DDLCOMP: CHECK DATA ALLOCATION
*  DDLCOMP: SEMANTIC TEST
*  DDLCOMP: CYCLUS TESTS
*  DDLCOMP: ERROR DIAGNOSTIC
*  DDLCOMP: NO ERRORS IN SCHEMA-PHASE
*  DDLCOMP: CREATE FILE COSSD
*  DDLCOMP: NO ERRORS DETECTED
%  UDS0758 NUMBER OF DML-STATEMENTS AND I/O COUNTERS PER DATABASE (ILL1758,09:26:54/4TE7)
4TE7: DATABASE NAME         DMLS    LOG READ  PHYS READ  LOG WRITE PHYS WRITE
4TE7: -----------------------------------------------------------------------
4TE7: TRAVEL                1394        4046         67       1760         45
%  UDS0213 UDS NORMAL SYSTEM TERMINATION WITH ************1394 DML-STATEMENTS 2019-01-29
(ILLY033,09:26:54/4TE7)
  
***** DIAGNOSTIC SUMMARY FOR DDL-SCHEMA TRAVEL-AGENCY
  
              NO ERRORS
+++++           8 WARNINGS 
  
***** END OF DIAGNOSTIC SUMMARY 
***** NORMAL END   DDLCOMP      (UDS/SQL  V2.9 1801 )     2019-01-29   09:26:54