|
Herman
Here is some code that I keep on hand for questions such as yours.
Nat Wooding
*First create two SAS data sets;
data students;
informat name $10. class $10.;
input name class ;
cards;
Tom Junior
Mary Senior
Hank Sophomore
Data Scores;
informat name $10. subject $10. score 8.;
input name subject score;
cards;
Tom English 98
Tom History 88
Mary Econ 99
;
* now, convert the first set into a format;
data format(keep=start label fmtname);
set Students (rename=(name=start class=label));
fmtname='$Names';
run;
proc format library=work cntlin=work.Format;
run;
* and lets use the format to assign class to the scores data set;
Data Scores;
set scores;
Class=put(name,$Names.);
Proc Print;
run;
Heman Hunters
<hemanhunters@GMA
IL.COM> To
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Discussion" cc
<SAS-L@LISTSERV.U
GA.EDU> Subject
Re: Lookup table in SAS + random
numbers in SAS
07/15/2006 07:49
AM
Please respond to
Heman Hunters
<hemanhunters@GMA
IL.COM>
Thanks Ian!
Could anyone give me a short code example of the format-put-thing Ian
described above? I am not quite sure how to do this...
-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.
|