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 2010, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 22 Sep 2010 21:46:26 -0400
Reply-To:     Bbser 2009 <bbser2009@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bbser 2009 <bbser2009@GMAIL.COM>
Subject:      missover, missing values of character variables

The raw data file collects ID numbers for people and their up to 3 preferred activities. Here is a portion of this file:

1051 TENNIS SWIMMING AEROBICS 1052 JOGGING BASKETBALL 1053 AEROBICS SWIMMING CYCLING

I was trying to make a SAS data set that looks something like this:

ID Preference Activity

1051 1 Tennis 1051 2 Swimming 1051 3 Aerobics 1052 1 Jogging 1052 2 Basketball 1053 ... ....

So I submitted this code:

data Sasuser.Group2; infile excdata3 missover; input ID $ @; Preference=0; do until (activity=" "); input Activity : $10. @; if activity ^=" "; preference+1; output; end; run; proc print; run;

Then I ended up getting this data set, which just shows the first letters for those activities.

ID Preference Activity

1051 1 T 1051 2 S 1051 3 A 1052 1 J 1052 2 B 1053 ... ....

I am totally confused by this, can anyone help me with this? Thanks a lot.

Max


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