f



Re: SAS chess problem :-) #2

On Mon, 17 Nov 2008 09:43:10 -0800, Adriano Rodrigues <adriano@GPP.COM.BR>
wrote:

>Hi all,
>
>
>Small joke, but my data from games I played is something like this:
>
>
>data chess;
>
>input white $10. elowhite black $10. eloblack resw resb;
>
>datalines;
>
>Rodrigues 2305 Rocha     2105 1 0
>
>Rodrigues 2305 Lima      2455 0.5 0.5
>
>Watanabe  2400 Rodrigues 2305 0.5 0.5
>
>Asfora    2270 Rodrigues 2305 0 1
>
>Rodrigues 2305 Sunye     2485 0 1
>
>;
>
>run;
>
>
>proc print;
>
>run;
>
>
>I want sort and print all games in this order:
>
>
>Rodrigues 2305 Lima      2455 0.5 0.5
>
>Rodrigues 2305 Rocha     2105 1 0
>
>Rodrigues 2305 Sunye     2485 0 1
>
>Asfora    2270 Rodrigues 2305 0 1
>
>Watanabe  2400 Rodrigues 2305 0.5 0.5
>
>
>(all me with white first, then all me with black)
>
>
>Is there a way in proc sort to order by white but telling to procedure I am
>the first one?
>
>
>What I did until today is to change my name to  AAARodrigues and then use
>one format to put my name back�
>
>
>Thanks,
>
>Adriano
>
>Adriano Rodrigues
>
>Estat�stico Respons�vel
>
>Instituto GPP
>
>(21) 21091857
>
>

Try SQL, like

   proc sql;
   select *
    from chess
    order by (black = 'Rodrigues'), black, white;
   quit;
0
hs
11/17/2008 2:18:43 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

0 Replies
912 Views

Similar Articles

[PageSpeed] 19

Reply: