Date: Thu, 7 Aug 2003 19:39:17 -0500
Reply-To: Kevin Myers <KevinMyers@austin.rr.com>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kevin Myers <WHMyers@CABLEONE.NET>
Subject: Re: infile stopover option
Content-Type: text/plain; charset="iso-8859-1"
Just wanted to point out a potentially misleading statement. See below...
----- Original Message -----
From: "Jonathan Siegel" <jmsiegel@YAHOO.COM>
Newsgroups: bit.listserv.sas-l
To: <SAS-L@LISTSERV.UGA.EDU>
Sent: Thursday, August 07, 2003 7:24 PM
Subject: Re: infile stopover option
> On Fri, 1 Aug 2003 13:23:13 -0700, Tom S <thomas.sarosky@ADVANCEPCS.COM>
> wrote:
>
> I am wondering if you are trying to use these functions for a differen
> purpose from what they are intended to do.
>
> These functions affect what SAS should do if it reads in data and
encounters
> an end-of-line while it's in the middle of what (according to the program)
> is supposed to be the next line. Does it set all following variables to
> missing? Does it stop? There are various options to set what it does.
>
> However, because you added the lrecl=2000 option, you padded the line so
> that reading the first 1566 characters never gets to the end. The various
> 'OVER' options will never come into play.
Not necessarily true. If list input is being used (as is typical when using
the DSD option), then the xxxover options will still come into play any time
that all input values can't be read from a single data record.
>
> It sounds like what you really want to do is to get SAS to do something
when
> it encounters a missing value (columns that contain no data). This is a
> different problem. Columns with no data aren't a problem to SAS and SAS
will
> happily read them, assign them missing values, and keep going.
>
> What you'll need to do is to create your own logic to deal with the
problem.
> For example, if you want the data step to stop, you could do something
like
> this:
>
> data RIa;
> infile in1 dsd lrecl=2000;
> input VAR1..... VAR29 $1563 VAR30 1564-1566;
> if VAR30 = . then do;
> put "WAR" "NING: Missing value of VAR30 found " _n_=;
> stop;
> end;
> run;
>
> Jonathan Siegel
>
> >I'm reading raw data from a client's text file arranged in columns. I
> >am using the STOPOVER option on the infile statement.
> >
> >data RIa;
> > infile in1 stopover dsd lrecl=2000;
> > input VAR1..... VAR29 $1563 VAR30 1564-1566;
> >run;
> >
> >
> >The raw data file has some missing values for VAR30 in columns
> >1564-1566. Now, according to STOPOVER option, I should get an error
> >if these columns contain no data. However, I do not get an error and
> >all data is read in just fine. My question is WHY? Is there some
> >type of end-of-record character which I can't see that SAS is using?
> >When I try to create my own test file with missing data in the last
> >colum, I get an error as expected with the STOPOVER option.
> >
> >I know I should be using the MISSOVER or TRUNCOVER, but this has me
> >baffled why it works using STOPOVER.
|