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 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 4 Sep 2001 05:43:08 GMT
Reply-To:     Ya Huang <huanga@WORLDNET.ATT.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ya Huang <huanga@WORLDNET.ATT.NET>
Organization: AT&T Worldnet
Subject:      Re: missing values in each observation

data xx; input market col1 col2 col3 col4 col5; cards; 1 . 3 . . . 2 1 . . 2 . 3 . . . . 1 4 . 2 2 . . 5 1 1 1 1 . ;

options missing=' ' nocenter; data xx (drop=lstr i); set xx; length lstr $200; array col(*) col:; lstr=''; do i=1 to dim(col); lstr=compress(lstr||'~'||col(i)); end; lstr=compbl(translate(lstr,' ','~')); do i=1 to dim(col); col(i)=input(scan(lstr,i,' '),best.); end;

proc print; run; --------------------- Obs market col1 col2 col3 col4 col5

1 1 3 2 2 1 2 3 3 1 4 4 2 2 5 5 1 1 1 1

HTH

Ya Huang

Larry Hai Che wrote in message <9n1g3m$n7p$1@newsreader.wustl.edu>... >Dear all, > >I have a question about missing values, > >I have a dataset looking like the following, > >market col1 col2 col3 col4 col5 >1 . 3 . . . >2 1 . . 2 . >3 . . . . 1 >4 . 2 2 . . >5 1 1 1 1 . > >As you could see, for each market(observation), there are some missing >values in the 5 columns. > >I want to have the dataset look like the following, > >market col1 col2 col3 col4 col5 >1 3 >2 1 2 >3 1 >4 2 2 >5 1 1 1 1 > >i.e., I want to delete the missing values in each observation(not deleting >observations or columns which have missing values)and leave only the >available values and an unbalanced matrix. > >Since each column also is a variable name, I couldn't just use another sort >or transpose to do that....... > >I appreciate your comments, suggestions and helps!! Thanks, > >Larry > > > >


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