|
On Mon, Jun 9, 2008 at 9:49 AM, Tom Smith <need_sas_help@yahoo.com> wrote:
> I have a follwoing dataset (with variabiles: serial, CARDIOBS, cARDIOWS,
> CNSBS, CNSWS)
>
> serial CARDIOBS CARDIOWS CNSBS CNSWS
> -------------------------------------------------------------------------
>
> 1001 book/fashion book/fashion gyne/picko gune/picko
> /house /car
> 1002 book fashion/house none picko/rule
> 1004 none house gyne/picko not done
> /car
>
> Need to transpose variables ( or uing SQL ) as below and three new
> variables
> will also be created (serial, details, BS, WS):
>
>
>
> serial details BS WS
> -------------------------------------------------
> 1001 CARDIO
> book yes yes
> fashion yes yes
> house no yes
> CNS
> gyne yes yes
> picko yes yes
> car yes no
> rule no no
>
> 1002 CARDIO
> book yes no
> fashion no yes
> house no yes
> CNS
> gyne none no
> picko none yes
> car none no
> rule none yes
>
> 1004 CARDIO
> book none no
> fashion none no
> house none yes
> CNS
> gyne yes not done
> picko yes not done
> car yes not done
> rule no not done
>
> Thank you very much. Please help me.
> This is from last week post. It was posted in the Friday evening and none
> has come up with a complete correct solution. I hope and pray someone will
> be kind enough to help me this time.
> Thanks a lot from the bottom of my heart.
>
Tom,
Some further questions.
1. How many records and how many variables will be there in the real problem
?
2. Do you have SAS 9, in case of HASH object solution ?
3. The token, RULE, occurs from serial number 1002 onwards. Will the
solution giving the rows with RULE from 1002 and onwards is acceptable
(meaning--serial number 1001 for CNS will not appear)?
Muthia Kachirayan
|