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 13:42:36 -0700
Reply-To:   "Pardee, Roy" <pardee.r@GHC.ORG>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Pardee, Roy" <pardee.r@GHC.ORG>
Subject:   Re: Multi-file INFILE statement only honors FIRSTOBS option for first file processed?
Comments:   To: "data _null_;" <datanull@GMAIL.COM>
In-Reply-To:   A<7367b4e20708080957j5db4bdfby34b0a682dd5f6a8f@mail.gmail.com>
Content-Type:   text/plain; charset="us-ascii"

Awesome cool--thanks! This set me up perfectly to do the multiple-file-format-versioning stuff I needed next:

filename oic 'N:\oncology_infusion_center\IP401B-*.txt' ; data s.drop_me ; retain version 1 ; infile oic eov = new_file ; input @ ;

if _n_ = 1 or new_file then do ; * If this file has account number, its a version 2. ; if index(lowcase(_infile_), 'acct') > 0 then version = 2 ; else version = 1 ; new_file = 0 ; delete ; end ;

select (version) ; when (1) do ; input @1 consumno $char8. @12 attending_provider $char30. @43 service_date date11. @55 cpt4_description $char40. @96 cpt4 $char6. @103 qty $char5. @109 price nlmny11.2 ;

end ; when (2) do ; input @1 consumno $char8. @12 acct $char9. @22 attending_provider $char30. @53 service_date date11. @65 cpt4_description $char40. @106 cpt4 $char6. @113 qty $char5. @119 price nlmny11.2 @131 icd9 $char6. @138 idc9_description $char50. ;

end ; otherwise do ; put "ERROR: Unexpected value of version!!!" ; end ; end ;

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of data _null_; Sent: Wednesday, August 08, 2007 9:57 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Multi-file INFILE statement only honors FIRSTOBS option for first file processed?

INFILE option EOV is used to detect the presence of a "new" file when reading concatenated files with wild card infile.

filename in '.\*.log'; data work.test; infile in eov=eov length=l; if _n_ eq 1 or eov eq 1 then do; input; eov = 0; delete; end; else do; input line $varying200. l; output; end; run;


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