IDENTIFICATION DIVISION.
PROGRAM-ID. VF80.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. VAX-11.
OBJECT-COMPUTER. VAX-11.
SPECIAL-NAMES.
	SYMBOLIC LFX FFX SONN CRX TABX TRD
	  ARE 	 11  13  08   14  10   125.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
	SELECT FILIN	ASSIGN TO ".ECR ".
	SELECT FILOUT	ASSIGN TO ".DES".
DATA DIVISION.
FILE SECTION.
FD	FILIN
	LABEL RECORD IS STANDARD
	RECORD VARYING FROM 1 TO 132
	DEPENDING ON IN-L
	VALUE OF ID IS NFICHIN.
01	ENRFORM.
	02	FILLER		PIC XX.
	02	BACKSLACH	PIC X.
	02	LIGNECR		PIC X(80).
	02	FILLER		PIC X(49).
01	ENRFMS.
	02	FILLER 		PIC X(6).
	02	TRAIDROIT	PIC X.
	02	LIGNFMS		PIC X(80).
	02	FILLER		PIC X(45).
FD	FILOUT
	VALUE OF ID IS NFICHOUT
	LABEL RECORD IS STANDARD.
01	ENROUT		PIC X(80).
*
WORKING-STORAGE SECTION.
77	IN-L		PIC 9(3) COMP.
77	OUT-L		PIC 9(3) COMP.
77	I1		PIC S999  COMP.
77	IAIG		PIC S99   COMP.
77	NBIN		PIC 9999.
77	NBOUT		PIC 9999.
77	FLAGOP		PIC 9	VALUE 0.
77	TEM-ERR		PIC 999.
01	NFICHIN		PIC X(40).
01	NFICHOUT	PIC X(40).
*
PROCEDURE DIVISION.
DEB.
	MOVE 0 TO FLAGOP.
	DISPLAY 
	 " Reprise de .ECR de FormVax ou de .LIS de FMS en .DES FormVax".
	DISPLAY " ".
	MOVE SPACES TO NFICHIN NFICHOUT.
	MOVE ZERO   TO NBOUT.
DEMNOM.
	DISPLAY "Pour sortir du programme faites return".
	DISPLAY "Nom du Fichier en entree  (defaut = .ECR ?)           :"
		WITH NO ADVANCING.
	ACCEPT NFICHIN.
	IF NFICHIN = SPACES GO TO FIN.
	DISPLAY "Nom du Fichier en sortie  (defaut = entree ?)         :"
		WITH NO ADVANCING.
	ACCEPT NFICHOUT.
	IF NFICHOUT = SPACES	MOVE NFICHIN TO NFICHOUT.
OPIN.
	OPEN INPUT 	FILIN.
RETOUR.
	MOVE ZERO TO IAIG.
	MOVE ZERO TO TEM-ERR.
	MOVE SPACES TO ENRFORM.
	MOVE SPACES TO ENROUT.
	READ FILIN  AT END GO TO MINL.
	ADD 1 TO NBIN.
	IF BACKSLACH = "\" GO TO TRAIT-FORMVAX.
	IF TRAIDROIT = TRD GO TO TRAIT-FMS.
	GO TO RETOUR.
TRAIT-FMS.
	MOVE LIGNFMS TO ENROUT.
	GO TO WR-OUT.
TRAIT-FORMVAX.
	MOVE LIGNECR TO ENROUT.
	INSPECT ENROUT REPLACING ALL "-" BY "@".
	GO TO WR-OUT.
WR-OUT.
	IF FLAGOP = 0 PERFORM OPOUT.
	WRITE ENROUT.
	ADD 1	TO NBOUT.
	GO TO RETOUR.
MINL.
	IF FLAGOP = 0 GO TO CLOSIN.
	IF NBOUT > 23 GO TO CLOSIN.
	MOVE SPACES TO ENROUT.
	WRITE ENROUT.
	ADD 1	TO NBOUT.
	GO TO MINL.
CLOSIN.
	CLOSE FILIN.
	IF FLAGOP NOT  = 0 	CLOSE FILOUT.
	DISPLAY "Nombre de Lignes en entree   = " NBIN.
	DISPLAY "Nombre de Lignes Reformatees = " NBOUT.
	DISPLAY SONN.
	GO TO DEB.
FIN.
	STOP RUN.
OPOUT.
	OPEN OUTPUT	FILOUT.
	MOVE 1 TO FLAGOP.
*
