• Keine Ergebnisse gefunden

Figure 3-24. Redefining Data Items

USAGE IS

COMPUTATIONAL COMP

COMPUTATIONAL-1 COMP-1

COMPUTATIONAL-2 COMP-2

DISPLAY INDEX

A corresponding PICTURE clause must be numeric. If a P I C T U R E c l a u s e i s n o t s p e c i fi e d , t h e d e f a u l t i s PIC 9.

DISPLAY Option

A D I S P L AY d a t a i t e m i s s t o r e d i n d i s p l a y c o d e format. The data item can be alphabetic, numeric, or alphanumeric. When no USAGE clause is associ a t e d w i t h a d a t a i t e m , D I S P L AY i s t h e d e f a u l t format.

Figure 3-26. USAGE Clause Format, COBOL Subschema

This clause can describe a data item at any level.

W h e n t h e U S A G E c l a u s e i s s p e c i fi e d f o r a g r o u p i t e m , i t a p p l i e s t o e a c h s u b o r d i n a t e i t e m i n t h e group. The USAGE clause of an elementary item in a g ro up canno t co n tra d i ct the U SAGE cl ause of the g r o u p i t e m . I f t h e U S A G E c l a u s e i s n o t s p e c i fi e d for an elementary item or for any group to which the elementary item belongs, DISPLAY is assumed.

COMP, COMP-1, and COMP-2 are legal abbreviations f o r C O M P U TAT I O N A L , C O M P U TAT I O N A L - 1 , a n d COMPUTATIONAL-2.

A d a t a i t e m d e s c r i b e d a s C O M P U T A T I O N A L , COMPUTATIONAL-1, or COMPUTATIONAL-2 must be numeric w i t h a s i z e n o t e x c e e d i n g 1 8 s i g n i fi c a n t d i g i t s . If a group item is described as computational, the elementary items within the group are all computa t i o n a l ; h o w e v e r , t h e g r o u p i t e m i t s e l f i s n o t computational and cannot be used in computations.

When a PICTURE clause Is specified with a USAGE clause, the specifications must be compatible.

COMPUTATIONAL Option

A COMPUTATIONAL data item has a decimal numeric v a l u e . T h e P I C T U R E p i c t u r e - s p e c i fi c a t i o n c a n o n l y c o n t a i n t h e c h a r a c t e r s 9 ( d i g i t p o s i t i o n ) , S ( o p e r a t i o n a l s i g n ) , V ( i m p l i e d d e c i m a l p o i n t ) , a n d P (assumed decimal scaling position).

COMPUTATIONAL-1 Option

The COMPUTATIONAL-1 format describes a fixed-point i n t e g e r , w h i c h i s r e p r e s e n t e d i n t e r n a l l y a s a 4 8 - b i t b i n a r y i n t e g e r, r i g h t - a l i g n e d i n t h e w o r d . A corresponding PICTURE clause must be numeric. If a P I C T U R E c l a u s e i s n o t s p e c i fi e d , t h e d e f a u l t i s PIC 9.

COMPUTATIONAL-2 Option

A COMPUTATIONAL-2 data item is stored as a normal i z e d fl o a t i n g - p o i n t b i n a r y r e p r e s e n t a t i o n o f a d e c i m a l n u m b e r . T h e d e c i m a l p o i n t l o c a t i o n i s c a r r i e d i n t h e d a t a i t e m i t s e l f a s a b i n a r y e x p o n e n t . T h e d a t a i t e m i s s i n g l e - p r e c i s i o n a n d i s

stored in one computer word.

INDEX Option

The USAGE IS INDEX clause specifies a data item t h a t i s u s e d w i t h i n d e x e d t a b l e s . T h e i n d e x d a t a item contains a value that must correspond to an occurrence number of a table element. It cannot be a c o n d i t i o n a l v a r i a b l e ( l e v e l 8 8 d a t a i t e m ) . T h e INDEX option is not used by CDCS; it can be in cluded in the subschema description for use by the COBOL application program.

A n i n d e x d a t a i t e m i s a n e l e m e n t a r y i t e m , o n e computer word in length, and binary in format. Its m o d e c o r r e s p o n d s t o a n i t e m d e s c r i b e d a s COMPUTATIONAL-1; the item must be numeric and must not exceed 18 digits.

The SYNCHRONIZED, JUSTIFIED, and PICTURE clauses cannot be used to describe a group or elementary item that specifies USAGE IS INDEX.

RENAMES Clause

A level 66 data description entry uses the RENAMES clause. This clause permits alternate grouping and renaming of data items. The RENAMES clause is not used by CDCS; it can be included in the subschema description for use by the COBOL application pro gram. The format of the RENAMES clause is shown in

fi g u r e 3 - 2 7 .

66 name-1 RENAMES

data-( t h r u )

\ — ~ ~ ? data-name-3 (THROUGH J

-name-2

Figure 3-27. RENAMES Clause Format, COBOL Subschema

This clause is always used in a level 66 entry. No o t h e r c l a u s e c a n b e i n c l u d e d i n a l e v e l 6 6 e n t r y.

The RENAMES clause cannot be used to rename another l e v e l 6 6 e n t r y o r a l e v e l 8 8 e n t r y. T H R U i s t h e legal abbreviation for THROUGH.

More than one level 66 entry can rename the same d a t a i t e m . L e v e l 6 6 e n t r i e s m u s t b e t h e l a s t e n t r i e s d e fi n e d i n a r e c o r d . N o e n t r y c a n b e s u b ordinate to a level 66 entry.

60485200 A 3-19

D a t a n a m e 1 c a n n o t b e u s e d a s a q u a l i fi e r ; d a t a -n a m e - 2 a -n d d a t a - -n a m e - 3 c a -n b e q u a l i fi e d . T h e entries referred to by data-name-2 and data-name-3 cannot be described with the OCCURS clause or be subordinate to an entry described with the OCCURS clause. When the THRU option is included, none of t h e d a t a i t e m s w i t h i n t h e s p e c i fi e d r a n g e c a n b e v a r i a b l e - o c c u r r e n c e d a t a i t e m s . D a t a - n a m e - 2 a n d data-name-3 must be names of elementary items or groups of elementary items. Data-name-3 cannot be the same name as data-name-2 or subordinate to data-name-2.

T h e T H R U o p t i o n i s u s e d t o r e n a m e a s e r i e s o f consecutive elementary or group items. Data-name-1 Is a group item that includes all elementary items beginning with data-name-2 (or the first elementary I t e m i f i t i s a g r o u p I t e m ) a n d e n d i n g w i t h d a t a -n a m e - 3 ( o r t h e l a s t e l e m e -n t a r y i t e m i f i t i s a group item).

If the THRU option is not used, data-name-1 can be e i t h e r a n e l e m e n t a r y i t e m o r a g r o u p i t e m . D a t a -name-1 is an elementary item if data-name-2 is an elementary item or a group item if data-name-2 is a group item.

VALUE Clause

The VAL U E c l aus e s pec i fi es the v a l ues a ss ociated w i t h a c o n d i t i o n n a m e . I t i s u s e d i n a l e v e l 8 8 d a t a d e s c r i p t i o n e n t r y. T h e VA L U E c l a u s e i s n o t used by CDCS; it can be included in the subschema description for use by the COBOL application pro gram. The format of the VALUE clause is shown in fi g u r e 3 - 2 9 .

This clause defines one or more values or ranges of v a l u e s f o r a c o n d i t i o n - n a m e . I t i s a l w a y s u s e d i n a level 88 entry and is the only clause that can be used in a level 88 entry. THRU is the legal abbre viation for THROUGH. The THRU option is used to s p e c i f y a r a n g e o f v a l u e s . L i t e r a l s t h a t s p e c i f y a range must appear in ascending order.

T h e c o n d i t i o n - n a m e i s t h e n a m e a s s i g n e d t o t h e v a l u e s a n i t e m c a n a s s u m e . T h e f o l l o w i n g r u l e s apply to a condition-name and its associated VALUE clause:

The condition-name can describe only an elemen t a r y d a t a i t e m ; t h e n a m e c a n n o t b e u s e d t o describe a repeating group or renamed item.

T h e u s e o f t h e R E N A M E S c l a u s e i s i l l u s t r a t e d i n figure 3-28.

The condition-name must immediately follow the data item to which it refers.

Schema Subschema

01 01 01

JANUARY FEBRUARY MARCH

PICTURE PICTURE PICTURE

* X < 3 1 ) . * .

#X<29).«.

* X < 3 ] ) * .

03 CURRENT-YEAR.

0 5 J A N U A R Y P I C T U R E X < 3 1 ) . 05 FEBRUARY PICTURE X(29).

01 DECEMBER PICTURE * X < 3 1 > * . 05

6 6 6 6 6 6

<S6

DECEMBER PICTURE X(31).

FIRST-HALF RENAMES JANUARY THRU JUNE.

SECOND-HALF RENAMES JULY THRU DECEMBER.

FIRST-QUARTER RENAMES JANUARY THRU MARCH.

LAST-QUARTER RENAMES OCTOBER THRU DECEMBER.

Figure 3-28. Renaming Data Items

j V A L U E I S ) { VALUES ARE |

o o , V A L U E I S . , .

8 8 c o n d i t i o n - n a m e / . . . . „ „ l h t e r a l - 1 VALUES ARE

( T H R U ) , . , " | ) 7 \ l i t e r a l - 2

\ THROUGHi

literal-3 j T H R U )

{ THROUGH } literal-41

Figure 3-29. VALUE Clause Format, COBOL Subschema

The condition-name must be unique only when describing the same data item; the name can be d u p l i c a t e d f o r d i f f e r e n t d a t a i t e m s . F o r example:

02 ITEM1 PIC X(20).

88 NAME1 VALUE "ABCDE".

02 ITEM2 PIC 999.

88 NAME1 VALUE 123.

Level 88 Literals

S p e c i fi c r u l e s a p p l y t o t h e u s e o f l i t e r a l s i n t h e VA L U E c l a u s e . T h e r u l e s a r e d e fi n e d i n t h e f o l l o w i n g t e x t . T h e t e r m t a r g e t i t e m i s u s e d t o identify the elementary data item described by the condition-name.

Alphanumeric display target items (data class 0) L i t e r a l s s p e c i fi e d f o r a l p h a n u m e r i c d i s p l a y t a r g e t i t e m s m u s t b e n o n n u m e r i c a n d c a n c o n t a i n a m a x i m u m o f 2 5 5 c h a r a c t e r s a n d d i g i t s . T h e l i t e r a l l e n g t h m u s t n o t e x c e e d t h e t a r g e t i t e m p i c t u r e l e n g t h . I f U S A G E D I S P L A Y I s s p e c i fi e d w i t h n o P I C T U R E c l a u s e , l i t e r a l l e n g t h m u s t n o t e x c e e d o n e c h a r a c t e r . L i t e r a l s m u s t b e e n c l o s e d i n

q u o t a t i o n m a r k s . E x a m p l e 1 I n fi g u r e 3 - 3 0 i l l u s t r a t e s v a l i d l i t e r a l s f o r a l p h a n u m e r i c d i s p l a y t a r g e t i t e m s .

Alphabetic display target items (data class 1) L i t e r a l s s p e c i fi e d f o r a l p h a b e t i c d i s p l a y t a r g e t i t e m s m u s t b e n o n n u m e r i c a n d c a n contain a maximum of 255 characters. The l i t e r a l l e n g t h m u s t n o t e x c e e d t h e t a r g e t item picture length. USAGE DISPLAY cannot b e u s e d b e c a u s e d a t a c l a s s d e f a u l t s t o 0 r a t h e r t h a n t o 1 . L i t e r a l s m u s t b e e n c l o s e d i n q u o t a t i o n m a r k s . E x a m p l e 2 i n fi g u r e 3 - 3 0 i l l u s t r a t e s v a l i d l i t e r a l s f o r a l p h a b e t i c d i s p l a y t a r g e t i t e m s .

Integer display target items (data class 3) L i t e r a l s s p e c i fi e d f o r i n t e g e r d i s p l a y

target items must be numeric and can con t a i n a m a x i m u m o f 1 8 d i g i t s . T h e l i t e r a l l e n g t h m u s t n o t e x c e e d t h e t a r g e t i t e m picture length. If USAGE COMP is specified with no PICTURE clause, literal length must not exceed one digit and a separate opera

t i o n a l s i g n i s n o t a l l o w e d . E x a m p l e 3 i n fi g u r e 3 - 3 0 i l l u s t r a t e s v a l i d l i t e r a l s f o r i n t e g e r d i s p l a y t a r g e t i t e m s .

Example 1

0 ? I T E M A L P N U M .

8 8 L 8 8 VA L U E * A B C D ; < * 1 * 1 2 3 4 * T H R U * 5 6 7 8 9 # . Example 2

0 2 I T E M A L P H A P I C A ( 5 ) .

8 8 L 8 8 VA L U E * A B C D * . # A B C D E * . Example 3

0 2 I T E M N U M P I C 9 9 9 9 .

B 8 L 8 8 VA L U E 1 * 1 0 0 * 5 5 5 5 . 0 2 I T E M N U M P I C S 9 9 9 9 .

8 8 L 8 8 VA L U E - l O O t - 2 0 * 0 « * 1 0 0 * 5 5 5 5 . 02 ITEMNUM USAGE COMP.

8 8 L 8 8 VA L U E 0 * !♦ 5 t 9 . Example 4

0 2 I T E M F X P T P I C 9 9 9 V 9 9 .

8 8 L 8 8 V A L U E 0 * 1 0 0 * 1 0 0 . 5 * 1 0 0 . 5 5 . 0 2 I T E M F X P T P I C S 9 9 9 V 9 9 .

8 8 L 8 8 VA L U E - 1 0 0 . 5 5 . - 1 0 0 * 0 » ♦1 0 0 . 1 0 0 . 5 5 . 0 2 I T E M F X P T P I C P P P 9 9 9 .

8 8 L 8 8 V A L U E . 0 0 0 1 * . 0 0 0 1 2 * . 0 0 0 1 2 3 . 0 2 I T E M F X P T P I C 9 9 9 P P P.

8 8 L 8 8 VA L U E 1 0 0 0 . 1 2 3 . 0 0 0 .

Figure 3-30. Examples of Valid Level 88 Literals

60485200 A 3-21

F i xe d - p o i n t, b i n a r y i n te g e r, a n d c o d e d flo a ti n g p o i n t d i s p l a y t a r g e t i t e m s ( d a t a c l a s s 4 , 1 0 ,

13)

L i t e r a l s s p e c i fi e d f o r fi x e d - p o i n t , b i n a r y i n t e g e r, a n d c o d e d fl o a t i n g - p o i n t m u s t b e n u m e r i c . T h e l i t e r a l l e n g t h m u s t n o t e x c e e d t h e t a r g e t i t e m p i c t u r e l e n g t h . I f s c a l i n g z e r o s ( P ) a r e n o t s p e c i fi e d , p i c t u r e l e n g t h c a n n o t e x c e e d 1 8 c h a r a c t e r s e x c l u d i n g t h e d e c i m a l p o i n t . I f s c a l i n g z e r o s a r e s p e c i fi e d , p i c t u r e l e n g t h c a n n o t e x c e e d 3 0 c h a r a c t e r s a n d s i g n i fi c a n t d i g i t c o u n t c a n n o t e x c e e d 1 8 c h a r a c t e r s . I f USAGE COMP-1 (data class 10) or USAGE COMP-2 (data class 13) is specified with no P I C T U R E c l a u s e , l i t e r a l l e n g t h m u s t n o t exceed one character. Example 4 in figure 3 - 3 0 i l l u s t r a t e s v a l i d l i t e r a l s f o r t h e s e t a r g e t i t e m s .

Level 88 Figurative Constants

A fi g u r a t i v e c o n s t a n t i s a fi x e d v a l u e w i t h a predefined name. When the name is referenced in a s o u r c e p r o g r a m , t h e c o n s t a n t a s s o c i a t e d w i t h t h e n a m e i s a u t o m a t i c a l l y g e n e r a t e d i n t h e o b j e c t p r o g r a m . A fi g u r a t i v e c o n s t a n t c a n b e s u b s t i t u t e d for a literal in the VALUE clause.

S p e c i fi c r u l e s a p p l y t o t h e u s e o f fi g u r a t i v e c o n s t a n t s i n t h e VA L U E c l a u s e . T h e r u l e s a r e d e fi n e d i n t h e f o l l o w i n g t e x t . T h e t e r m t a r g e t i t e m i s u s e d t o i d e n t i f y t h e e l e m e n t a r y d a t a i t e m described by the condition-name.

HIGH-VALUES

When the HIGH-VALUES figurative constant is specified, the target item must be alphanu meric. A PICTURE clause with the character X o r U S A G E D I S P L AY m u s t b e s p e c i fi e d . E x a m p l e 1 i n fi g u r e 3 - 3 1 i l l u s t r a t e s v a l i d

use of HIGH-VALUES.

LOW-VALUES, SPACES

When the LOW-VALUES or SPACES figurative c o n s t a n t i s s p e c i fi e d , t h e t a r g e t i t e m m u s t b e e i t h e r a l p h a b e t i c o r a l p h a n u m e r i c , o r USAGE DISPLAY must be specified. Example 2 i n fi g u r e 3 - 3 1 i l l u s t r a t e s v a l i d u s e o f LOW-VALUES and SPACES.

Example 1

0 2 I T E M A P I C X ( 2 5 ) .

88 L8 8 VAL U E H IG H -VA LU E S.

02 IT E MA U S AG E D IS P LAY.

88 L88 VALUE HIGH-VALUES, Example 2

0 2 I T E M A P I C X ( 2 5 ) .

88 L8*8 VALUE LOW-VALUES.

02 ITEMA USAGE DISPLAY.

88 L88 VALUE SPACES.

Example 3

0 2 I T E M A P I C 9 9 9 .

88 L88 VALUE ZEROES.

02 ITEMA USAGE COMP.

88 L8 8 VAL U E ZE R O . 88 L881 VALUE ZEROS.

Example 4

0 2 I T E M A P I C X ( 5 > .

8 8 L 8 B VA L U E A L L * A B C * . 88 L881 VALUE ALL SPACES.

88 L882 VALUE ALL HIGH-VALUES.

88 L883 VALUE ALL LOW-VALUES.

Figure 3-31. Examples of Valid Level 88 Figurative Constants

RECORD DIVISION,

QUERY UPDATE SUBSCHEMA

The Record Division immediately follows the Realm D i v i s i o n . I t s p e c i fi e s t h e r e c o r d t y p e t o b e m a d e available to a Query Update application program and d e s c r i b e s t h e f o r m a t o f t h e d a t a i n e a c h r e c o r d t y p e . T h e f o r m a t o f t h e R e c o r d D i v i s i o n i s a s f o l l o w s :

RECORD DIVISION.

/ * * 3 t S v

ZERO, ZEROS, ZEROES { r e c o r d d e s c r i p t i o n e n t r y. }

When the ZERO, ZEROS, or ZEROES figurative c o n s t a n t i s s p e c i fi e d , t h e t a r g e t i t e m m u s t not be alphabetic (data class 1); all other d a t a c l a s s e s a r e a l l o w e d . E x a m p l e 3 i n fi g u r e 3 - 3 1 i l l u s t r a t e s v a l i d u s e o f Z E R O , ZEROS, and ZEROES.

A L L " l i t e r a l "

T h e r e c o r d s w i t h i n t h e r e a l m s s p e c i fi e d i n t h e R e a l m D i v i s i o n a r e d e s c r i b e d i n t h e R e c o r d D i v i s i o n . O n l y t h o s e r e c o r d s t h a t a r e t o b e u s e d b y the Query Update programs are included. The record d e s c r i p t i o n e n t r y c o n s i s t s o f a s e r i e s o f s t a t e m e n t s ( d a t a d e s c r i p t i o n e n t r i e s ) t h a t d e s c r i b e t h e

data as it is used by the Query Update programs.

W h e n A L L " l i t e r a l " o r A L L fi g u r a t i v e -c o n s t a n t i s s p e -c i fi e d , t h e t a r g e t i t e m m u s t be alphanumeric or USAGE DISPLAY must be s p e c i fi e d . T h e l e n g t h o f t h e l i t e r a l specified in the ALL clause must not exceed t h e t a r g e t i t e m p i c t u r e l e n g t h . I f U S A G E D I S P L A Y i s s p e c i fi e d w i t h n o P I C T U R E c l a u s e , l i t e r a l l e n g t h m u s t n o t e x c e e d o n e c h a r a c t e r.

T h e fi r s t d a t a d e s c r i p t i o n e n t r y m u s t b e l e v e l n u m b e r 0 1 , t h e r e c o r d n a m e e n t r y. S u b s e q u e n t entries begin with level numbers 02 through 49 for group and elementary data items, level number 66 for renaming a data item, and level number 88 for d e fi n i n g v a l u e s t o b e a s s o c i a t e d w i t h a c o n d i t i o n . The formats for data description entries are shown i n fi g u r e 3 - 3 2 .

/*®%v

01 record-name Format 1

l e v e l - n u m b e r d a t a - n a m e