Code : Tout sélectionner
FICHIERP
A R FFichier
A COPAIP 2A
A NUNATI 12A
A DAPAUL L
A
A DMAJ Z
A COSU 1A
FICHERL
A R FFICHIER PFILE(FICHIERP)
A K COPAIP
A K NUNATI
A K DAPAUL
A K DMAJ
Si nous faisons DMAJ = %timestamp, le programme boucle sur cet enregistrement.
Nous avons fait le test de mettre DMAJ = %timestamp(*sys:0) et le programme ne boucle plus, mais nous perdons l'info des 6 derniers chiffres.
Code : Tout sélectionner
ctl-opt OPTION(*NODEBUGIO) ALWNULL(*USRCTL);
dcl-f Fichier usage(*input:*update) keyed;
dcl-ds KeyA likerec(FFichier:*key);
dcl-pi *N;
EàCopaip char(2);
EàNunati char(12);
EàDate date;
EàCodact char(1);
end-pi;
KeyA.Copaip = EàCopaip;
KeyA.Nunati = EàNunati;
KeyA.Dapaul = EàDate;
Setll %kds(KeyA:3) FICHIERL;
dow not %EOF(FICHIERL);
Reade %kds(KeyA:3) FICHIERL;
if %EOF;
leave;
endif;
select;
When EàCodact ='3';
Dapaul = EàDate;
cosu = '0';
when EàCodact ='0';
Cosu = '1' ;
Endsl;
//Dmaj = %timestamp(*SYS);
Dmaj = %timestamp(*SYS:0);
Update FFICHIER;
enddo;
*inlr = *on;
Je vous remercie d'avance pour votre aide