my final version including:
1) read numbers of rows/columns for each data block (dynamic instead of hard coded input of 36/72)
2) read/change for missing values for each data block
filename myfile 'D:\hadcrut3.dat';
data _null_;
infile myfile end=last;
input year $ @;
if length(year)=4 then do;
block+1;
input id nouse maxrow rows $ maxcol cols $ missing $18. ;
call symput(compress(left(trim('missing_value'||put(block,4.)))),
input(substr(missing, 9), 15.));
call symput(compress(left(trim('maxrow'||put(block,4.)))), maxrow);
call symput(compress(left(trim('maxcol'||put(block,4.)))), maxcol);
end;
if last then do;
call symput('countblock', put(block,4.));
end;
run;
%macro read;
data test2(drop=nouse maxrow rows maxcol cols missing);
infile myfile lrecl=32767;
%do i=1 %to &countblock;
%let x_maxcol=&&maxcol&i;
retain year id;
input year id nouse maxrow rows $ maxcol cols $ missing $18. @;
if rows='rows' then do;
do row=1 to maxrow;
input x1-x&x_maxcol;
%do j=1 %to &x_maxcol;
if x&j =&&missing_value&i then x&j=.;
%end;
output;
end;
end;
%end;
run;
%mend read;
%read