Date: Tue, 28 May 2002 08:35:21 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Subject: Re: Removing data headers
What you have is not a SAS dataset. Rather, it is the output of a PROC PRINT
The best thing would be to go back and find the SAS dataset which was the
input to the PROC PRINT.
If that is not possible, you can more or less rebuild the dataset from the
file you have. I say more or less because there may be problems such as loss
of precision from rounding.
If you really have 3,000 variables, it is messy because different segments
in the file will present different subsets of the variables, a consequence
of the fact that PROC PRINT "wraps". But I suspect that you really meant
3,000 observations, with a small number of variables.
If this is the case, and if all of the variables are numeric, the following
code should rebuild the dataset.
infile 'name.of.existing.file' missover;
input field1 $ @;
if _infile_ ne '' and compress(field1,'1234567890')='';
input ColA Colb Colc;
The key is to devise some decision rule which differentiates the lines to be
dropped. Here we use a subsetting IF to skip blank lines and those which
start with a non-numeric "word".
On Mon, 27 May 2002 20:37:26 -0700, Chiu <g.wynand@MAILCITY.COM> wrote:
>Hi.I have a data file which has headers like the following.
> The SAS System .....
> Obs ColA Colb Colc .......
> 1 3.2 11 3.2 ........
> 2 ........................
>Beause the data set I am working on has 3000+ variables, these headers
>appear after a hundred lines or so, thus dificult to remove them
>1. Does anyone know of a way of removing these headers?
>2. Are these headers always created automatically in SAS data
> a data file before.
>I am using SAS on unix and accessing it via telnet to my
>university.Therefore cant,or I dont think I can :=),do anything that