Date: Wed, 17 Jul 1996 14:43:57 GMT
Reply-To: Laura Aaronson <aaronsonlm@ZEN.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Laura Aaronson <aaronsonlm@ZEN.COM>
Organization: Zeneca Inc.
Subject: Re: help!!!
Wei Jin <firstname.lastname@example.org> wrote:
>I met a problem about converting one variable to the other. Say,
>I have variable A which has possible value "1,2,3...." and I would
>like to creat variable B which has possible value "9,13,27,...". there
>seems no mathematic connection between the two group of value except
>if A=1 then B=9, if A=2 then B=13 etc. I have 100 value in each group.
>Is there any "elegant" way to do the convertion other than 100 if-then
How about using a format? Much more elegant -- and more efficient -- than all
B = INPUT(PUT(A,BFMT.),BEST.);
To make format "BFMT" you could write a big PROC FORMAT, or, make a dataset of
records, each containing the value of A and its corresponding value of B, and
as a CNTLIN dataset (see documentation for PROC FORMAT).
My opinions are my own and do not necessarily represent those of Zeneca