LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 22 Jul 2011 11:02:03 -0300
Reply-To:     Adriano Rodrigues <adriano@GPP.COM.BR>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Adriano Rodrigues <adriano@GPP.COM.BR>
Subject:      RES: transpose?
Comments: To: Arthur Tabachneck <art297@ROGERS.COM>
In-Reply-To:  <201107211955.p6LJLq9J012733@waikiki.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

This is awesome. Tks!

-----Mensagem original----- De: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Em nome de Arthur Tabachneck Enviada em: quinta-feira, 21 de julho de 2011 16:55 Para: SAS-L@LISTSERV.UGA.EDU Assunto: Re: transpose?

Adriano,

The method proposed by datanull and Mike Zdeb is a bit simpler. Try something like:

data Have; informat car country $15.; input car country salemark; cards; Fiat Brazil 1000 Fiat Argentina 1500 Fiat Espana 2000 Fiat Japan 3000 BMW Brasil 4000 BMW Italy 2000 Mercedes Italy 5000 Citroen Japan 4000 Citroen USA 10000 ;

proc sql noprint; select max(obs) into: obs from (select count(*) as obs from have group by car); quit; run;

proc summary data=have nway; class car; output out=transposed(drop=_:) idgroup(out[&obs](country salemark)=) ; run;

HTH, Art --------- On Thu, 21 Jul 2011 15:37:46 -0300, Adriano Rodrigues <adriano@GPP.COM.BR> wrote:

>Hello SAS-L, > > > >Have > >Car country salemark > >Fiat Brazil 1000 > >Fiat Argentina 1500 > >Fiat Espana 2000 > >Fiat Japan 3000 > >BMW Brasil 4000 > >BMW Italy 2000 > >Mercedes Italy 5000 > >Citroen Japan 4000 > >Citroen USA 10000 > > > > > >Need: > >Car country1 salemark1 country2 salemark2 country3 salemark3 country4 >salemark4 > >Fiat Brazil 1000 Argentina 1500 Espana 2000 Japan 3000 > >BMW Brasil 4000 Italy 2000 > >Mercedes Italy 5000 > >Citroen Japan 4000 USA 10000 > > > > > >Can someone help? > > > >Ty in advance, > >Adriano


Back to: Top of message | Previous page | Main SAS-L page