SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

to read flatfiles without header and footer

Reply
Frequent Contributor
Posts: 89

to read flatfiles without header and footer

Hi,

How I can read flat files without reading header and footer,suppose I have an flat files with 100pages,I wanna to read those files into my sas environment ,without reading header and footer.

Super User
Posts: 5,437

Re: to read flatfiles without header and footer

Posted in reply to venkatnaveen

You mean that you file has header and footer, and you want wish to avoid those?

Header is on row 1 i guess, so just if _n_ = 1 then delete;

Footer, if yo are sure that there always is a footer, make use of the END= infile option.

And what do you mean that you have 100 pages in the file, what kind of file is it?

Data never sleeps
Frequent Contributor
Posts: 89

Re: to read flatfiles without header and footer

Thanks

Frequent Contributor
Posts: 89

Re: to read flatfiles without header and footer

thanks

Frequent Contributor
Posts: 81

Re: to read flatfiles without header and footer

Posted in reply to venkatnaveen

Hi.

infile <filename> firstobs=2 will skip the first header record.

Frequent Contributor
Posts: 89

Re: to read flatfiles without header and footer

Posted in reply to damanaulakh88

Thanks

Respected Advisor
Posts: 4,173

Re: to read flatfiles without header and footer

Posted in reply to venkatnaveen

Is there anything in your source which identifies a header and a footer? Eg. a column "record type"?

Frequent Contributor
Posts: 89

Re: to read flatfiles without header and footer

thanks

Ask a Question
Discussion stats
  • 7 replies
  • 477 views
  • 0 likes
  • 4 in conversation