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 (March 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 17 Mar 2008 06:48:05 -0700
Reply-To:   Melodyp <pearsonmelody@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Melodyp <pearsonmelody@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: How to transfer all missing value all at once?
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On Mar 16, 11:35 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote: > Melody, > > Please provide a sample of combine_final_4 and what you want the resulting > combine_final_5 to look like. > > Art > --------- > On Sun, 16 Mar 2008 20:21:30 -0700, Melodyp <pearsonmel...@GMAIL.COM> > wrote: > > > > >On Mar 15, 12:27 am, Patrick <patrick.mat...@gmx.ch> wrote: > >> On Mar 15, 2:48 pm, Melodyp <pearsonmel...@gmail.com> wrote: > > >> > I have a data set with many missing value both in "." or " ", how can > >> > I transfer them all at once? > > >> > I used the code below but return 0 observations in the new dataset. > > >> > Thank you in advance for your help. > > >> > Melody > > >> Missed your "code below" so I had to guess. > >> Are you're looking for something like the code below? > > >> data have; > >> a='a';b=1;c=1;output; > >> a='';b=1;c=1;output; > >> a='';b=.;c=1;output; > >> a='a';b=.;c=.;output; > >> run; > > >> data NoMissings Missings; > >> set have; > >> array num {*} _numeric_; > >> array char {*} _character_; > > >> do i=1 to dim(num); > >> if missing(num{i}) then miss=1; > >> if miss=1 then leave; > >> end; > >> do i=1 to dim(char); > >> if miss=1 then leave; > >> if missing(char{i}) then miss=1; > >> end; > > >> drop i miss; > >> if miss then output Missings; > >> else output NoMissings; > >> run; > > >Patric, > > >Thank you very much for your reply, I forget to attach my code, here > >is the code I used but I don't know where I did wrong, as it's not > >working. > >data melody.combine_final_5; > >set melody.combine_final_4; > >if missing(_num_) then _num_=-1; > >if missing(_character_) then _character_= -1; > >run; > > >Thank you again. > > >Melody- Hide quoted text - > > - Show quoted text -

Arthur,

thank you for getting back to me. Below if a e.g. Donate_by_phone is a chart and have two missing value (empty) I want transfered to -1 in combine_final 5. Unit number and adults_per hours and severl missing value ".", I also want them to be transfered as -1 in Combine_final_5.

Is that possible?

Combine_final_4 donate_by_phone unit number adults_per_hours . 2 1 1 1 2 3 0 4 . 1 . . 1 . 5 0 . 2 0 . .

Combine_final_5 donate_by_phone unit number adults_per_hours -1 -1 2 -1 1 1 1 2 3 0 4 -1 1 -1 -1 1 -1 5 0 -1 2 0 -1 -1


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