139 lines
4.6 KiB
Plaintext
139 lines
4.6 KiB
Plaintext
|
IDENTIFICATION DIVISION.
|
|||
|
PROGRAM-ID. vehic.
|
|||
|
AUTHOR. OD.
|
|||
|
***---------------------------------------------------------------
|
|||
|
ENVIRONMENT DIVISION.
|
|||
|
INPUT-OUTPUT SECTION.
|
|||
|
FILE-CONTROL.
|
|||
|
SELECT ARTICLES ASSIGN TO "$fichier"
|
|||
|
ORGANIZATION IS INDEXED
|
|||
|
RECORD KEY IS MTRCL
|
|||
|
ALTERNATE RECORD KEY IS NO-SMN WITH DUPLICATES
|
|||
|
ALTERNATE RECORD KEY IS RSLT WITH DUPLICATES
|
|||
|
FILE STATUS VAL-ERREUR.
|
|||
|
***---------------------------------------------------------------
|
|||
|
DATA DIVISION.
|
|||
|
FILE SECTION.
|
|||
|
FD ARTICLES.
|
|||
|
* STRUCTURE FOURNIE DANS L'EXERCICE
|
|||
|
01 VHCL.
|
|||
|
05 INDICATIF.
|
|||
|
10 MTRCL PIC X(8).
|
|||
|
10 NO-SMN PIC 99.
|
|||
|
05 FILLER PIC X(8).
|
|||
|
05 RSLT OCCURS 7.
|
|||
|
10 KM PIC 9(4) VALUE ZERO.
|
|||
|
10 FRS PIC 9(4)V99 VALUE ZERO.
|
|||
|
WORKING-STORAGE SECTION.
|
|||
|
* VALEUR DE L'ERREUR POTENTIELLE DE TRAITEMENT DU FICHIER
|
|||
|
77 VAL-ERREUR PIC 99 VALUE ZERO.
|
|||
|
* VALEUR ENTR<54>E POUR LE CHOIX DU MENU
|
|||
|
77 VAL-MENU PIC X.
|
|||
|
88 MENU-O VALUE "O" "o".
|
|||
|
88 MENU-N VALUE "N" "n".
|
|||
|
88 MENU-UN VALUE "1".
|
|||
|
88 MENU-DX VALUE "2".
|
|||
|
88 MENU-TRS VALUE "3".
|
|||
|
88 MENU-QTR VALUE "4".
|
|||
|
88 MENU-QTT VALUE "0".
|
|||
|
* LA SEMAINE !
|
|||
|
01 SEMAINES.
|
|||
|
05 FILLER PIC X(8) VALUE "LUNDI".
|
|||
|
05 FILLER PIC X(8) VALUE "MARDI".
|
|||
|
05 FILLER PIC X(8) VALUE "MERCREDI".
|
|||
|
05 FILLER PIC X(8) VALUE "JEUDI".
|
|||
|
05 FILLER PIC X(8) VALUE "VENDREDI".
|
|||
|
05 FILLER PIC X(8) VALUE "SAMEDI".
|
|||
|
05 FILLER PIC X(8) VALUE "DIMANCHE".
|
|||
|
01 SEM-T REDEFINES SEMAINES.
|
|||
|
05 JOURS PIC X(8) OCCURS 7.
|
|||
|
77 ITERATION PIC 9 VALUE 1.
|
|||
|
* SAISIE DE L'UTILISATEUR POUR LE MATRICULE
|
|||
|
77 SAIS-MTRCL PIC X(8) VALUE "0000XX00".
|
|||
|
* SAISIE DE L'UTILISATEUR POUR LE NUMERO DE SEMAINE
|
|||
|
77 SAIS-NO-SMN PIC 99 VALUE 00.
|
|||
|
* SAISIE DE L'UTILISATEUR POUR LE NOMBRE DE KILOMETRES
|
|||
|
77 SAIS-KM PIC 9(4) VALUE ZERO.
|
|||
|
* SAISIE DE L'UTILISATEUR POUR LES FRAIS
|
|||
|
77 SAIS-FRS PIC 9(4)V99 VALUE ZERO.
|
|||
|
* UTILISATION D'UN ESPACE VIDE POUR L'ENREGISTREMENT
|
|||
|
77 SAIS-VIDE PIC X(8) VALUE SPACE.
|
|||
|
***---------------------------------------------------------------
|
|||
|
PROCEDURE DIVISION.
|
|||
|
*
|
|||
|
* SECTION PRINCIPAL, APPEL<45>E PROGRAMME
|
|||
|
*
|
|||
|
PROGRAMME SECTION.
|
|||
|
INIT.
|
|||
|
OPEN I-O ARTICLES.
|
|||
|
DISPLAY VAL-ERREUR.
|
|||
|
CORPS.
|
|||
|
PERFORM MENU-DPRT UNTIL MENU-N.
|
|||
|
FIN.
|
|||
|
CLOSE ARTICLES.
|
|||
|
DISPLAY "PROGRAMME TERMINE !".
|
|||
|
STOP RUN.
|
|||
|
|
|||
|
*
|
|||
|
* PERMET L'AFFICHAGE DU MENU
|
|||
|
*
|
|||
|
MENU SECTION.
|
|||
|
MENU-DPRT.
|
|||
|
DISPLAY "PROCEDER <20> UN TRAITEMENT ? (o/n) : "
|
|||
|
WITH NO ADVANCING.
|
|||
|
ACCEPT VAL-MENU.
|
|||
|
IF MENU-O THEN
|
|||
|
PERFORM MENU-AFFICHE.
|
|||
|
|
|||
|
MENU-AFFICHE.
|
|||
|
DISPLAY "(1) - CONSULTER UN ARTICLE DONNE".
|
|||
|
DISPLAY "(2) - AJOUT D'UN ARTICLE".
|
|||
|
DISPLAY "(3) - CALCUL DU PRIX DE REVIENT".
|
|||
|
DISPLAY "(4) - SEMAINE O<> PLUS ROUL<55>".
|
|||
|
DISPLAY "(0) - QUITTER".
|
|||
|
DISPLAY "VOTRE CHOIX : " WITH NO ADVANCING.
|
|||
|
ACCEPT VAL-MENU.
|
|||
|
IF MENU-UN THEN PERFORM CONSULTATION
|
|||
|
ELSE IF MENU-DX THEN PERFORM AJOUT
|
|||
|
ELSE IF MENU-TRS THEN PERFORM CALCUL
|
|||
|
ELSE IF MENU-QTR THEN PERFORM ROULE
|
|||
|
ELSE IF MENU-QTT THEN PERFORM FIN.
|
|||
|
|
|||
|
*
|
|||
|
* PERMET LA CONSULTATION D'UN ARTICLE
|
|||
|
*
|
|||
|
CONSULTER SECTION.
|
|||
|
CONSULTATION.
|
|||
|
|
|||
|
*
|
|||
|
* PERMET L'AJOUT D'UN ARTICLE
|
|||
|
*
|
|||
|
AJOUTER SECTION.
|
|||
|
AJOUT.
|
|||
|
DISPLAY "NUMERO DE SEMAINE : " WITH NO ADVANCING.
|
|||
|
ACCEPT NO-SMN.
|
|||
|
DISPLAY "IMMATRICULATION : " WITH NO ADVANCING.
|
|||
|
ACCEPT MTRCL.
|
|||
|
PERFORM AJOUT-SEM UNTIL ITERATION EQUAL TO 8.
|
|||
|
WRITE VHCL.
|
|||
|
AJOUT-SEM.
|
|||
|
DISPLAY JOURS(ITERATION).
|
|||
|
DISPLAY "KILOMETRAGE : " WITH NO ADVANCING.
|
|||
|
ACCEPT KM(ITERATION).
|
|||
|
DISPLAY "FRAIS : " WITH NO ADVANCING.
|
|||
|
ACCEPT FRS(ITERATION).
|
|||
|
ADD 1 TO ITERATION.
|
|||
|
|
|||
|
*
|
|||
|
* PERMET LE CALCUL DU PRIX DE REVIENT KILOM<4F>TRIQUE DEPUIS LE D<>BUT
|
|||
|
* D'ANN<4E>E
|
|||
|
*
|
|||
|
CALCULER SECTION.
|
|||
|
CALCUL.
|
|||
|
|
|||
|
*
|
|||
|
* PERMET DE TROUVER LA SEMAINE O<> UN V<>HICULE A LE PLUS ROUL<55>
|
|||
|
*
|
|||
|
ROULER SECTION.
|
|||
|
ROULE.
|