EXECUTE "SET-THOUS ."
EXECUTE "SET-DEC ,"
EXECUTE "DATE.FORMAT"
OPEN "","CONTRAT" TO F.CONTRAT ELSE STOP
OPEN "","DETAILCALCUL" TO F.DETAILCALCUL ELSE STOP
OPEN "","DETAILPREST" TO F.DETAILPREST ELSE STOP
OPEN "","HISTORCUMUL" TO F.HISTORCUMUL ELSE STOP
W_Code = "00775"
GOSUB 10
W_Code = "00774"
GOSUB 10
W_Code = "00782"
GOSUB 10
W_Code = "00788"
GOSUB 10
W_Code = "00805"
GOSUB 10
STOP
10
EXECUTE 'SELECT CONTRAT = "':W_Code:']" AVEC 65 # "O" AND AVEC 1 # "02"'
W_Fin = "F"
LOOP
	READNEXT W_Cle ELSE W_Fin = "V"
WHILE W_Fin = "F"
	READ ENR_CONTRAT FROM F.CONTRAT, W_Cle THEN
		FOR i = 200601 TO 200612	
			DELETE F.DETAILCALCUL, W_Cle:i
			DELETE F.DETAILPREST, W_Cle:i
		NEXT i
		ENR_CONTRAT<65> = "O"
		WRITE ENR_CONTRAT ON F.CONTRAT, W_Cle 
		DELETE F.HISTORCUMUL,W_Cle[1,5]:"2006001"
	END
REPEAT
RETURN
