LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 28 Sep 2006 15:18:14 -0400
Reply-To:     "data _null_;" <datanull@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "data _null_;" <datanull@GMAIL.COM>
Subject:      Re: A DATA MANUPULATION QUESTION
Comments: To: Rathindronath <mehedisas@yahoo.com>
In-Reply-To:  <200609281856.k8SAoSvu005195@mailgw.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Let the functions and formats help you. This is a V8 way. With v9 you can use vvalue.

data work.test; input FREQ PERCENT @@; format freq 2. percent negparen7.1; length display $10; if percent then display = putn(freq,vformat(freq))||putn(-percent,(vformat(percent))); else display = putn(freq,vformat(freq)); cards; 0 0 3 10.8 2 5.76 5 8.98 6 5.77 7 8.77 ;;;; run; proc print; run;

On 9/28/06, Rathindronath <mehedisas@yahoo.com> wrote: > I have a dataset with following two numeric variables: > > FREQ PERCENT > ____ _______ > 3 10.8 > 2 5.76 > 5 8.98 > 6 5.77 > 7 8.77 > > How can I turn them to one variable as follows (charcter variable): > > FREQ > ________ > 3 (10.8) > 2 (5.76) > 5 (8.98) > 6 (5.77) > 7 (8.77) > > > Thanks in Advance >


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