Date: Thu, 14 Nov 1996 10:43:03 -0800
Reply-To: gxx18300@ggr.co.uk
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Bruce Rogers <gxx18300@GGR.CO.UK>
Organization: Medical IR, Glaxo Wellcome
Subject: Re: Empty seq file in MVS
Roger Fahy GBSLAC ISI Dev Sup(51824) wrote:
>
> I'm sure I've seen this before but I can't find it in my backlog and time is
> running out....so
>
> My customer is reading a flat sequential file (this is MVS by
> the way) to read in info to use later in the program. Normally this flat file
> has data in it, today it has nothing and his job failed.
>
> Is there an easy way in SAS to determine that this file is empty?
>
> If not directly in SAS any other ways?
Assuming you're reading it in SAS with a data step, you can use the end=
flag to check for end-of-file BEFORE the first input statement. e.g.
DATA .. ;
infile ... END=EOF;
if _n_ = 1 & eof then do ;
put 'Empty file encountered !!!!' ;
stop;
end;
input .... ;
HTH
Bruce
|