LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 8 Aug 2007 12:33:18 -0400
Reply-To:     Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:      Re: Multi-file INFILE statement only honors FIRSTOBS option for
              first file processed?

Another idea: just read it and add something like:

if _error_ then delete;

Gerhard

On Wed, 8 Aug 2007 09:22:41 -0700, Pardee, Roy <pardee.r@GHC.ORG> wrote:

>Hey All, > >I've got a bunch of text files I need to read in, each of which has a >'header row' of var names that I need sas to skip over. So I wrote the >following: > >* ================================== ; >filename oic 'N:\oncology_infusion_center\IP401B-*.txt' ; > >data gnu ; > infile oic firstobs = 2 ; >input > @1 consumno $char8. > @12 acct $char9. > @22 attending_provider $char30. > @53 service_date date11. > @113 quantity 3.0 ><etc.> >; >run ; >* ================================== ; > >This works just fine if I edit that filename statement so it only refers >to a single file. But if I leave it as written, I see things like: > > NOTE: Invalid data for service_date in line 1985 53-63. > NOTE: Invalid data for quantity in line 1985 113-115. > NOTE: Invalid data errors for file OIC occurred outside the printed >range. > NOTE: Increase available buffer lines with the INFILE n= option. > >(I'm confused by the literal data that sas prints out around those >NOTEs--some of it looks like actual data, and some of it looks like the >header row.) > >I've tried removing the specific file complained about & re-running, >only to have SAS start complaining about a different file. This leads >me to the theory that the FIRSTOBS = 2 option is only being applied to >the first file. > >Is that plausible? And more to the point--how do I get sas to skip line >1 of every file? > >Many thanks in advance! > >-Roy > >Roy Pardee >Research Analyst/Programmer >Group Health Center For Health Studies (Cancer Research Network) >(206) 287-2078 >Google Talk: rpardee


Back to: Top of message | Previous page | Main SAS-L page