A D A T A - F L O W L A N G U A G E F O R S P E C I F Y I N G
B U S I N E S S D A T A P R O C E S S I N G A P P L I C A T I O N S
V. M. M a l h o t r a a n d V, R a J a r a m a n
C o m p u t e r S c i e n c e P r o . q r a m ~ I n d i a n I n s t i t u t e o f Technolo~;.q~:~,
K A N P U R ( 2 0 8 0 1 6 ) I N D I A
A hi,.4h l e v e l s p e c i f i c a t i o n lansua.('.(e c a l l e d B u s i n e s s D a t a - F l o w Lan.,.'~ua~e ( B B F L ) b a s e d o n t h e d a t a - f l o w m o d e l of` c o m P u t m t i o n is d e s c r i b e d in t h i s P~:~Per, A t r a n s ] . a t o r t o c o n v e r t B D F L s P e c i f ` i c a t i o n s i n t o C O B O L Pro~.Irams h a s b e e n i m p l e m e n t e d , A n o v e l f ` e a t u r e o f t h e P r o P o s e d t r a n s l a t i o n s u s t e m is t h e u s e of" D a t a B a s e Mena.,.:Jemeni, S~:~stem ( D B M S ) in c o n j u n c t i o n w i t h C O B O L . T h i s r e l i e v e s t h e u s e r o 9 t h e n e e d t o de~'ine d a t a s t r u c t u r e s f`or t h e i n t e n d e d d a t a P r o c e s s i n r ~ m P P l i c a t i o n .
K e u w o r d s a n d P h r a s e s *
B u s i n e s s d a t a e r o c e s s i n . ~ , s P e c i f ` i c a t i o n I an.~:~ua~ e s ~ d~ta-.£ I o w n o r , - P r o c e d u r a l lans.fua.~Jes, t r a n s l a t i o n , D B M S ,
I an~.:.(ua:~es ~
C R cate~.~ories :
3 . 5 0 ~ 4 . 1 2 ~ 4 . 2 2 , 4 . 3 3 , 4 . 3 4 .
I . I N T R O D U C T I O N
T h e a i m o f ' t h i s P a P e r is t o e x p l o r e t h e u s e o f f u n c t i o r ~ a l s t u l e o f Pro~.(rammin~i( [ A G P 7 8 ~ A G P 8 0 , B A C 7 8 , DEN73.] in sF.ecif`~in~ b u s i n e s s
d a t a P r o c e s s i n.,.:~ P r o b l e m s . A s t h e
s P e c i f ` i c a t i o n I ar',~.l,.la ~ e w e i n t e n d t o
i n t r o d u c e is m e a n t t o b e u s e d b u t h e
b u s i n e s s d a t a Processin,...1 communit::~ ar, d t h e
s P e c i f ` i c a t i o n s h o u l d b e s e I f`....doc u m er,t i n~.l t h e s~:~ntax a d o p t e d is s i m i l ~ r t o t h e m o r e v e r b o s e 'Porm of` i " u n c t i o n a l lan~:.~u~.t.'~es, v i z . ,
data.-f` I o w I an~.qua~'Jes, a s o P P o s e d t o t h e
c o n c i s e a n d m a t h e m a t i c a l s u n t a x of` F P a n d F F P [ B A C 7 8 ] .
A P a r t 9 r o m t h e s~.;~nt~ct i c a I s i m i l a r i t i e s , t h e P r o P o s e d s p e c i f i c a t i o n I a n:~.~u a ~.~e, h e n c e f ` o r t h c a l l e d , Busir, e s s D a t a - F l o w Lar',.~..4uas~e ( B D F L ) , h a s ~:~et a n o t h e r f ` e a t u r e i'esemblin~.~ o t h e r d a t a - f l o w l~.~n~.~ua~es, B o t h
e l m a t d e s c r i b in::.4 a s u n c h T ' o n o u s
c o m p u t a t i o n a l a c t i v i t i e s , Data..-f`l o w
a r c h i t e c t u r e nssi;-~ns s P e c i f ` i e d f`ur,ctior, s t o
Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specific permission.
©
1981ACM0-89791-060-5/81-10/0203
$00.75
d i f ` f e r e n t P r o c e s s o r s . E a c h P r o c e s s o r w o r k s as%:~nchrollOus],~:l al-lf:.~l ¢ : : o - o } . . e r i ~ v t e s t>o i~(:'hieve t h e d e s i r e d c o m P u t a t i o r , . I n a s:i.t?,:i.I,~r wa*.~
B D F L sPecii~ic.:s t h e ~:I ~vl'. ~ P r o c e s s i r',~.:l
a c t i v i t i e s of` a s e t of` ' i n d e P e n d e n t ' :.:.I r o u P s , E a c h ~..( r (:)u P w o r k s ~s~:~n(:'h r o r , ou s l ~ and c o o p e r a t e s t o P e r £ o r m t h e rec~u:Ered J o b . The d:i.f'f`erer',ce b e t w e e n t h e t w o s t e m s lhainl~.~ f`rom t h e i n t e n d e d u s e r cc)mmunit:~ and t h e a i m s o f t h e lan~ua~i~e.
In s e c t i o n 2 o f t h i s P a P e r ~ brief` !~urve~
of` t h e i n t e n d e d a~=~Plieatior, a r e a a n d t h e r e a s o n s t h a t m ~ k e t h e u s e o f d a t a - f l o w I m , ~ u a . q e s ~ n a t t r a c t i v e F. r o P o s i t Lot, f ' o r b u s i n e s s d a t a P r o c e s s ins.~ a r e r,,reser,ted • S e c t i o n 3 is d e v o t e d t o a d e s c r i p t i o n of` t h e f ` e a t u r e s a n d f`unctior, s of` t h e l a n ~ J u a ~ e . S e c t i o r , 4 P r e s e n t s a brief` s k e t c h o f t h e t r a n s l a t o r t h a t is u s e d t o t r a n s l a t e t h e hi~lh l e v e l s p e c i f i c a t i o n o 9 t h e a P F l i c a t i o r ,
i n t o a P r o g r a m in e conver, t i o n a l
F. r o ~ rammin~.i 1 a n . q u a ~ e , T h i s ' cor',ventior, al I an.quas.le ' is C O B O l . . a n d m a k e s u s e o f a C O D A S Y L D B M S i m P l e m e n t a t i o n o n D E C S ~ s t e m I0 f o r t h e P u r p o s e of` m a s s StOT'~::'.~e Of` d a t a ,
C O B O L w a s s e l e c t e d a s it is currentl::~ t h e
m o s t P o P u l o r I an~.lua~e f o r b u s i n e s s d a t a P r o c e s s i n f ~ , I n s e c t i o n 5 n n e x a m p l e a n d
s o m e s t rate:zlies f`or enhar, c i n S t h e
e f ` f i c i e n c u a n d t h e r e a d a b i I it~:~ of" t h e ~er, e r a t e d COBOL P r o _ q r a m a r e P r e s e n t e d , I n
s e c t i o n 6 we c o n c l u d e b u P r e s e n t ir',:,1
o b ~ e r v a t i o r ' , s b a s e d oi", e'..'Perience w i t h ouT' suste,i.
20 D A T A - F L O W L A N G U A G E A S S P E C I F I C A T I O N T O O L
T o e v o l v e a n d u n d e r s t ~ n d t h e 14~n~Jua~,~e f o r s P e c i f ~ i n ~ J b u s i n e s s d a t a p r o c e s s i n ~ , i t is i m P e r a t i v e t o e x ~ m i n e t h e s t r u c t u r e o f b u s i n e s s o r ~ a n i s a t i o n s a n d t h e m a n u a l m e t h o d s t h e ~ u s e f o r d a t ~ P r o c e s s i n s ~ + I.t h a s b e e n o b s e r v e d [ H H K W 7 7 ] t h a t , s a v e ~ f e w m i n o r e x c e p t i o n s , t h e s e o r ~ a n i s m t i o n s h a v e t h e f o l l o w i n ~ { c h a r a c t e r i s t i c s t
"- B u s i n e s s e s a r e d i v i d e d i n t o
o r ~ a n i s a t i o n a l u n i t s s u c h a s
d i v i s i o n s a n d d e p a r t m e n t s . T h e
s t r u c t u r e o f t h e d a t a p r o c e s s i n £ ~ f o l l o w s c l o s e l u t h i s o r . e a n i s a t i o n °
- These o r ~ a n i s a t i o n a l u n i t s
communicate w i t h e a c h o t h e r v i a
documents i n a s t u l i s e d manner.
- D o c u m e n t m a n i p u l a t i o n rarel:~ i n v o l v e s c o m p l e x m a t h e m a t i c a l c o m p u t a t i o n s .
- D o c u m e n t s a r e f r e o u e n t l ~ s t o r e d f o r l a t e r u s e a n d r e f e r e n c e .
- O P e r a t i o n s a r e f r e c ~ u e n t l u P e r f o r m e d
o n ~JrouPs o f d o c u m e n t s ' . '
A n i m p o r t a n t c h a r a c t e r i s L i c t h a t h a s b e e n
m i s s e d in t h e a b o v e l i s t is t h e
a s ~ : ~ n c h r o r ~ o u s n a L u r e o f P r o c e s s i n s ~ in m a n u a l s ~ s t e m s + T h e t e r m a s ~ n c h r o n o u s h a s b e e n u s e d t o d e n o t e t h e a b s e n c e o f n n e x p l i c i t o r d e r o r s e c + u e n c e Jr', w h i c h f u n c t i o n s a n d s u b ' P u n c t i o n s a r e P e r f o r m e d . A <.:JrouP c a n P e r f o r m a d a i ; a Processin~:~ f u n c t i o n an~.:~ t i m e 4 ~ f i ; e r t h e ~ r r : i . w ~ l o f i ~ ] . l : i n p u t "d~[rt, m b ~ ' J s ' i t n e e d s ° D:i f r e r e n t £ i r o u P s c a n t h u s i r l d e P e n d e l 7 t 1 ~:~ c;il r f'~:~ OU'|5 t h e i r f u n c t i o n s + O r L e n a EJl'(:)uP ifla~ h a v e t o d e f e r 4~r'~ a c t i o n t i ] , ]. c e r t a i r l t i m e o r d a t e . S u c h a s i t u a t i o n mo,:~ b e m o d e l l e d <'+s a : ~ r o u P wa :i, t, :i. r ~ f o r a n ( emPt~.:t ) d a t a b8.~ t h a t , 4 ; t r r : i v e s on]..~ ~ t t h e s t i p u l a t e d t i m e w h i c h w o u l d t r i s ~ e r t h e d a t a p r o c e s s i n : i 8c1; i v i t i e~-; +
It is t h u s e v i d e n t t h a t t h e h i e r a r c h i c a l s t r u c t u r e a n d d a t a Processin~}J f u n c t i o n s o f ~l'i or~:~anisatior~ c a n b e s p e c i f i e d b~..~ m e a n s
o f n e s t e d b l o c k s o f £ L i n c t i o n s i n .~
d a t a - f l o w P r o : ~ r a m • D a t a - l i n e s m i r r o r t h e f l o w o f i n f o r m a t i o n a n d d o c u m e n t s b e t w e e n t h e or.~:.4+++nisational u n i t s °
T h e u s e o f d ~ t a - ? l o w m e c h a n i s m s f o r
s P e c i f:.-: i n~:~ b u s i n e s s d a t a P rocessin.~J
P r o b l e m s h a s al read~:~ b e e n m a d e i n t h e
desi:'~n o f B D L [ H H K W 7 7 3 • T h e i r a P P r o a c h d i ? f e r s f r o m o u r w o r k i n n u m e r o u s w a ~ s , t h e f o r e m o s t b e i n ~ t h e n e e d f o r a ; : J r a P h i e t e r m i n a l t o w r i t e a B D L s p e c i f i c a t i o n . T h e 1 an.t~.|u a~le B D F L d o e s n o t r e e u i re o n e . W e a l s o b e l i e v e t h ~ i ~ t e v e n t h o u g h P r i o r
d e c l a r a t i o n s o f d o c u m e n t ~ n d f i l e
s t r u c t u r e s h e l p in e f f i c i e n t e x e c u t i o n o f
t h e s p e c i f i c a t i o n s , the::~ P r e s e n t
d i f f i c u l t i e s in w r i t i n ~ s P e c i ' P i c a t i o n s •
T h i s is a s e r i o u s i m P e d i m e r , t f o r
n o r r p r o ~ r a m m e r s . W e m a k e e x t e n s i v e u s e o f
d a t a b a s e m ~.~na.£4ement s~:+stem ( D B M S ) t o
r e m o v e t h e n e e d f o r P r i o r d e c : l a r a t i o n s o f ti+~e r e c o r d a n d f i l e s t r u c t u r e s .
F u r t h e r m o r e , t h e e x p l i c i t l i n e s o r P a t h s t h a t n e e d b e d r ~ w n t o i n d i c a t e f l o w o f i n f o r m a t i o n i n t h e B D L d e s c r i p t i o n ma;.+ P r o v e i n c o n v e n i e n t . T h e severit;:~ o f t h e i n c o n v e n i e n c e w i l l b e m o r e e v i d e n t w h e n lar..~e a m o u n t o f relativel;:~ t r i v i a l d a t a i s p a s s e d a r o u n d i n t h e o r ~ . ~ a n i s a t i o n 0
S P e c i f i c a t i o n i ans~ua~4es, l i k e M O D E L
[ P P S 7 9 ] , w e f e e l , ~ r e n o t s u i t e d f o r
la:.~men • T h e s t a t e m e n t s in t h e 1 an.sK.la+Je
d e p i c t the: r e l a t , i o r ' ~ s h i P s amor,.~ i ; h e v a r i o u s o u a n t i t i e s o f i n t e r e s t t o t h e a P P l i c a t i o n . A l a ~ m a n w o u l d o ' r ' L e n P r e f e r t o l i s t t h e
s t e p s i n v o l v e d i n a r r i v i l " l + J a t t h e r e s u l t , i n s t e a d o f I istin_~, a l l t h e r e l e w ~ n L r e l a t i o n s h i p s t h a t m.i++~ht t o be s a t i s f i e d ° I n t h i s r e s p e c t , d a t e r - f l o w lan+~ua++es s:~ore
o v e r lan~ua.~es l i k e MODEL b.~J provid:i.nmt a
s.~ntax t h a t P e r m i t s t h e u++er s o m e " f e e l "
f o r t h e P r o c e d u r a l n a t u r e o f t h e
c o m p u t a t i o r ~ s . W h a t i s m o r e interest:i+r~ is
t h e f a c t t h a t u n l e s s t h e P e r c e i v e d
P r o c e d u r a l d e s c r i p t i o n c o n t a i n s a .<..'.+ross e r r o r , it ( t h e P r o c e d u r a l t r a c e ) belon~.fs t o
t h e s e t o f w ~ l i d t r a c e s . A t r a c e is
c o n s i d e r e d w.~l i d i f a sin..ele P r o c e s s o r e x e c u t i n . ~ t h e f u n c t i o r ~ s i n t h e o r d e r t h e w o c c u r i n t h e t r a c e d o n o t a b o r t d u e t o t h e absence o f a r e c r u i t e d d a t a .
A s e r i o u s l i m i t a t i o n o f d a t a - f l o w l a n ~ f u a ~ e s is their" i n e f f i c i e n t i m p l e m e n t a t i o n o n y o n N e u m a n n m a c h i n e s , T h o u ~ h w e d o n o t p r e s e n t a s o l u t i o n t o t h i s .~..~eneral p r o b l e m , ~:~et w e
f e e l t h a t it d o e s n o t P o s e a s e r i o u s
d r a w b a c k f o r t h e i n t e n d e d a P P l i c a t i o n s . T h e P r o p o s e d lan.~Jua.ee w o u l d r e d u c e P r o g r a m d e v e l o p m e n t t i m e a n d t h u s s a v e w ~ l u a b l e P r o f e s s i o n a l m a n - h o u r s • A s t h e t rer,d i s
t o w a r d s r e d u c e d h , ~ r d w a r e c o s t s a n d
i n c r e a s e d s c a r c i t , ~ o f a P P l i c ~ : t i o n s
P e r s o n n e l t h e t r a d e - o f f P r o p o s e d is
b e n e f i c i a l . F u r t h e r , P r o ~ r a m
t r a n s f o r m a t i o n s a n d o t h e r o P t i m i s a t i o n t e c h r , ic~ues ma~ be used t o r e d u c e c o m p u t e r
r e s o u r c e r e o u i r e m e n t s . The use o f
P r e - w r i t t e n cod+:.; i n t h e o b j e c t 1 +~m <~,..~a~e
(COBOL) t o r e p l a c e f rec:~uent l++ occurin+~
c o m b i n a t i o n s o f F u n c t i o n s i n BDFL
s p e c i f i c a t i o n s , durin~.:~ t r a n s l a t i o r , P r o c e s s , ma:~ b e m a d e t o i m p r o v e t h e P e r f o r m ~ n c e o f
3. T H E B U S I N E S S D A T A - F L O W L A N G U A G E ( B D F L )
T h e B D F L is a b l o c k s t r u c t u r e d , e x p r e s s i o n o r i e n t e d f f u n c t i o n a l lan:'~ua~:.~e b a s e d o n Id
[ A P G 8 0 , A P G 7 8 ] ° D a t a - l i n e s a r e ~.:~iven n a m e s
a n d the::~ c a r r u v a l u e s f r o m o n e f f u n c t i u n t o
o t h e r s ° E a c h d a t a - l i n e in t h e BDFL.
s P e c i £ i e m t i o n m a w b e l o a d e d w i t h ~i~ v a l u e b;:~ o n e a n d o n l u o n e f u n c t i o n , A n e>'.,~.~ressi~n d e f i n i n . d t h e f f u n c t i o n is w r i t t e n t o t h e
l e f t o f s u m b o l - - > a n d t h e l i s t off
d a t a - l i n e n a m e s re¢::eivin.~,~ t h e v a l u e s t o i t s r i ~ h t ° T h i s c o n s t r u c t i.s c a l l e d ~-.~ r,.Jl~.,:. T h e d a t a - l i n e s in B D F L a r e n,~t ex:.,licitl,,.,'
t~-~Ped. It is t h e usa.~-Je 4~nd t h e t u P e o f
i n f o r m a t i o n t h a t f l o w s alon~...~ ::~ d a L a - l i i ~ e t h a t d e f i n e s t h e t u P e ffor t h e dat:,a.-..]ine in t h e s P e e i f f i e a t i ~ n ° T h e d a t a - t u P e s t h a t h a v e b e e n i d e n t i f i e d , f o r t h e r, u r F , o s e o f c u r r e n t i m P l e m e n t ~ r L i o n ~:~re: n u l l , :i.nLe.~:~ler, f ' e c o r d , a n d d a t a s e ' t , ~ T h e o [ ' , h e r d:i~t,,.ml,~.:~Pes off i n t e r e s t t o t h e ~ ; p P ] . i c ; i ; L : i . o n a r e a ~!re~* r e a l , c h a r a c t e r a n d s/. r :i. n.~.~ 0 T h e s e c ~ n e a s i l u b e a d d e d t o t h e curri:.:~nL l i s t o f P e r m i t t e d d a t a - L u P e s ° I n w h a t f o l l o w s we s h a l l u s e t h e t e r m s e a l a r [~o d e n o t . . e t, h e t . ~ P e s :i.nt, e:..'.~er, r e a l , c h a r a e L e r a n d st,.,.i.n.~..'~, T h e c o e r c i o n o f f a v,~i~lue o f f o n e t~.~,,e t o ,~
w ~ l u e off d:i. f f f e r e n i , t u P e i s ,:~ssumed
a v a i ] . a b l e a n d 'i.s P e r f o r.med a u t omat:.:i, c~:~ 11 u w h e n P e r m i t t e d °
T h e v a l u e o f t:,;Pe n u l l ( r e P r e s e n t e d a s () in B D F L s P e c i f i c ~ ! ~ t i o n s ) c ~ n t r a v e l alon.~,:l m n u d a t a - l i n e i r r e s p e c t i v e o 9 t h e i n f e r r e d tauPe f o r t h e d a t a - l i n e ° W i t h t h e e x c e p t i o n off t h e d a t a s e t c o n s i ; r u c t o r a n d L h e Lest, o n
t h e n u l I it,..#, a l l a t o m i c e;.'P r e s s i o n s a n d
f u n c t i o n s roceivin.~i a v a l u e 0 £ t w P e n u l l P r o d u c e t h e r e s u l t o f L,u~:~e null,, W h i l e t h e d a t a s e t c o n s t r u c t o r i~.~nores t h e n u l l v a l u e , t h e f f u n c t i o n N U L L v.~roduces b o o l e a n v~l,..le T R U E . F o r v a l u e s o f a l l o t h e r % u P e s t h e f u n c t i o n N U L L P r o d u c e s t h e b o o l e a n v a l u e F A L S E °
T h e i n c l u s i o n o f r e c o r d t ~ P e in B D F L h4~s b e e n i n s p i r e d b~.:~ t h e t a b u l a r s t r u c t u r e o 9 led.~-Jers a n d t h e s t o r e d dat~:~ in m a n u a l d~{~.ta P ~'o{::ess i n ~ a P P l i c a t i o n s . A r e c o r d is a e o l l e e t i o n o f ' s e l e c t o r : v a l u e ' o , ' d o r e d
P a i r s ° A s e l e c t o r is off t;:,,F,e s t rin:~
w h e r e a s v a l u e i s o f f t u P e s c a l a r ,
T h e P r o j e c t i o n f u n c t i o n , O F , is us~.~d t o i s o l a t e t h e v a l u e a s s o c i a t e d w i t h n ~.:]:Jven s e l e c t o r ° T h u s , a O F C r e t u r n s t h e w ~ l u e B, iff ' a : B ' i s a n o r d e r e d ~.air in r e c o r d C. T h e o t h e r i m p o r t a n t f u n c t i o n a s s o c i , ~ t e d
w i t h ~ r e c o r d in B D F L is t h e r e c o r d
c o n s t r u c t o r f u n c t i o n , Thou~.:.lh t h e lan.~-p..la~:~e P e r m : i t s c e r t a i n s~.:~n(, a c t i c v a r i a t i o n s '[,he b a s i c c o n s t r u c t o r f f u n c t : i , o n i s w r i t t e n ~ s
< e l : A 1 , a 2 ~ A 2 , ~ . .~, a n ~ A n >, w h e r e a i , i = I t o n a r e t h e s e l e e t o r s a n d A i , i = 1 t o n a r e e i t h e r t h e w ~ l u e s o r t h e
n4~mes o'f dat;a-.lines o n w h i c h t h e v o l u e s
a r r i v e +
T h e d~:~taset is a n u n o r d e ~ , e d c o l l e c t i o n o f r e c o r d s ° T h e con, ,:.,:~..t o ~ d.i~t.i~set e l o s e l u • f o l l o w s t h e led~;.lers a n d t~:d.~!es th~I. m i n d
e x t e n s i v e u s e in m a n u a l dat~!~ Processin~.:~0 A
n e w d a t a s e t m a ~ b e c r e a t e d b~:~ o n e o r ~,he • fo I 1 o w in.~ w a ~ s .
CoP~.:~in.*s.I a n e x i s t i n ~ d a t a s e t °
Collectin.~.~ ~ sec:~uence o £ r e c o r d s
s a m e t u m e ) .
(off
c Takin:.,J a u n i o n o f a s e c ~ u e n c e o f
d a t a s e t s ( o f s a m e t u P e ) °
It m a u b e e m P h a s i s e d t h a t w h i l e (a) a n d (b) a b o v e c o r r e s p o n d c l o s e l ~ . ~ t o t h e m a n n e r t a b l e s a r e f i l l e d , ( c ) m i m i c s a c o l l e c t i o n o f t a b l e s , n ~ n . e ] . u , t h e l e d £ ~ e r ,
~ 0 1 E X P R E S S I O N S I N B D F L
A s t h e s~:~ntax a n d meanin.~..'~ o f f a r i t h m e t i c e x p r e s s i o n s i s u n i v e r s a ] . l ~ a c c e p t e d , we a d o p t i t , i n B I i F L a s a n a t o m i c b l o c k , T h e s w n t a x a n d s e m a n t i c s o f [{lock e x p r e s s i o n s ,
C o n d i t i o n a l e x p r e s s i o n s a n d l o o p
e x p r e s s i o n s in B D F L f o l l o w , e x c e P t ffor
m i n o r variegations, t h o s e off Id [ A G P 8 0 ] ~ W e
~.~ive b e l o w o n e e x a m p l e o f e ~ c h off t h e a b o v e e x p r e s s i o n s t o ~.~ive a f f l a v o u r o 9 t h e ~r:;ntax a n d s e m a n t i c s off B D F L e x p r e s s i o n s °
E x a m P l e I: It is d e s i r e d t o c o m p u t e t h e n e t re¢:~ui r e m e n L f f o r a " . , a r t ( Q T Y ) , b u s u b t r a c t i n : . . ~ t h e e u a n t : i , t u { : ~ w ~ i l a b ] . e i n [ , h e s t o c k s ( F R E E - Q T Y ) f ' r o m t h e o u a n t i t ~ n e e d e d t o s t a r t t h e P r o d u c t i o n ° T h e r e c o r d c a Y" r ~:~ :i. n~-~ i n f o r m a t i o n a b o u t t h e e u a n t , i t u n e e d e d i s a v a i l a b l e o n d~rt, a - l i n e P A R T - P R O D - S T - S C H .
R u l e ( 3 0 1 0 1 ) s h o w s n B D F L ~ ' u l e t o o b t a i n t h e QTY a n d t o umd~d~e t h e n e w F R E E - Q T Y t o z e r o , T h e v a l u e s r e t u r n e d b u . t h e f f u n c t i o n s RETURN a . ' e t r a n s f e r r e d o n t o ( , h e d a t a - l i n e s n a m e d t o t h e r i ,.~ht o f ' t h e s w m b o l .--...:::-0 T h e matchin.~..'J is b a s e d ~ n t h e o r d e r o f i, h e i r o c c u v ' r e n c e °
[ ( 0 ) - - > n e w F R E E - Q T Y
( Q T Y o f P A R T - P R O D - S T - S C H - F R E E - Q T Y )
- - > Q T Y r e t u r n Q T Y ~ r e t u r n n e w F R E E - Q T Y ]
- - > Q T Y , n e w F R E E - Q T Y
( 3 . 1 . I )
N O T E : T h e u s e off l o w e r c a s e l e t t e r s f o r
k e u - w o r d s i n t h e e x p r e s s i o n s is o n l u ' F o r r e a d i n ~ c o n v i n e n c e .
E x a m p l e 2 : T h i s e x a m p l e e x p a n d s t h e s m e c i f i c ~ i ~ t i o n s ~,~iven f o r t h e P r e v i o u s e x a m p l e . N o w , i t i s ~'euui~'ed t o ~ d d ~:~
~.:~ua r.d a~:~ainst (.he s i t u a t i o n w h e r ' e
F R E E - Q T Y u¢~.i:;~.~ e x c u o d t h e nee,J~ T h e n e w v e r s i o n o 9 t h e i.ule i s s h o w n b e l o w °
[ i f ( F R E E - Q T Y > Q T Y o f P A R T . . . P R O D - S T - S C H ) t h e n
( F R E E - Q T Y - O T Y o f P A R T . . . P R O D - S T - S C H )
• .' - > n e w F R E E ~ . Q T Y ; () - - > Q T Y
r e t u r n Q T Y ~ r e t u r n n e w F R E E - Q T Y e l s e
( 0 ) - - > n e w . F R E E - Q T Y ;
( Q T Y of ' P A R T - P R O D - S T - S C H - F R E E - Q T Y ) ... > Q T Y ; r e I t u r ' n Q T Y ; r e t u r n n e w F R E E - O T Y
f:i. ] - - > Q T Y , n e w FREE....QTY
( 3 . 1 . ? )
E x ~ : m P l e 3 : I t i s d e s i r ' e d t o c r~e~te n t ~ b l e ~;livin.~ t h e n u m b e ~ ' o f ~ e a v s (uF, t o 9 ) a n d c o m P o u n d i n t e ~ ' e s t o n a n ~mo,..int o f R s ° l O 0 0 a t t h e ~,~:~te o ? 6 . 0 % annu~!~ll~, T h e B D F L s~:',e(:'i f i c a t i o n i s ~ i v e n ,~s e x P l " e s s i o n
( 3 ~ I ° 3 ) ,
[ i n i t i a l
( I 0 0 0 ) - - > A M O U N T ; ( 0 ) - - > I N T E R E S T ; ( I ) - - > Y E A R
w h i l e ( Y E A R < 1 0 ) d o
¢( A M O U N T ) * l O & / 1 0 0 ) - - > n e w A M O U N T ( n e w A M O U N T - A M O U N T °)
- - > n e w I N T E R E S T ; ( Y E A R + 1 ) - - > n e w Y E A R ; r e t u ~ n s e t < Y E A R ~ n e w Y E A R ,
I N T E R E S T : n e w I N T E R E S T > o d ]
( 3 0 1 . 3 )
E x P r e . s s i o n ( 3 , 1 0 3 ) a l s o i l l u s t r a t e s t h e u s e oi" t h e ~'ecor, d c o n s t ¢'ucto f a n d t h e s e t c o n s t ~ , u c t o r f u n c t i o r ~ s i n B D F L , T h e f u n c t i o n S E T i..is e d i n t h e R E T U R N c l ~ u s e ~ ' e t u v n s ~ d a t a s e t c ~ ' e a t e d b~_~ (':~llectin~:~ ~ I I i t s a r ~ u m e n t ~ e c o r ' d s ,
3 . 2 D A T A S E T M A N I P U L A T I O N
A s e t o f f i v e f u n c t i o n a l f o ~ m s h ~ v e b e e n d e f i n e d i n B D F L t o P e r m i t m a n i P u l a t ~ i o n s i n v o l v i n ~ d a t a s e t s . T h e s e f u n c t i o n . ~ l f o r m s c n n b e r e c u r s i v e l ~ . ~ n e s t e d t o s P e c i f ~ t h e o p e r a t i o n s i n v o l v i n . q m o r e t h ~ n o n e d a t a s e t .
T h e i n c l u s i o n o'f t h e s e f u n c t i o n ~ l £ o ~ m s i s i n s p i r e d b,.~ t h e o b s e r w i ~ t i o n o f t h e m a n u a l m e t h o d s u s e d i n t a b l e a n d l e d d e r h~ndlin.~-~.
E a c h o'f t h e s e f u n c t i o n ~ i ~ l f o r m s d e f i n e b l o c k t o w h i c h i s m~i~de ~ v ~ i l ~ b l e a c o ; ~ o f t h e d a t ~ s e t , I n t h e i n t e r i o r " o f t h e s e b l o c k s e i t h e r " a sir',.~.~!le ( s u b o r ' d i n a t e ) b l o c k o r a s e e u e n c e o f t h e m ( d e P e n d i n d o n t h e f u n c t i o n a l f o r m ) e x i s t . T h e f u n c t i o n a l m a k e s a w ~ i l a b l e t o t h e s e s u b o ~ ' d i n a t e b l o c k s , a r e c o r d , :~ P a i r of' r e c o r d s , oi" ~ d a t a s e t c o m p o s e d o f t h e r e c o ~ ' d s f r o m t h e i n c o m i n~.:~ d a t a s e t , s a t i sf~in~.| s o m e (use~' d e f i n e d ) P r o p e ~'t~.:~ o
F o r t h e P u r p o s e of" t h e i r descr'ir, t i o n w e d i v i d e t h e s e f u n c t i o n a l f o r m s i n t o t h r e e ..qroums. T h e f o l l o w i n . ~ ~ c o n v e n t i o n s wiT. l b e
,..used t o d e s c ~ . i b e t h e s~.~ntax o f t h e s e
f u n c t i o n a l f o r m s .
- K e ~ w o r d s i n f u n c t i o n a l f o r m s ~ r e w r i t t e n i n ],oweY" c a s e .
- T h e a l t e r n a t i v e c l a u s e s ~ r e s e p a r a t e d b ~ s~.~mbo I a n d e 1 ~ c l o s e d i n a ~~ ~ i r o f b r'aces ( { } ) .
- Ze~'o o r m o r e o c c u r ' f e n c e s a~'e d e n o t e d b~.~ { } . , , ; w h i l e , { } ... d e n o t e s I o', • m o r e O C C U r T ~ e n c : e s ,
3 ° 2 , 1 F O R E A C H B L O C K S
T h i s c l a s s o f t h e f u n c t i o n a l f o r m s w e r e m o t i w i ~ t e d b~.~ t h e n e e d t o a P P l U a f u n c t i o n
t o e a c h e n t r~.-J i n a t a b l e o r ' t o e~u:'h
s u b - t a b l e i n i t .
[ { i n i t i a l { < R U L E > } _ _ _ }
• roY' e a c h s e t { < I D E N T I F I E R > I } ir, < D A T A S E T - N A M E > " { w i t h s a m e { < S E L E C T O R >
{ A S C E N D I N G I D E S C E N D I N G ~ } } _ _ _ } d o
{ < R U L E > } _ _ _ < R E T U R N C L A U S E S > o d ]
( a )
[ { i n i t i a l { < R U L E > } _ _ _ }
f o r e a c h r e c o r d { < I D E N T I F I E R > I } i n < D A T A S E T - N A M E >
{ { a s c e n d i n.~ Z d e s c e n d i n~.~} { < S E L E C T O R > } _ _ _ } * * *
{ w h i l e < B O O L E A N E X P R E S S I O N > } d o
{ < R U L E > } _ _ _
{ < R E T U R N C L A U S E > I ~ . e m a i n d e T , } . . . o d ]
( b )
F i ~ . 1~ T h e s . ~ n t a x f o r F O R E A C H B L O C K S
T h e s w n t a x f o r t h e f u n c t i o n a l f o r m s in t h i s c l a s s is s h o w n i n Fi.~J. I, T h e f u n c t i o n a l
F O R E A C H S E T P a r t i t i o n s t h e i n p u t d a t e s e t b a s e d o n t h e v a l u e s a s s o c : i a t e d w i t h t h e s P e c i f i e d s e l e c t o r s ° T h e s e i:%~ r t it i o n e d d a t a s e t s a r e t h e n d i s t r i b u t e d a m on~i~ t h e
s u b o r d i n a t e b l o c k s . T h e
ASCENI) I NG/DESCEND I NG c l a u s e d e f i n e s t h e
i r ~ t e r c o n r ~ e c t : [ o n s b e t w e e n t h e s e s u b e r d : i . l " : a t e b l o c k s ° When W I T H S A N E c ] . a u s e is o m : i t t e d t h e P a r t i t : i . o r l o f t . h e d a t a s e t irrl;o J . l " l t e r r / ~ l d a t a s e t s i s b ~ s e d o n t h e c r e a t i o n h:i.stor~.~ o f t h e da'tase'to
E x a m P l e 4 : L e t f b e a f u n c t i o n t h a t
a P P l i e s t o a s e t o f ' P r o d u c t i o n s t a r t s c h e d u l e s " ' f o r a P~.~rt, ,~lr'~d t o t h e s e t F R E E - S T O C K S , T h e f u n c t , i e n re't,u rrJs ~:~ d a t a s e t c o r , tain:i.rL~.:.l t h e r e e u i r e m e l " ~ t s f o r t h e P a r t °
G i v e n an i n p u t d a t a s e t c a r r ~ i n ~ ' P a r t P r o d u c t i o n s t a r t s c h e d u l e s ' f o r v a r i o u s P a r t s , t h e e > ' P r e s s i o n ( 3 ° 2 ° 1 , i ) P r o d u c e s
a d a t a s e t c o n t a i n i n ~ P a r t rec~ui remer~ts
f o r a l l P a r t s i n t h e i n p u t d ~ . r t e s e t , ,
[ f u r e a c h s e t in P A R T - P R O D - S T - S C H w i t h s a m e P A R T - N O d o
f ( F ' A R T - P R O D - S T - S C H , F R E E - S T O C K S ) - - > P A R T - R E Q - S U B S E T ; r e t u r n s e t P A R T - R E Q - S U B S E T
o d ]
( 3 ° 2 ° I ° I )
T h e f u n c t i o n a l F O R E A C H R E C O R D e l s e f o l l o w s s i m i l a r s e t o f r u l e s , w i t h t h e m a j o r e x c e p t i o n bein-~ t h a t it m a k e s a w ~ l i l a b l e a r e c o r d t o t h e b l o c k t h e t is s u b o r d i n a t e t o ~
it, T h e ke:.~-word r e m a i n d e r in Fi~.~° I (b)
r e P r e s e n t t h e f u n c t i o n t h a t in c : o n d u n c t i o n w i t h t h e w h i l e c l a u s e r e i , u r n . s ~i~ d a t a s e i , comPrJ.sinsl of" u n s c : a n n e d r e c o r d s o'r i n p u t d a t a s e t ,
E x a m p l e 5: L e t t h e d a t e - l i n e F R E E - S T O C K S P r o v i d e s e r e c o r d c o n t a i n i n g i n f o r m ~ t i o n a b o u t t h e a w ~ i l e b l e s t o c k o f e P a r t ° L e t
b e t h e fur, o r i o n a s d e f i n e d b~J ,Fxall=P.le 2°
E x p r e s s i o n ( 3 . 2 , 1 ° 2 ) u s e s t h e f u n c t i o n a l F O R E A C H R E C O R D t o e x t e n d t h e e x a m p l e t o d a t a s e t s ° T h u s , t h e e x p r e s s i o n ( 3 0 2 0 1 o 2 ) d e f i n e s e f u n c t i o n t h a t r e t u r n s a s e t o f r e c o r d s slivin.~-.~ n e t rec~uiremer~ts ( b ~ d a t e ) f o r a P a r t . T h e i n p u t t o t h e f u n c t i o n is s e t o f P r o j e c t e d n e e d s ( b w d a t e ) f o r t h a t P a r t ,
[ i n i t i a l
( Q T Y o f F R E E - S T O C K S ) - - > F R E E - O T Y ; f o r e a c h r e c o r d in P A R T - P R O D - S T - S C H
in a s c e n d i n ~ S T A R T - D A T E d o
- - > Q T Y , n e w F R E E - Q T Y ;
r e t u r n s e t < P A R T - N O I P A R T - N O o f P A R T - P R O D - S T - S C H , Q T Y : O T Y ,
S T A R T - D A T E : S T A R T - D A T E o f P A R T - P R O D - S T - S C H > o d ]
( 3 . 2 . 1 . 2 )
F i ~ ° 2 s h o w s a n e e u i v a l e n t b l o c k d i a g r a m f o r t h e e x p r e s s i o n ( 3 ° 2 . 1 + 2 ) .
FREE-QTY
--=
new FREE-OTY
PART-PROD-ST-SCH
, . . d
L °
• o_-
new FREE-OTY
Fisl.2 i T h e e e u i v a l e n t b l o c k d i a ~ r a m for. e x p r e s s i o n ( 3 . 2 0 1 . 2 ) 0 T h e l i n e s l a b e l l e d
a , b , c w i l l h a v e t h e l a b e l P A R T - P R O D - S T - S C H a n d s a t i s f ~ S T A R T - B A T E o f a < S T A R T - B A T E o f
b < S T A R T - B A T E o f c,
3 ° 2 ° 2 USING BLOCKS
T h e i n c l u s i o n o f t h e s e f u n c t i o n a l f o r m s
in B D F L is a i m e d a t f a c i I itatirY.~ t h e
s p e c i f i c a t i o n o f d a t a P r o c e s s i n ~
a c t i v i t i e s t h a t r e c ~ u i r e t h e a P P l i c a t i o n o f a ? u n c t i o n onl~.~ t o a c l a s s o f r e c o r d s
( o r t o a s i n g l e r e c o r d ) in a d a t a s e t ,
T h e s.~ntax f o r t h e t w o ~ u n c t i o n a l f o r m s in t h i s c l a s s is s~iven i n F i ~ . 3. U S I N G S E T ( R E C O R D ) f u n c t i o n a l c o n s t r u c t s f o r i t s s u b o r d i n a t e b l o c k s a d a t a s e t ( r e c o r d )
s a t i s f y i n g t h e b o o l e a n e x p r e s s i o n
i n d i c a t e d b w t h e u s e r ° T h e s e f u n c t i o n a l
f o r m s r e s e m b l e t h e c o n d i t i o n a l
e x p r e s s i o n s i n c e r t a i n r e s p e c t s ° The
d a t a i s Passed on t o one o f t h e two
a l t e r n a t i v e f u n c t i o n s ( b l o c k s ) based o n , w h e t h e r t h e d a t a bag i s emPt~ ( i . e . no r e c o r d s a t i s f ~ i n ~ t h e b o o l e a n e x p r e s s i o n e x i s t e d ) o r n o t .
The d a t a s e t g e n e r a t o r f u n c t i o n s UPDATE and
A P P E N D h a v e b e e n i n t r o d u c e d t o b e u s e d Jn c o n j u n c t i o n w i t h t h e s e f u n c t i o n a l f o r m s . T h e U P D A T E r e t u r n s a d a t a s e t th~,~t m a t c h e s t h e i n c o m i n ~ d a t a s e t in a l l e n t r i e s exce~:,t t h o s e t h m t s t i s f w t h e b o o l e ~ n e x p r e s s i o n °
T h e e n t r i e s ( e n t r ~ ) l,h ~t satisf~:~ t h e
b o o l e a n e x p r e s s i o n a r e r e p l a c e d b~:~ t h e a r ~ u m e n t o ~ t h e F u n c t i o n U P D A T E . T h e
f u n c t i o n A P P E N D r e t u r n s t h e d a t ~ s e t
o b t ~ i n e d b~:~ a d d i n ~ i t s a r:~.~ument t o t h e i n c o m i n~,~ d a t a s e t .
t h a t d o e s n o t h ~ v e a m ~ t c h i n ~ r e c o r d i n o t h e r d ~ t a s e t is p~:,:i~ed w i t h n n u l l r e c o r d .
A s p e c i a l c a s e o f t h i s tunction~.~l {"orm t h a t
f i n d e x t e n s i v e u s e in b u s i n e s s d o t~
P r o c e s s i n ~ aF, P I i(::at i o n s is u P d a t i n.,-I o f m a s t e r f i l e b::~ a t r a n s a c t i o n P i l e . T h e c o m p l e t e s~:~ntax f o r t h e f u n c t i o n a l f o r m is .~iven in F i ~ . 4. O t h e r c o n s i d e r ~ : ~ t i o n s a r e s i m i l a r t o t h o s e i n d i c a t e d f o r F O R E A C H R E C O R D b l o c k °
[ { i d i t i~!~l
{ < R U L E > } _ _ _ }
usin~:~ { s e t : r e c o r d } { < I D E N T I F I E R > : } in < D A T A S E T - N A H E >
w i t h < B O O L E A N E X P R E S S I O N > d o
{ < R U L E > } _ _ _
{ < R E T U R N C L A U S E > ~ < U P D A T E C L A U S E > } _ . . _ { : n o t f o u n d :
{ < R U L E > } _ _ _
{ < R E T U R N C L A U S E > : < A P P E N D C L A U S E > . } . _ _ _ } o d ]
[ { i n i t i a l
{ < R U L E > } _ _ _ }
f o r e a c h t u P l e { < I D E N T I F I E R > , < I D E N T I F I E R > ~ } in < D A T A S E T - N A M E > , < D A T A S E T - N A M E > in { { a s c e n d i n ~ I d e s c e n d i n ~ : ~ : ]"
< L E F T A N G L . B R A C K E T > < S E L E C T O R > , < S E L E C T O R >
< R I G H T A N G L ° B R A C K E T > } _ _ _ d o
o d ]
{ < R U L E > } _ _ _ < R E T U R N C L A U S E S >
F i ~ . 3: T h e s w n t a x f o r U S I N G B L O C K S F i ~ . 4: T h e seJntax f o r F O R E A C H T U P L E B L O C K
E x a m p l e 6: G i v e n a s e t o f t h e P r o d u c t i o n s t a r t s c h e d u l e s f o r a P a r t , it is d e s i r e d t o o b t a i n t h e s t o c k P o s i t i o n f o r t h e P a r t , T h e s t o c k P o s i t i o n is t h e n u s e d t o c o m p u t e t h e n e t P u r C h ~ s e re(:~uirements f o r t h e P a r t . L e t , h b e t h e f u n c t i o i J t h a t r e t u r n s t h e P u r c h a s e rec, u i r e m e n t s ~:~iven t h e n e c e s s a r ~ d a t a .
E x p r e s s i o n ( 3 . 2 . 2 . 1 ) u s e s t h e f u n c t i o n h t o c o m p l e t e t h e B D F L s ~ . , e c i f i c a t i o n f o r t h e d e s i r e d f u n c t i o n .
[ u s i n ~ r e c o r d in F R E E - S T O C K S w i t h P A R T - N O = P A R T - N O o f
P A R T - P R O D - S T - S C H d o
h - - > P A R T - R E Q - S U B S E T ; r e t u r n P A R T - R E Q - S U B S E T o d ]
( : 3 . 2 . 2 . 1 )
3 . 2 . 3 FOR EACH T U P L E BLOCK
T h i s f u n c t i o n e ; l h a s b e e n i n t r o d u c e d in t h e l a n g u a g e t o P e r m i t P r o c e s s i n ~ o f P a i r s o f r e c o r d s d r a w n f r o m t w o d a t a s e t s . T h e c r i t e r i o n f o r t h e Pairing.{ o f t h e r e c o r d s is i n d i c a t e d b~J t h e u s e r m s h e s p e c i f i e s t h e s e l e c t o r s t h a t s h o u l d h a v e m a t c h i n ~ v a l u e s
a s s o c i a t e d w i t h t h e m . An~:~ r e c o r d
( i r r e s P e c t i v e o f d a t a s e t it belon~;~s t o ) ,
E x a m p l e 7: E x P r e s s i o n ( 3 . 2 . 3 . ] . 0 u p d a t e s t h e m a s t e r f i l e M A S T b~J t h e t r a n s a c t i o n f i l e T R A N S .
[ f o r e a c h t u P l e T R E C , M R E C i n T R A N S , M A S T
in ascendin~:~ < P A R T - N O , I T E M - N O > d o
[ if ( n u l l ( T R E C )) t h e n
r e t u r n MREC e l s e
( Q T Y o f M R E C - G T Y o f T R E C ) - - > Q T Y ;
r e t u r n < I T E M - N O : I T E M - N O o f M R E C , Q T Y : Q T Y >
fi ] --:::~ R E C ; r e t u r n s e t R E C o d ]
( 3 . 2 . 3 . 1 )
4. A T R A N S L A T O R F O R B D F L
A m u l t i P h a s e t r a n s l a t o r h a s b e e n
i m p l e m e n t e d t o P e r m i t a u t o m a t i c _ ~ e n e r a t i o n o f C O B O L P ro-~rnms c o r r e s P o n d i n ~ t o B D F L s p e c i f i c a t i o n s . T h e t r a n s l a t o r h a s b e e n w r i t t e n in P A S C A L a n d is P o r t a b l e .
W e P r e s e n t h e r e onl~.~ a s k e t c h ~ m d e s c r i p t i o n o f t h e t r a n s l a t i o n a l . ~ o r i t h m . T h e d e t a i l s c a n b e f o u n d iI~ [ M A L 8 1 ] . A d e s c r i p t i o n o f
t h e m e J o r s t e p s it. t h e t r a n s l a t i o n P r o c e s s f o l l o w s :
i. E a c h b l o c k in t h e s p e c i f i c a t i o n is
assi~r',ed a unic~ue r'ame~ T h e u n i e u e n a m e
choser, P e r m i t s a s t . m P l e m e t h o d - F o r
d e d u c i n . . # , t h e n a m e o f t h e b l o c k t h a t c o r , t a i n s i t . H e n c e , i t i s P o s s i b ] . e t o r e c o n s t r u c t t, h e n e s t e d s t r u c t u r e o'P t h e
B D F L b l o c k s an~:~ t i m e d,..I r i r,£~ t h e
t r a n s l a t i o n P r o e e s s .
i i . T h e d a t a - l i n e s i m p l i e d b~a t h e
s p e c i f i c a t i o n ~ r e i d e n t i f i e d ° T o a v o i d P o s s i b l e c o n f l i c t s t h e d a t a - l i n e n ~ m e s a r e m a d e u n i c ~ u e b~.~ addir',~-~ i-,ecessar~ P r e f i × e s w h e r e n e e d e d .
T h e d a t a l i n e s t h a t a r e o f i n t e r e s t f o r t h e P u r P o s e o f t r a n s l a t i o n c a n b e ~.~rouPed Jr, t o t w o c l a s s e s .
- T h e d a t a - l i n e s t h a t r e p r e s e n t t h e f l o w o f i t , f o r m a t i o n a t ~ ~ i v e n l e v e l o f r , e s t i r ' ~ . T h e s e d a t ~ - . 1 :i. n e s a r e i d e r , t i f i e d b ~ P r o v i d i n ~ J ,~ d a t a . . l :i. n e f r o m t h e s o u r c e o f t h e d a t a t , o t h e b l o c k t h a t n e e d s i t . T h e d a t a n e e d s t h a t d o n o t h a v e t h e c o r r e s P o n d i n.~.~ s o u r c e a t t h a t l e v e l o f t h e n e s t : i . n d b e c o m e s t h e d e t a n e e d a t t h e r , e ; ' i , h i . s l h e r l e v e l .
- T h e o t h e r c l a s s o f d a t a - l i n e s d e a l s
w i t h t h e d a t a - l i n e s t h a t c ~ r rw
i n f o r m a t i o n f r o m at, o u t e r b l o c k t o i n n e r b l o c k s . T h e L o o p e x p r e s s i o n , C o n d i t i o r , al e x ~ r e s s i o n a n d d a t a s e t m a r ' i P u l a t i o r , f u n c t i o n a l f o r m s th~i~t brir,.~ t h e n e e d f o r c o n s i d e T ' i n ~ i ~ t h e s e d a t a - l i n e s a r e ~.~ss,..imed f o r t h e ~'...,..irPose o f t h i s s t e P t o b e r e s p o n s i b l e ' f o r n, a k i r ' ~ r, e c e s s a r . . w m r e v i s i o r , s t o c r e ~ : ~ t e t h e s e d a t a . . - 1 i n e s .
T h e d a t a - l i n e s t h a t d o n o t h ~ v e an~:~ s o u r c e e v e n a t t h e h i , ~ h e s t l e v e l r e p r e s e n t t h e in~'uJts t o t h e s p e c i f i c a t i o n . T h e o u t P u t s , usuall~:~ . ~ e t d e f i n e d b u t h e r e t u r n c l a u s e s in t h e o u t e r m o s t b l o c k ,
i i i ~ D e f i n e a d i r e c t e d .s~ r a~:~h w i t h t h e
e x P r e s s i o n r, a m e s ,~s n o d e s a n d t h e
d a t a - l i n e s a s ( d i r e c t e d ) ~:~rcs.
Topolo~:~ical iw s o r t t h e b l o c k s a t e a c h
l e v e l ( i . e . t h e b l o c k s t h a t a r e c o n t a i r , e d in a sin~,lle b l o c k ) . R e a r r a r , ~ e , a t a l l l e v e l s , t h e b l o c k s i n t o t h e i r t o P o l o ~ J i c a l o r d e r .
T h e P u r p o s e o f t h i s r e - a r r a r , ~ e m e n t o f t h e
b l o c k s is t o c o n v e r t t h e B D F L
s P e c i f i c a t i o n d e s c r i b i n s ~ t h e F, r o c e s s i r,~i~ a c t i v i t i e s b e i n ~ c a r r i e d o u t it, P a r a l l e l
a n d d i s t r i b u t e d i n s p a c e , i n t o ~
c o m p u t a t i o n t h a t is t o b e c a r r i e d b~.~ ~i~ s i n g l e P r o c e s s o r a n d e x t e n d s in t i m e
i n s t e a d o f s p a c e . T h e t o P o l o d i c a l
o r d e r i n ~ o f t h e e×,~, r a s s i o n s P e r m i t s e e u e n t i a l e x e c u t i o n w i t h o u t e v e r hnvin~! t o s t a r v e f o r d a t a .
iv, T a k i n~.~ adw~r,t a~.~e o f t h e a r r a n ~ e m e n t o b t a i n e d in ( i i i ) a b o v e , d e d u c e t h e t~m.e 90+" e a c h d a t a - l i n e ~ S o m e o f t h e r u l e s u s e d f o r d e d u c i n ~ i l ' t ~ l P e s o f ' t h e d~iH,a-..l:i.ne a r e :
- D a t a - l i n e receivin~.:.~ t h e r e s u l t o f ~ n a r i t h m e t i c c o m P u t a t i o n is a s s i ~ n e d t h e t~Jee inte~.~er.
... D a t a - l i n e t h a t r e c e i v e s a v a l u e f r o m a n o t h e r d a t a - l i n e is ~ r o u P e d w i t h t h e d o n o r d a t a - l i n e f o r t h e ;,~ ,..i r,,~, o s e o f t h e i r t~.ape d e d u c t i o n ,
- A n a P P l i c a t i o n o f t h e P r o j e c t i o n f u n c t i o n t o t h e w ~ l u e o n a d a t a - l i n e i m P l i e s i t s t~:~F,e t o b e o t h e r t h.::~,, s c a l a r .
- A u s e o f r e c o r d c o n s t r u c t o r ;~nd s e t
c o n s t r u c t o r r e v e a l s t h e t~n:~e o f
d a t a - l i n e r e c e i v i r ' ~ t h e v a l u e .
• .. A u s e o f d a t a s e t m a n i P U l ~ : ~ t i o n
f u n c t i o n a l f o r m a l s o r e v e a l s t h e t~.:n:.e f o r t, h e d a t a - l i n e s i n c i d e n t t o it a n d t h e d ~ r t a - l i n e s i n s i d e t h e b l o c k ~
F o r t h e d a t a - l i n e s of" t~aF, e r e c o r d a n d d a t a - s e t l i s t s o f t h e " s e l e c t o r s ' a s s o c i a t e d w i t h t h e r e c o r d s a r e a l s o P r e P a r e d ~
v0 U s i n ~ i n f o r m a t i o n c o l l e c t e d i n ( i v ) , ~.~er'e r a t e t h e S C H E M A f o r t h e D B M S ° F o r t h i s P u r P o s e , record-t:~n:~es a r e d e f i n e d f o r i n p u t s , o u t p u t s a n d o t h e r r e c o r d s a n d
d a t a s e t s . B e s i d e t h e s e a f e w m o r e
r e c o r d - t ~ m e s a r e d e f ' i n e d t o P e r f o r m h o u s e k e e P :i. n.~'~ c h o r e s .
B a s e d o n t h e usa~.~;e P a t t e r n s ( i n t h e B D F L s p e c i f i c a t i o n ) f o r t h e d a t a - l i n e s o f t h e t u P e d a t a s e t t h e ( C O D A S Y L ) s e t s o r e d e f i n e d i n t h e S C H E M A . T h e d e f i n i t i o n o f t h e s e s e t s is ~.:.~uided b~.~ t h e d e s i r e t o b e a b l e t o f o r m a t t h e d a t a s e t a s s o o n a s it i s c r e a t e c l , i n a f o r m t h a t is c o n d u c i v e t o t h e e ; . ' P l o i t a t i o n b ~ t h e f u n c t i o r , al f o r m s f o r d a t a s e t maniP,.Jl a t ior', t o w h i c h t h e d a t a s e t is d e s t i n e d t o b e P u t .
v i . T h e C O B O L c o d e is ~ e n e r a t e d in t h e f o l l o w i n ~ f a s h i o n .
E a c h b l o c k r e s u l t s i n ~ s e(:~uer',ce o f
c o n s e c u t i v e P a r a g r a P h s i n t h e C O B O L c o d e .
T h e r , e e e s s a r u c o d e t o 'r,-r,' t h e b l o c k i s
P r o d u c e d ; w h i l e P E R F O R M s t a t e m e n t s a r e i n t r o d u c e d t o r u n t h e s , , b o r d i n a t e b l o c k s .
5 0
AN
E X A M P L EFi~-I ~ 5 P r e s t e n t s t h e o v e r v i e w o'f' 4~n
e x a m P l e ~ T h e ex~.~mPle o w e s i t s o r i ~ J i n t o C l i £ t o n [ C L I F 7 1 ] 0
I model Production
~
sehedule
I
model ~roO~ctionstartlschedule
a . . . ductiol n l~aartial
assemblu 1 Production start schedule
I
; : ,[ction
s c h e d u l e
t
obtain
Part
Production
start
schedule
see stocks;
and compute
F,~rt
reeui remer,ts
Partl reeui r(ements
I bmtCr he~ui r~z~mentt she
batche]J
lad
-l,"v,.Fi~.~o 5 : O v e r v i e w of' a b u s i n e s s d~t4~
P r o c e s s i n ~ : J a P P i ic~{vL',ion
T h i s e x a m p l e c o n c e ¢'ns a m 4 ~ n u £ ~ c t u r i n~.:.~ c o m P a n ~ J ens.~a.~-Jed i n m ~ i n u f ' a c i u r i n £ ~ a r~i~i~~(.:~ of, P r o d u c t s . A m a r k e t a b l e P r O d u c t , c ~ l l e d m o d e l , i s built:, o 9 a n u m b e ~ ' o 9 P a ¢ . t s L. h a t t h e oomPan~;~, e i t h e r " P r o c u r e s i n t h e m a r k e l ~ o r P r o d u c e s l o c a l I ~ ° T o £ a c i l i t a t e t h e P r o d u c ~ , i o n , a ran.~~e o ~ a s s e m b l i e s ,~re ,llso P r o d u c e d • T h e s e a s s e m b l i e s d o int.o t, h e P r o d u c t i o n o 9 t h e m o d e l s m n d a r e .~,,rodueed or, l u w h e n d e m a n d a r i s e s °
I t i s d e s i r e d t o ~ u t o m a t e t h e P r o c e s s o F o r d e r P l a c e m e n t ~:~nd c a n c e l l ~ L ; i o n '£or L.he ~,.art b~:~sed o n t h e P r o j e c t e d dem~{~r),.J £ o r L h e m o d e l s °
I Pti!~t~{ r~Hi!~!i~tiirS~ii~h~ii!ict i°n star t schedule I
Obtain for the ~art ~icked the in£ormation I about the free.stock in the inventories
_ _ _ . . . .
Fi~:~ 6 : T h e d e L . ~ i l s F o r n e t ~..art
re¢:~uireme0~L comPut<~I,io~,
H e r e w e '.~n]~J Lii~ke t~,e d e t ~ i l s o ~ ~ Ful,cti.on I:.h aL; e n a b l e % Lh,.., c~i~l c u 1 a t,.i o o of" t h e r e ~ : ~ u i r e m e n t s £ o r t h e v a r i o u s ~'.~.~f"Li:~, F i ' ~ , ,
6 d e s c r i b e s , i n d e l , a i l ~ t h e f ' l o w o r
i n £ o r m a i , i o n f r o m t h e f u n c t i o n t o i t s s u b ' P u n c t : i o n s a n d b e t , w e e n I, h e m , B i t s o £ t h i s s P e c i t " i c ~ r L : i . o n h a v e a l r e ~ d u b e e n c o n v e r t e d t o B D F L s F e c i F i c a t : i . o n s i n S e c t i o r ~ 3~ T h e c o n s o l i d a t e d B D F L s P e c i £ i c a t , i o n £ o r • th e f u n c L , : i . J n aPPe~-~rs i n F i : J 0 7~
T h e C O B O L P r o~.I r~:~m f"o r t h e e x a m p l e w a s ~ ; e n e r a t e d . T h e P r o £ ~ r a m w a s ~ b o u L 2 9 0 0 l i n e s lon~-~0 T h e P r o ~ r a m e × e c u t e d c o r r e c t l ~ • P o t a l l L h e dat, a i t wa~s L,~'ied o n ,
T h e ~}~ene r a t e d C O B O L Pro~.~r~i~ms s h o w s o m e
un,:Jes i r e ~ b I e t r,{~iL.s L o o . Firstls'., t h e
o b j e c t Pro~.~r~m s i z e t e n d s t o b e l a r d e e v e n for. s m a l l sPec. i f " i c ~ t i o n s , T h e r~.~ti.o o £ t h e o b j e c t P r o ! ~ l r a m si.:,:e t o L h e s o u r c e B D F L
s P e c :i. f' :i. c4~vt :i. o n s i z e i m p r o v e s ~ s L h e
a P P 1 :i. c4[~t i o n s b e c o m e m o r e i n v o l v e d ,:~r,d comPle,'.~. T h e r e a s o n f o r t h e u n d u l u l a r £ ~ e
COBOL c o d e , ~vt; t h e l o w e r e n d of" t h e
a P P l i c a t i o n s , l i e s i n t h e ' £ ~ c t t, h a L t h e ~-~ener,:ivt, e d P r o ~ J r a l f l L e n d s t o b e d o m i n a t e d b u t . h e c o d e r e s p o n s i b l e f ' o r s e t L i n~-I-uP t h e B B M S £ o r i r i m u t ~)rld o u I , P u t d a t a . T h e h o u s e k e e m i n ~ _ ~ c h o r e s L,h~t 9 i n d t h e i r
a P P l i c a t i o n s i n m o r e i n v o l v e d Pro:,.Irams, a r e a l s o P e r £ o r m e d i n t h e s e s i m p l e c m s e s e v e n thou,:~.~h the:~ d o n o t 9 i n d a n w u s e i n t h e s e a P P l i c a t i o n s °
A n u m b e r o f m o d i f i c a t i o n s c a n b e m a d e t o
c o m p a c t t h e !:;erie r s t e d c o d e . T h e
comF.~Jct i o n , b e s i d e s c u t t i n s ~ t h e r u n - t i m e m a k e s L h e ~'~ro~ram r e a d ~ b l e 0
O n e 0 9 t h e c o m P s c t i o n s t r a t e ~ i e s i n v o l v e s deleLin~-~ L h e ' M O V E C O R R ' s t a t e m e n t s t h a t de~-~ 1 if-, r e c o r d s w i t h n o coma~ior, £ i e l d ,
F u r t h e r ~ t h e w ~ l u e s o £ s o m e o'F t h e
c o m p i l e t i m e ) ° T h u s t h e u n w a r r a n t e d
c o m p u t a t i o n s a n d , if d e s i r e d , t h e s e
i d e n t i f i e r s c a n b e c o m ~ l e t e l ~ r.emoved f r o m
t h e Pro~z~rams • E l i m i n a t i o n o f d e a d
a s s i - ~ n m e n t s a l s o is e x p e c t e d t o P r o v i d e m u c h n e e d e d c o m p a c t i o n °
B,~ assi~.Inin~ u s e r s p e c i f i e d n a m e s to B D F L b l o c k s , ~ n d h e n c e t o ~a r a~:~ r a;,q,s i n t h e ~ e n e r a t e d ~ r o ~ r a m s ( a t P r e s e n t t h e s e r, a m e s
a r e ~ e n e r a t e d a u t o m a t i c a l I~:~), t h e
readabil:i.t~_~ c,~n b e i m p r o v e d f u r t h e r ~
T h e u s e o f d a t a b a s e c u r r e n c ~ : ~ - f l o w anal~:~sis o n t h e l i n e s o f d a t a - f l o w anal~:~sis [ s e e
e ° ~ ° A H U 7 7 ] is ex~,,ected to si~:~nificantl~:~
i m P r o v e t h e Pro~:~ram e f f i c i e n c w ~
T h e t r a n s f o r m a t i o n s [ I P T C 7 6 ] a t t h e B D F L
l e v e l ~'an b e m a d e t o c o n v e r t t h e
s p e c i f i c a t i o n s i n t o a f o r m t h a t l e a d s t o e f f i c i e n t o b j e c t c o d e w i t h o u t aPfec.ti,~.:~ t h e m e a n i n ~ o f t h e s ~ . e c i f i c ~ t i o n .
[ f o r e a c h s e t in P A R T - P R O D - S T - S C H w i t h s a m e P A R T - N O
d o
[ u s i n ~ r e c o r d in F R E E - S T O C K S w i t h P A R T - N O ::: P A R T - N O o f
P A R T - P R O D - S T - S C H d o
[ i n i t i a l
( Q T Y o f F R E E - S T O C K S ) - - > F R E E - Q T Y ;
f o r e a c h r e c o r d in P A R T - P R O D - S T - S C H in ascendin~:~ S T A R T - D A T E d o
[ i f ( F R E E - Q T Y > Q T Y o f
P A R T - P R O D - S T - S C H ) t h e n
( F R E E - Q T Y ... Q T Y o f
P A R T - P R O D - S T - S C H ) - - > n e w F R E E - Q T Y ; () - - > Q T Y ;
r e t u r n Q T Y ; r e t u r n n e w F R E E - Q T Y e l s e
(0) - - > n e w F R E E - Q T Y ; ( Q T Y o f P A R T - P R O D - S T - S C H .-.
F R E E - Q T Y ) - - > Q T Y ; r e t u r n Q T Y ;
r e t u r n n e w F R E E - Q T Y
f : i ] - - > QTY , n e w F : R E E - Q T Y ; r e t u r n s e t < P A R T - N O : P A R T - N O o'~ ~
P A R T - P R O D - S T - S C H , Q T Y : Q T Y ,
S T A R T - D A T E : S T A R T - D A T E o 9 P A R T - P R O D - S T - S C H > o d ] - - > P A R T - R E O - S U B S E T ;
r e t u r n P A R T - R E O - S U B S E T o d ] - - > P A R T - R E Q - S U B S E T ; r e t u r n s e t P A R T - R E Q - S U B S E T o d ]
Fis.~.7: A n e x a m ~ l e o f B D F L s m e c i f i c a t i o n ~
6. C O N C L U S I O N S
In t h i s P a p e r a ~,~owerf'ul l a n g u a g e t o w r i t e
t h e s P e c i f i c a t i o n s o f b u s i n e s s d a t a
P r o c e s s i n . ~ a c t i v i t i e s ai..n v e r , hi~ih l e v e l is d e f i n e d ° T h e l a n ~ u a ~ e is v e r s a t i l e e n o u g h t o b e o f u s e in s P e c i f ~ i n ~ m o s t o f t h e d a t a P r o c e s s i n ~ a P P l i c a t i o n s t h a t a r e o f i n t e r e s t t o b u s i n e s s o r _ ~ a n i s a t i o n s .
S i n c e w e a i m e d a t P rovidin~.l a I an~ua~.~e
t h a t e v e ~ a n o n - ~ ro_~ r a m m i n ~ u s e r c n n e e s i l w l e a r n , m a n w a d v a n c e d i s s u e s in s w s t e m d e s i g n , e..~ • e x c e p t i o n h a n d l in~:~, i n t e ~ r i t ~ c h e c k i n g , r e e o v e r ~ e t c . h a v e n o t b e e n e x ~ , l o r e d ~ e t °
T h e u s e o f D B M S h a s e l i m i n a t e d t h e n e e d f o r a n e x p l i c i t desis~n o f t h e d a t a b a s e for' t h e
a ~ l i c a t i o n . T h e f e a s i b i l i t : ~ o f t h e
l a n ~ u a . ~ e a n d i t s c o n v e r s i o n t o a P r o c e d u r a l d e s c r i p t i o n h a s b e e n s h o w n b~.~ a c t u a l l ~
d e s i ~ n i n ~ a n d i m P l e m e n t i n ~ t h e t r a n s l a t o r ,
T h e P r o c e d u r a l r e P r e s e n t ~ t l o n o b t a i n e d t h r o u g h a u t o m a t i c t r a n s l a t i o n is s t P r e s e n t n o t v e r ~ e f f i c i e n t a n d w i l l b e n e f i t b ~ h u m a n i n t e r v e n t i o n s ( s a ~ , t o t u n e t h e D B M S ) ° W e a r e , h o w e v e r , c o n f i d e n t t h a t t h e e f f i c i e n c w o f t h e s ~ s t e m w i l l i m p r o v e ~ s o u r u n d e r s t a n d i n ~ o f t h e s ~ s t e m m a t u r e s a n d m o s t c e r t a i n l . w w i t h t h e ~.~vai l a b i I it.~ o f d a t a - f l o w m a c h i n e s .
A C K N 0 W L E D G E M E N T S : T h e a u t h o r s ~.~ f a t e f u l I~
ackr, o w l e d ~ e t h e h e l p ~ i v e n b ~ P r o f .
K ° V . N o r i in i m p i e m e n t in~.:~ t h e ~ r o ~ r a m ~ e n e r a t o r . P r a b h a k a r a n d H a r i s h K a r n i c k a r e r e s p o n s i b l e f o r m a n ~ s u ~ e s t i o n s t h a t m a d e t h i s r e p o r t P r e s e n t a b l e ° E v e n t h o u ~ h w e h a v e n o t b e e n a b l e t o a c c o m o d a t e a l l s u . ~ e s t i o n s a n d a d v i c e s ~ i v e n b~:~ t h e
r e f e r e e s , t h e i r h e l p is ~ r a t e f u I I,~
a c k n o w l e d g e d °
R E F E R E N C E S
[ A G P 7 8 ] A r v i n d , K . P . G o s t e l o w a n d W . P l o u f f e , A n as,~nchror, o u s P r o . ~ r a m m i n ~ Lan~ua~.~e a n d C o m P u t i n ~ M a c h i n e * , T e c h P e P . 1 1 4 A , D e P t . 6 f I n f o ° a n d C o m P . S c . , U C I , I r v i n e ( D e c . 7 8 ) .
[ A G P 8 0 ] S a m e m s [ A G P 7 8 ] , r e v i s e d in ( J u n e 8 0 ) .
[ A H U 7 7 ] A h o , A . V . a n d J . D . U l l m a n ,
P r i n c i p l e s o f C o m ~ i l e r Desi~.ln,
A d d i s o n - W e s l e M , R e a d i n g , M a ° , 1 9 7 7 .
[ B A C 7 8 ] B a c k u s , J. C a n P r o ~ J r a m m i n ~ b e L i b e r a t e d f r o m t h e v o n N e u m a n n S t ~ l e ? A F u n c t i o n a l S t ~ l e a n d i t s A l ~ e b r a o f P r o g r a m s . C o m m . A C M 2 1 , 8 ( A u ~ . 7 8 ) °
[ C L I F 7 1 ] C l i g t o n , H . D ~ , D a t a P ~,ecessin~:~
S~:~stem Desi~;~n, B u s i n e s s B o o k
L i m i t e d , 1 9 7 1 ~
[ D E N 7 3 ] D e n n i s , J,,B., F i r s t V e ~ ' s i o n o 9 ~!~
Dat~i~ F l e w P r o c e d u r e L an~,:~u a~.~e • Com~:,.
S t r u c t u r e ~i~rouP mel~ae 9 3 , L, a b ~ 9e~" Com~,. s c ~ , C s m b r i d ~ e , M a s s a c h u s e t t s ( N o v ~ 7 3 ) °
[ H H K W 7 7 ] H a m m e r , M ° , W ~ G ~ H o w e , V . J ~ K r u s l ~ i l
a n d I ~ W l ~ d ~ w s k ~ , A Vers~ Hitch L e v e l
P ~ ' o ~ r ~ m m i n ~ L a n ~ u a ~ e f'o~" Dat~, ~ P r o c e s s i n ~ A P P I i c ~ t i o n s , C o m m o A(]M 2 0 , 1 1 ( N o v °
7 7 ) °
[ I P T C 7 6 ] S t ~ : ~ n d i s h , T , A o , D ~[]~ Ho~'.'imar, ~ D ~ F . K i b l e ~ " ~Ind J , H ~ N e i ~ h b o ~ ' s , T h e l ~ ' v i n e P~'o~J~ram T ~ ' a n s f o r m a t i o n Catalo~'.~ue, De~.,t.~ o F I n f e . a n d C o m m 0 S o . , U C I , l ~ . v i n e ( J s n ~ 1 9 7 6 ) .
[ M A L 8 1 ] M~lhotr~i~, V . M . , A D o t ~ - F l o w B a s e d
S P e c i r i c m t i o n L s o.~:~ u a ~.~e ~ n d i t s
T ~ . a n s l ~ t o r f'oY" B u s i n e s s APril i c ~ t i o n s ,
P h 0 D ~ T h e s i s , C o m ~ . S o . P~'o~:~ ,
I n d i g e n It, s t . o r T e c . h . , Kan~.,.i ~', A u.~ • 8 1 ~
[ P P S 7 9 ] P r'..~wes, N . S ° , A . P n u e l i a n d
S • S h ~ s t r,.~, U s e o f a~ N o n P r o c e d u r ~ l S e e c i f i c . ' a t i o n L ~ n.~ u ~.~..4 e a n d A s s o c i a t e d
P r o.~ r ~.~m G e n e r ~ t o r i n S o f t w a r e