data chkfile;                                                
   length fname $40;                                         
   if _N_=1 then do;                                       
      context=0;                                           
      rc=termout('Enter input data filename:');          
      inp=termin('==> ');                                
      fname=findfile(inp,context);                      
      if fname=' ' then do;                                
         rc=termout('The data file '||left(trim(inp))||
            ' was not found.');                             
         rc=termout('Terminating the DATA step.');       
         stop;                                               
      end;                                                   
   end;                         
   infile dummy filevar=fname;
   input x y;                   
   output;                      
run;