• Keine Ergebnisse gefunden

The JOIN clause specifies the data items that CDCS m u s t i n s p e c t t o j o i n t h e a r e a s i n w h i c h t h e d a t a i t e m s r e s i d e . T h e o r d e r i n w h i c h t h e d a t a i t e m s

a r e s p e c i fi e d d e t e r m i n e s t h e d i r e c t i o n o f t h e r e l a t i o n s h i p , c a l l e d a p a r e n t / c h i l d r e l a t i o n s h i p . The JOIN clause is required if a RELATION NAME c l a u s e i s p r e s e n t . T h e f o r m a t o f t h e J O I N c l a u s e is shown in the relation entry.

Within the JOIN clause a specified data item in one a r e a i s e q u a t e d w i t h a n i d e n t i c a l d a t a i t e m i n a n o t h e r a r e a ; t h e t w o a r e a s a r e t h u s r e l a t e d t h r o u g h s p e c i fi c a t i o n o f a c o m m o n d a t a i t e m . T h e r e l a t i o n a l o p e r a t o r E Q m u s t a p p e a r b e t w e e n e a c h p a i r o f i d e n t i fi e r s i n c l u d e d i n t h e J O I N c l a u s e ; the source identifier appears to the left of the EQ and the target identifier appears to the right.

In the relationship defined by the JOIN clause, the s o u r c e i d e n t i fi e r d e fi n e s t h e p a r e n t ; t h e t a r g e t i d e n t i fi e r d e fi n e s t h e c h i l d . T h i s r e l a t i o n s h i p i s v a l i d f o r e v e r y s o u r c e - t a r g e t p a i r i n t h e r e l a

t i o n . R e f e r t o s e c t i o n 6 f o r m o r e i n f o r m a t i o n a b o u t r e l a t i o n s .

T h e t e r m i d e n t i fi e r r e fl e c t s a u n i q u e r e f e r e n c e t o a d a t a n a m e ; i t i m p l i e s t h a t t h e d a t a n a m e i s r e f e r e n c e d u n i q u e l y t h r o u g h a c o m b i n a t i o n o f s u b s c r i p t s a n d q u a l i fi e r s . R e f e r t o t h e I d e n t i fi e r s u b s e c t i o n , w h i c h a p p e a r s e a r l i e r i n t h i s s e c t i o n , f o r t h e i d e n t i fi e r f o r m a t .

E a c h s o u r c e i d e n t i fi e r ( e x c e p t t h e fi r s t ) m u s t b e in the same area as the previous target identifier, so that a continuous path from one area to the next a r e a i s d e fi n e d . C y c l i n g i s n o t a l l o w e d ; a n a r e a c a n n o t b e j o i n e d t o i t s e l f d i r e c t l y o r i n d i r e c t l y.

T h e i d e n t i fi e r s t o t h e l e f t a n d t o t h e r i g h t o f a r e l a t i o n a l o p e r a t o r m u s t h a v e i d e n t i c a l c h a r a c t e r

i s t i c s i n t h e p i c t u r e s p e c i fi c a t i o n o r i n t h e T Y P E s p e c i fi c a t i o n a n d m u s t h a v e i d e n t i c a l s y n c h r o n i z a t i o n a n d j u s t i fi c a t i o n ( i f a p p l i c a b l e ) . T h e position of the data items within the records need n o t b e i d e n t i c a l . T h e i d e n t i fi e r m u s t n o t s p e c i f y a data item that is more than 255 characters long.

S u b s c r i p t i n g a n d q u a l i fi c a t i o n c a n b e s p e c i fi e d f o r a n y i d e n t i fi e r .

Joining of areas in a relation is not guaranteed if a s p e c i fi e d i d e n t i fi e r i s a g r o u p i t e m w i t h p a d d i n g i n i t . P a d d i n g i s u s e d f o r w o r d a l i g n m e n t o f constituent items in a group item, and the content i s u n k n o w n . R e f e r t o fi g u r e 2 - 4 2 f o r a n e x a m p l e . Padding must occur in group item H because item K m u s t b e o n a w o r d b o u n d a r y. S i n c e t h e p a d d i n g c o n t e n t i n H i s u n k n o w n , d a t a i t e m G ( 1 ) i n a l l p r o b a b i l i t y w i l l n e v e r e q u a l d a t a i t e m H ( 1 ) . A n u n u s a b l e r e l a t i o n s h i p r e s u l t s .

T h e d a t a i t e m r e f e r e n c e d b y i d e n t i fi e r c a n b e a n y of the following types of data items:

A nonrepeating elementary item (no subscript).

A specific occurrence of a repeating elementary Item or an occurrence of a repeating group item (up to three subscripts).

A l l o c c u r r e n c e s o f a r e p e a t i n g d a t a i t e m i f i t i s a n a l t e r n a t e k e y o r t h e m a j o r p a r t o f a n a l t e r n a t e k e y, a n d i s s p e c i fi e d t o t h e r i g h t o f the EQ in the JOIN clause (subscript ANY).

A c o n c a t e n a t e d k e y. ( S e e K E Y c l a u s e d e s c r i p t i o n . )

0SM\

AREA NAME IS AREA1.

RECORD NAME IS Rl WITHIN AREA1.

0 2 6 O C C U R S 2 T I M E S . 4 3 I T E M A P I C " X ( 5 > « .

0 3 I T E M B P I C " 9 ( 1 0 ) " . 03 ITEM C PIC «9<3)V9<2>".

AREA NAME IS AREA2.

RECORD NAME IS R2 WITHIN AREA2.

0 2 H O C C U R S 1 T I M E S . 0 3 I T E M J P I C " X ( 2 > « . 03 ITEM K TYPE FIXED 9t2.

RELATION NAME IS REL-1.

JOIN WHERE 6 (1) EO H <1>.

Figure 2-42. Alignment Example

I f a r e p e a t i n g e l e m e n t a r y i t e m o r g r o u p i t e m i s s p e c i fi e d w i t h o u t a s u b s c r i p t , t h e fi r s t o c c u r r e n c e is used to join the relationship.

F o r e f fi c i e n t p r o c e s s i n g , t h e t a r g e t i d e n t i fi e r should be an item defined as a key field; retrieval o f r e c o r d o c c u r r e n c e s f r o m t h e fi l e c o n t a i n i n g t h e t a r g e t i d e n t i fi e r i s b y t h a t k e y. T h i s r u l e h o l d s f o r r e p e a t i n g o r n o n r e p e a t i n g e l e m e n t a r y i t e m s . Target identifiers defined as primary keys are most e f fi c i e n t ; a l t e r n a t e k e y s a r e n e x t m o s t e f fi c i e n t . O n l y t h e fi r s t o c c u r r e n c e o f a r e p e a t i n g i t e m c a n be defined as a primary key. If a repeating group item or a repeating elementary item is defined as a n a l t e r n a t e k e y, a l l o c c u r r e n c e s o f t h e i t e m o r g r o u p i t e m a r e u s e d a s t h e k e y, r a t h e r t h a n j u s t t h e fi r s t o c c u r r e n c e . T h e A N Y o p t i o n u s e d a s a s u b s c r i p t i d e n t i fi e s t h i s t y p e o f a l t e r n a t e k e y fi e l d a s a j o i n t e r m . I f a n y o n e o f t h e i t e m o c c u r r e n c e s s a t i s fi e s t h e e q u a l i t y , t h e r e c o r d o c c u r r e n c e i s i n c l u d e d i n t h e r e l a t i o n o c c u r r e n c e . I f a n i n t e g e r s u b s c r i p t i s u s e d i n s t e a d o f A N Y o n a n a l t e r n a t e k e y, r e t r i e v a l o f r e c o r d o c c u r r e n c e s i s b y s e q u e n t i a l a c c e s s . I f t h e t a r g e t i d e n t i fi e r is not a key, retrieval of record occurrences is by sequential access.

Figure 2-43 illustrates a record type in a schema.

B a s e d o n t h e r u l e s s p e c i fi e d p r e v i o u s l y, t h e f o l lowing data names from this record type could be used in a JOIN clause:

PART-NBR

STATE-ADDR (1,1) or PSOURCE (2) SOURCE-NAME (ANY)

RECORD IS PARTS-LIST WITHIN INVENTORY.

0 1 PA R T- N A M E P I C " X < 2 0 > " . 0 1 PA R T - N B R P I C « X ( 2 5 ) « . 01 PSOURCE OCCURS 10 TIMES.

0 3 S O U R C E - N A M E P I C * * X U 0 ) H . 03 SOURCE-ADDR OCCURS 1 TIMES.

0 5 S T R E E T- A D D R P I C « X ( 2 0 ) » . 0 5 C I T Y- A D D R P I C » X U 5 > « . 0 5 S TAT E - A D D R P I C * X ( 5 ) « .

Figure 2-43. Data Name Example

The identifier SOURCE-NAME must be to the right of t h e E Q o p e r a t o r i n t h e J O I N c l a u s e a n d m u s t b e defined as an alternate key.

SCHEMA COMPILATION AND MAINTENANCE FACILITIES

The DDL compiler is a multifunctional compiler that generates the schema directory and uses that direc

tory to verify compatibility of a recompiled schema with existing subschemas and to decode portions of t h e d i r e c t o r y t h r o u g h t h e E x h i b i t f a c i l i t y . T h e p a r t i c u l a r o p e r a t i o n p e r f o r m e d b y t h e c o m p i l e r i s selected by a parameter in the DDL3 control state m e n t . O n l y o n e s c h e m a d i r e c t o r y i s a l l o w e d t o r e s i d e o n a fi l e .

F o r fi e l d l e n g t h r e q u i r e m e n t s f o r s c h e m a c o m p i l a tion, refer to appendix G.

DDL3 CONTROL STATEMENT

The DDL3 control statement calls the DDL compiler.

I t s p e c i fi e s t h e f u n c t i o n t o b e p e r f o r m e d , t h e fi l e t h a t i d e n t i fi e s t h e s c h e m a d i r e c t o r y, t h e fi l e t h a t i d e n t i fi e s t h e s u b s c h e m a l i b r a r y , t h e fi l e t h a t contains the source input for the DDL compiler, the fi l e t h a t i s t o r e c e i v e o u t p u t l i s t i n g s a n d d i a g nostics, and the memory allocation for the schema r e c o r d b u f f e r.

The format of the DDL3 control statement for schema c o m p i l a t i o n a n d m a i n t e n a n c e f a c i l i t i e s i s s h o w n i n figure 2-44. The comma immediately following DDL3 can be replaced by a left parenthesis; the termina ting period can be replaced by a right parenthesis.

A l l p a r a m e t e r s o f t h e D D L 3 c o n t r o l s t a t e m e n t a r e o p t i o n a l .

DDL3 PCEXS=1 I ^sc=LfnJ^SB=Lfn:,^I=lfn:":/'L=l.fn:i:,NI=nbr].

Figure 2-44. DDL Control Statement Format for Schema Compilation and Maintenance

60485200 A 2-29

The EX and DS parameters select the function that i s t o b e p e r f o r m e d : T h e D S p a r a m e t e r s e l e c t s schema compilation; the EX parameter selects exe c u t i o n o f t h e E x h i b i t f a c i l i t y. T h e s e p a r a m e t e r s are interpreted as follows:

omitted

omitted

DS

EX

The DS parameter is assumed; a DDL schema is compiled.

A DDL schema is compiled.

T h e E x h i b i t f a c i l i t y i s e x e c u t e d . T h i s parameter must be specified to execute the E x h i b i t f a c i l i t y .

T h e S C p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t c o n t a i n s t h e s c h e m a d i r e c t o r y. T h e p a r a m e t e r i s i nt e r p r et ed as fo ll o w s :

omitted

The local file OUTPUT receives the listings a n d d i a g n o s t i c s g e n e r a t e d b y t h e D D L c o m p i l e r.

L=0

T h e l o c a l fi l e O U T P U T r e c e i v e s o n l y t h e diagnostics generated by the DDL compiler.

T h i s d e s i g n a t i o n i s n o t v a l i d f o r e x e c u t i o n o f t h e E x h i b i t u t i l i t y.

L = l f n

T h e s p e c i fi e d l o c a l fi l e n a m e i d e n t i fi e s t h e fi l e t h a t r e c e i v e s t h e l i s t i n g s a n d diagnostics generated by the DDL compiler.

The NI parameter specifies the number of 10-word b l o c k s a l l o c a t e d f o r t h e s c h e m a r e c o r d b u f f e r . This parameter is interpreted as follows:

omitted

One-fourth of available memory is allocated for the schema record buffer.

T h e fi r s t s e v e n c h a r a c t e r s o f t h e s c h e m a -name in the schema description entry of the s o u r c e p r o g r a m i d e n t i f y t h e l o c a l fi l e t h a t c o n t a i n s t h e s c h e m a d i r e c t o r y ( t h e o b j e c t schema).

SC=lfn

T h e s p e c i fi e d l o c a l fi l e n a m e i d e n t i fi e s the file that contains the schema directory (the object schema).

The SB parameter identifies the local file name of t h e s u b s c h e m a l i b r a r y fi l e t o b e s e a r c h e d f o r checksum mismatches when a schema is recompiled.

This parameter is interpreted as follows:

omitted

No subschema library search is performed.

SB=lfn

T h e l o c a l fi l e n a m e s p e c i fi e d i d e n t i fi e s the subschema library file to be searched.

T h e I p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t c o n t a i n s s o u r c e i n p u t f o r t h e D D L c o m p i l e r. T h i s parameter is interpreted as follows:

omitted

The local file INPUT is assumed to contain the source input for the DDL compiler.

1=1 fn

T h e s p e c i fi e d l o c a l fi l e n a m e i d e n t i fi e s t h e fi l e t h a t c o n t a i n s s o u r c e i n p u t f o r t h e DDL compiler.

T h e L p a r a m e t e r i d e n t i fi e s t h e l o c a l fi l e t h a t receives listings and diagnostics generated by the D D L c o m p i l e r. T h i s p a r a m e t e r i s i n t e r p r e t e d a s f o l l o w s :

NI=nbr

T h e n u m b e r n b r s p e c i fi e s t h e n u m b e r o f 10-word blocks of memory that are allocated for the schema record buffer.

The default value for the NI parameter is one-fourth o f t h e a v a i l a b l e m e m o r y . A v a i l a b l e m e m o r y i s d e fi n e d a s t h e m e m o r y a v a i l a b l e f r o m t h e h i g h e s t address for the DDL compiler (approximately 44000 o c t a l ) t o t h e m e m o r y l i m i t s p e c i fi e d b y a n R F L control statement (NOS or NOS/BE operating system) or an EFL command (INTERCOM). For example, if the memory limit is specified as 54000 octal and avail

able memory is 10000 octal words; the schema record buffer is 2000 octal words.

The schema record buffer must be large enough to c o n t a i n a l l d a t a d e s c r i p t i o n e n t r i e s f o r t h e l a r g e s t r e c o r d t y p e i n t h e s c h e m a . O n e 1 0 - w o r d b l o c k c a n s t o r e a d a t a d e s c r i p t i o n e n t r y w i t h a 10-character data name, a PICTURE clause, and a c l a u s e s p e c i f y i n g a d a t a b a s e p r o c e d u r e . I f a n entry contains other clauses or a longer data name, it requires more than 10 words to store the entry.

SCHEMA COMPILATION

The schema must be coded according to the specifi cations in this manual. Schema source code can be e n t e r e d t h r o u g h a t e r m i n a l , p r o c e s s e d b y a t e x t e d i t o r, a n d s t o r e d i n a fi l e .

The DDL compiler can be executed from a terminal a n d t h r o u g h a b a t c h j o b i n t h e f o l l o w i n g w a y s . When executed from a terminal, the schema program m u s t r e s i d e o n a fi l e w h o s e n a m e i s i n d i c a t e d b y the I parameter of the DDL3 control statement. In a b a t c h j o b i n w h i c h t h e i n p u t fi l e f o r t h e D D L compiler is assumed to be local file INPUT, the job s t r e a m m u s t b e s t r u c t u r e d s o t h a t t h e c o n t r o l statements precede the subschema source program.

An end-of-record indicator must immediately precede t h e fi r s t l i n e o f s c h e m a s o u r c e c o d e t o s e p a r a t e the schema program from the control statements.

C o n t r o l s t a t e m e n t s i n t h e j o b s t r e a m a n d t h e (refer to the DDL3 Control Statement subsection).

FILE Control Statement

The FILE control statement provides CYBER Record M a n a g e r w i t h i n f o r m a t i o n t h a t i s r e q u i r e d f o r fi l e parenthesis; the terminating period can be replaced by a right parenthesis.

F0=DA

(F0=AK )

FILE,lfn,< FO=DA >Crp] ... . (F0=IS )

Figure 2-45. FILE Control Statement Format T h e l o c a l fi l e n a m e s p e c i fi e d i n t h e F I L E c o n t r o l organization is associated with the area.

F0=IS

T h e e x t e n d e d i n d e x e d s e q u e n t i a l fi l e organization is associated with the area.

T h e p i n d i c a t e s a d d i t i o n a l p a r a m e t e r s . D e p e n d i n g organizations, the number cannot exceed 240 c h a r a c t e r s .

Additional parameters can provide other information (such as CYBER Record Manager record type and block