Date: Tue, 2 Feb 2010 16:58:41 -0500
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: data cleaning
Chris,
If you're reading in a txt file (e.g., c:\have.txt), then I think
something like the following will get you what you want:
data want (drop=first_stuff);
infile "c:\have.txt" truncover;
retain id;
informat first_stuff $25.;
format date mmddyy10.;
input first_stuff & type role id2 league percentage;
date=inputn(first_stuff,'mmddyy',10);
if missing(date) then id=first_stuff;
else do;
output;
end;
run;
HTH,
Art
---------
On Tue, 2 Feb 2010 08:14:42 -0800, ChrisG <chris.godlewski@GMAIL.COM>
wrote:
>Hi
>
>I have this kind of data :
>
>1 LN469113 Corp . . . . .
>3 11/25/2005 6 4 171906 0 0
>4 11/25/2005 6 15 171906 0 0
>5 11/25/2005 6 150 171906 0 0
>6 11/25/2005 6 220 171906 0 0
>7 11/25/2005 6 251 364908 0 0
>8 11/25/2005 6 251 909795 0 0
>1 LN469121 Corp . . . . .
>3 11/25/2005 6 4 171906 0 0
>4 11/25/2005 6 15 171906 0 0
>5 11/25/2005 6 150 171906 0 0
>6 11/25/2005 6 220 171906 0 0
>7 11/25/2005 6 251 364908 0 0
>8 11/25/2005 6 251 909795 0 0
>1 LN469125 Corp . . . . .
>3 11/25/2005 6 4 171906 0 0
>4 11/25/2005 6 15 171906 0 0
>5 11/25/2005 6 150 171906 0 0
>6 11/25/2005 6 220 171906 0 0
>7 11/25/2005 6 251 364908 0 0
>8 11/25/2005 6 251 909795 0 0
>
>And i need it that way (i added the name of variables for
>convenience) :
>
>id date type role id2
league percentage
>LN469113 Corp 11/25/2005 6 4 171906 0 0
>LN469113 Corp 11/25/2005 6 15 171906 0 0
>LN469113 Corp 11/25/2005 6 150 171906 0 0
>LN469113 Corp 11/25/2005 6 220 171906 0 0
>LN469113 Corp 11/25/2005 6 251 364908 0 0
>LN469113 Corp 11/25/2005 6 251 909795 0 0
>LN469121 Corp 11/25/2005 6 4 171906 0 0
>LN469121 Corp 11/25/2005 6 15 171906 0 0
>LN469121 Corp 11/25/2005 6 150 171906 0 0
>LN469121 Corp 11/25/2005 6 220 171906 0 0
>LN469121 Corp 11/25/2005 6 251 364908 0 0
>LN469121 Corp 11/25/2005 6 251 909795 0 0
>LN469125 Corp 11/25/2005 6 4 171906 0 0
>LN469125 Corp 11/25/2005 6 15 171906 0 0
>LN469125 Corp 11/25/2005 6 150 171906 0 0
>LN469125 Corp 11/25/2005 6 220 171906 0 0
>LN469125 Corp 11/25/2005 6 251 364908 0 0
>LN469125 Corp 11/25/2005 6 251 909795 0 0
>
>I definitely can't make SAS copy paste the content of a cell in
>another colmun and duplicate it ...
>And i am not a proc iml - user at all by the way
>
>Hopefully someone around here had a similar problem...
>
>Thanks in advance
>Cheers
>CG
|