Date: Mon, 3 Sep 2001 21:03:24 -0400
Reply-To: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Richard DeVenezia <radevenz@IX.NETCOM.COM>
Organization: MindSpring Enterprises
Subject: Re: Testing for empty file.
"Paul Dorfman" <paul_dorfman@HOTMAIL.COM> wrote in message
> But after a private back-and-forth with Toren I realized that the INPUT
> statement is not needed for achieving the goal. At the same time, I
> that SAS knows whether the file is empty or not already after executing
> INFILE at the *compile* time, which is evident from the following:
I beg to differ on a very technical note...
I do not believe the infile is executed at compile time, but rather in the
gray post-compile pre-run initialization phase.
Consider this macro that generates a data step that takes about 8 seconds to
compile and run (P3-850Mhz).
Consider I have an empty file.
Upon first invocation of the macro, everything w.r.t the eof flag is as you
However, invoke the macro again, and during the compile time save something
to the file. At run time the eof flag shows 0 indicating the infile is not
executed at compile time but rather at runtime or post-compile/pre-runtime.
if 0 then infile 'c:\temp\x.dat' end=eof;
t0 = datetime();
i = int(20000*ranuni(0));
%do i = 0 %to 20000;
if i=&i then put i=;
e = datetime() - t0;
put e= time10.2;