Date: Tue, 13 Feb 2007 01:51:39 -0500
Reply-To: Nancy Brucken <brucken@PROVIDE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nancy Brucken <brucken@PROVIDE.NET>
Subject: Re: A DECODING VARIABLES QUESTION
Hi,
If I understand your question correctly, you need to add additional
(probably character) variables to your dataset, representing the decoded
values of your coded fields.
For example, if your dataset contains a coded numeric variable called
GENDER that takes on values of 1 (Male) and 2 (Female) and has a GENDER.
format associated with it, you can create the corresponding decoded
variable using:
data decoded;
set coded;
length genderc $ 6;
genderc = trim(left(put(gender, gender.)));
run;
You can write a macro to automate this process, getting a list of your
formatted variables from the dictionary tables- then you'll have a more
general solution to your problem.
Hope this helps,
Nancy
Nancy Brucken
brucken@provide.net
On Mon, 12 Feb 2007 15:11:30 -0500, Rathindronath Sarkar
<mehedisas@YAHOO.COM> wrote:
>I created a dataset but now I have to decode the variables so that they
>don't need user-defined formats attached to them. What that mean? I had to
>format some variables to create this dataset so the values are more clear.
>Do I need to go back to the previous condition as it was?