Date: Mon, 5 Dec 2005 12:01:28 -0800
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: Data transformation question
Content-Type: text/plain; format=flowed
santosh.kothamsu@CHASE.COM wrote back:
>Let me transform my question:
>I have a SAS dataset in the following form.
>cat cycle field pass miss
>dm 5008 bal 10 15
>dm 5009 bal 12 20
>dm 5010 bal 15 9
>ib 5009 chg 5 12
>ib 5010 chg 6 11
>ob 5008 bal 10 15
>ob 5009 bal 12 20
>ob 5010 chg 12 13
>I need to create a SAS dataset in the following form:
>1) grouped by 'cat' and 'field'
>2) ' pass' and 'miss' values spread across as observations for each
>Attached is the template
>cat field p5008 p5009 p5010 m5008 m5009 m5010
>dm bal 10 12 15 15 20 9
>ib chg . 5 6 . 12 11
>ob bal 10 12 . 15 20 .
>ob chg . . 12 . . 13
At this point, I have to speculate that you should NOT transform your data
at all. Your problem looks more and more like a data presentation problem.
I suggest that you look at PROC REPORT or PROC TABULATE to display your
data in the form that you are seeking. try NOT to muck up your data when
all that is needed is a way to display it differently.
If it turns out that someone is holding a gun to your head and forcing you
create this monstrosity for an Excel spreadsheet, then the above suggestion
still works, because you can grab your PROC REPORT or TABULATE output
using ODS and shove it into a handy data set to hurl at PROC EXPORT.
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Donít just search. Find. Check out the new MSN Search!