The format statement can be applied in most PROCS and you can change it on the fly if desired.
As noted by @WarrenKuhfeld the problem in your first set of code is that you forgot to include the SET statement.
This means that you effectively destroyed your TEST data set and in fact, you would have other issues besides just a missing format.
data projet.test;
INFILE "X:/Projet SAS/data1.txt" firstobs=2 dlm="09"x;
input date_diagnostic : DDMMYY10. date_ex : DDMMYY10. EPL$;
FORMAT date_diagnostic DATE9. date_examen DATE9.;
run;
proc print data= projet.test;
format date_diagnostic mmddyy10. date_examen yearmon7.;
run;
... View more