Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. menuadh.
- file-control.
- select f-adh assign "data\adherent.dat" organization indexed
- access mode is dynamic
- record key CodeE.
- select f-pret assign "data\pret.dat" organization indexed
- access mode is dynamic
- record key is clef = DatePret, RefS, CodeA
- alternate key RefS duplicates
- alternate key CodeA duplicates.
- select f-hist assign "f-hist.dat" organization record sequential.
- data division.
- file section.
- fd f-adh.
- 1 adherent.
- 2 CodeE pic x(5).
- 2 NomE pic x(30).
- 2 PrenomE pic x(30).
- 2 AdrE pic x(150).
- fd f-pret.
- 1 pret.
- 2 DatePret pic 9(8).
- 2 RefS pic x(5).
- 2 CodeA pic x(5).
- 2 DateRetour pic 9(8).
- fd f-hist.
- 1 hist.
- 2 DateOp pic 9(8).
- 2 Login pic x(10).
- 2 CodeOp pic x(1).
- 2 NomFich pic x(20).
- 2 ClePrim pic x(10).
- 2 CodeEt pic x(1).
- working-storage section.
- 01 choix pic 99.
- 01 v-fin-f-adh pic x value 'N'.
- 88 fin-f-adh value 'O' false 'N'.
- 01 a pic x(5).
- 01 bool pic 9.
- 01 datecour pic 9(8).
- 01 amende pic 999.
- 01 nbretard pic 99.
- linkage section.
- 01 type-util pic 99.
- 01 slogin pic x(10).
- screen section.
- 01 a-plg-titre.
- 02 blank screen.
- 02 line 1 col 25 value '###############################'.
- 02 line 2 col 25 value '# #'.
- 02 line 3 col 25 value '# GESTION DES ADHERENTS #'.
- 02 line 4 col 25 value '# #'.
- 02 line 5 col 25 value '###############################'.
- 01 a-plg-menu2.
- 02 line 8 col 2 value '#1 : Consulter une fiche'.
- 02 line 10 col 2 value '#2 : Ajouter une fiche'.
- 02 line 12 col 2 value '#3 : Modifier une fiche'.
- 02 line 14 col 2 value '#4 : Calculer une amende'.
- 02 line 16 col 2 value '#0 : Retour au menu'.
- 01 a-plg-menuadmin.
- 02 line 8 col 2 value '#1 : Consulter une fiche'.
- 02 line 10 col 2 value '#2 : Ajouter une fiche'.
- 02 line 12 col 2 value '#3 : Modifier une fiche'.
- 02 line 14 col 2 value '#4 : Calculer une amende'.
- 02 line 16 col 2 value '#5 : Supprimer une fiche'.
- 02 line 18 col 2 value '#0 : Retour au menu'.
- 01 s-plg-menuchoix.
- 02 line 23 col 30 value 'Entrez la valeur de votre choix..'.
- 02 s-choix pic zz to choix required auto.
- 01 a-bug.
- 02 line 20 col 20 value 'Mauvaise entree'.
- procedure division using type-util, slogin.
- open i-o f-adh
- open i-o f-pret
- open extend f-hist
- display a-plg-titre
- evaluate type-util
- when 0 display a-plg-menuadmin
- when 2 display a-plg-menu2
- when other display a-bug
- end-evaluate
- display s-plg-menuchoix
- accept choix
- perform until(choix = 0)
- evaluate choix
- when 1 perform consult-adh
- compute choix = 0
- when 2 perform ajout-adh
- compute choix = 0
- when 3 perform modif-adh
- compute choix = 0
- when 4 perform calcul-amende
- compute choix = 0
- when 5 perform supp-adh
- compute choix = 0
- when 0 continue
- when other display a-bug
- end-evaluate
- end-perform
- close f-adh
- close f-pret
- close f-hist
- goback.
- ajout-adh.
- display 'Code de l''adherent?'
- accept CodeE of adherent
- display 'Nom de l''adherent ?'
- accept NomE of adherent
- display 'Prenom de l''adherent ?'
- accept PrenomE of adherent
- display 'Adresse de l''adherent ?'
- accept AdrE of adherent
- write adherent
- move 'A' to CodeOp
- move 'adherent.dat' to NomFich
- move 'R' to CodeEt
- move CodeE to ClePrim
- move slogin to Login
- write hist
- display 'Adherant ajoute'.
- .
- consult-adh.
- display 'Code de l''adherent ?'
- accept CodeE of adherent
- start f-adh key = CodeE
- invalid key
- display 'Adherent inconnu'
- display 'Tapez Entree pour continuer'
- accept choix
- not invalid
- read f-adh
- display NomE of adherent
- display PrenomE of adherent
- display AdrE of adherent
- display 'Tapez Entree pour continuer'
- accept choix
- end-start
- .
- modif-adh.
- display 'Code de l''adherent ?'
- accept CodeE of adherent
- start f-adh key = CodeE
- invalid key
- display 'Adherent inconnu'
- display 'Tapez Entree pour continuer'
- move 'E' to CodeEt
- accept choix
- not invalid
- display 'Nouveau nom de l''adherent?'
- accept NomE of adherent
- display 'Nouveau prenom de l''adherent?'
- accept PrenomE of adherent
- display 'Nouvelle adresse de l''adherent?'
- accept AdrE of adherent
- display 'Tapez Entree pour continuer'
- accept choix
- rewrite adherent
- move 'R' to CodeEt
- end-start
- move 'adherent.dat' to NomFich
- move CodeE to ClePrim
- move slogin to Login
- write hist
- .
- supp-adh.
- display 'Code de l''adherent ?'
- accept CodeE of adherent
- start f-adh key = CodeE
- invalid key
- display 'Adherent inconnu'
- move 'E' to CodeEt
- not invalid
- display 'Voulez-vous vraiment supprimer l''adherent?'
- display '(0 : non, 1 : oui)'
- accept choix
- evaluate choix
- when 0 display 'Adherent non supprime'
- move 'E' to CodeEt
- when 1 delete f-adh
- display 'Adherent supprime'
- move 'R' to CodeEt
- when other display 'Adherent non supprime'
- end-evaluate
- display 'Appuyez sur Entree pour continuer'
- accept choix
- end-start
- move 'adherent.dat' to NomFich
- move CodeE to ClePrim
- move slogin to Login
- write hist
- .
- calcul-amende.
- move function current-date(1:8) to datecour
- move 0 to amende
- move 0 to nbretard
- move 0 to bool
- display 'Code adherent ?'
- accept CodeA of pret
- move CodeA to a
- start f-pret key = CodeA
- invalid key
- display 'Adherent inconnu'
- not invalid
- read f-pret next
- end move 1 to bool
- end-read
- perform until(bool = 1)
- if(DateRetour = '00000000' AND CodeA = a) then
- compute nbretard = function integer-of-date(datecour) -
- function integer-of-date(DatePret)
- if(nbretard > 21) then
- compute nbretard = nbretard - 21
- compute amende = amende + (nbretard * 0.5)
- end-if
- end-if
- read f-pret next
- end move 1 to bool
- end-read
- end-perform
- end-start
- display 'Valeur de l''amende :'
- display amende
- display 'Tapez Entree pour continuer'
- accept choix
- .
- End program menuadh.
Add Comment
Please, Sign In to add comment