/*Two options below..*/
/*First option is with Macro variables, you create two macros, start and end and assign values */
%let Start=4;
%let end=98;
Data file1(drop=i);
do i=&start to &end;
Id=i;
output;
end;
run;
/*Second option would be to use your datasource that has two observations in sorted order */
Data source;
ID=4;
output;
ID=98;
output;
run;
Data file2(drop=i);
set source end=eof;
retain start end;
if _n_=1 then start=id;
else end=id;
if eof then do;
do i=&start to &end;
Id=i;
output;
end;
end;
run;