/* EXERCICE 1 */

data datea;
	infile '/folders/myfolders/intro_SAS/fichiers/sas-controle-01-18-19-b.txt';
	input x1 :mmddyy10. x2 :yymmdd10. x3 date9.  x4 MONYY. ;
;run;

data dateb;
	set datea;
	format date yymmdd10.;
run;

proc print data=dateb;
;run;

/* EXERCICE 2 */

data test;
	input x1 x2 x3 x4 x5 x6;
cards;
1 2 3 4 5 
6 7 8 9 10
11 12 13 14 15 16
16 17 18 19 20
21 22 23 24 25
;run;	

proc print data=test;
;run;
 
 
/* EXERCICE 3 */

data famille (drop=cle i age);
	infile '/folders/myfolders/intro_SAS/fichiers/sas-controle-01-18-19-a.txt';
	retain nom;
	input cle @;
	sum=0;
	if cle=0 then input @11 nom $;
	else do i=1 to cle;
		input @(14+15*(i-1)) age @;
		sum=sum+age;
		if i=cle then ouput;
	end;
;run;