Date: Mon, 15 Mar 2010 10:52:18 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Sorting non-existent file oddity
In-Reply-To: <F84BFD8E4328F6429C70846EBE1E4224028D0760@AVN3VS021.ees.hhs.gov>
Content-Type: text/plain; charset=ISO-8859-1
I may be odd to you, but SAS does tell you what happened.
WARNING: Data set WORK.ORIGINALS was not replaced because this step was
stopped.
You can use FILEEXIST("filename") and FILEVAR= infile options, in a
single data step, to create a zero observations data set when the
INFILE does not exist. The key is to determine the file does not
exist before trying to open and read from it.
On 3/15/10, Nair, Neal K (ACF) <neal.nair@acf.hhs.gov> wrote:
> SAS-L colleagues:
>
>
>
> I am puzzled by an oddity I observed while executing a SAS program.
> Here is the background: I read a text file to create SAS (Work) data set
> (called ORIGINALS) and then sorted it to eliminate duplicate records. In
> this instance the input file for creating the SAS data set was
> non-existent (see the SAS log below). Yet at the next step, which was
> the program for sorting it, the SAS log shows that some number of
> records were sorted from the non-existent file (ORIGINALS). SAS log
> below:
>
>
>
> ERROR: Physical file does not exist, C:\YDR\MATCHPROJ\MDA200904.TXT.
>
> NOTE: The SAS System stopped processing this step because of errors.
>
> WARNING: The data set WORK.ORIGINALS may be incomplete. When this step
> was stopped there were 0 observations and 6
>
> variables.
>
> WARNING: Data set WORK.ORIGINALS was not replaced because this step was
> stopped.
>
> NOTE: DATA statement used (Total process time):
>
> real time 0.00 seconds
>
> cpu time 0.00 seconds
>
>
>
>
>
>
>
>
>
> NOTE: There were 255 observations read from the data set WORK.ORIGINALS.
>
> NOTE: 0 observations with duplicate key values were deleted.
>
> NOTE: The data set WORK.ORIGINAL has 255 observations and 6 variables.
>
> NOTE: PROCEDURE SORT used (Total process time):
>
> real time 0.01 seconds
>
> cpu time 0.01 seconds
>
>
>
> Could anyone enlighten me on this apparent oddity?
>
> I should also mention that the Work file ORIGINALS is created for each
> month of a year. I use macro parameters, which I assign for each month
> and change from month to month to run the program for several months at
> a stretch. My suspicion here is that even though the input file for a
> given month is non-existent, for the sorting and subsequent analyses the
> SAS system takes the previous month's Work data file (ORIGINALS), which
> is an oddity (in my opinion).
>
>
>
> I would very much appreciate your help in this.
>
> Thanks.
>
> Neal
>
>
>
|