by marcioesta » Sat, 30 Sep 2006 22:09:14
lt;pre>Hey Toby and listers,</pre><pre>I found out how to modify a group of=
variables
values,</pre><pre>using ARRAY with the code below. But I am now searching
if is there a was to set a format for the label,</pre><pre=
I want to get 1 into YES, 2 into NO and 3 into BLANK for all va=
riables of
my dataset. Do you have any idea?</pre><pre>Remenber that I have alm=
ost 100
variables and if I use PROC FORMAT, the code will be not
functional.</pre><pre>Thanks,</pre><pre>Márcio </pre><pre>dat=
a
lib.fix(drop=3Di);</pre><pre>set lib.fix;</pre><pre>array fix(1:10) PA101=
01 PA10102
PA10103 PA10104 PA10201 PA10202 PA10203 PA10204 PA10205 PA10301;</pre><pr=
e>do i=3D1
to 10;</pre><pre>if fix(i)=3D's' then fix(i)=3D'1';</pre><pre>end;</pre><=
pre>do i=3D1 to
10;</pre><pre>if fix(i)=3D'n' then fix(i)=3D'2';</pre><pre>end;</pre><pre=
10;</pre><pre>if fix(i)=3D' ' then
fix(i)=3D'3';</pre><pre>end;</pre><pre>run;</pre><p><br
/>-----------------------------------------------------------------------=
---------<br
/>Depends on how they are named, if there is some commonality to them you=
can <br
/>always hit the dictionary.columns table and grab them, otherwise no mat=
ter <br
/>what any one comes up with you are stuck writing them out by hand.<br /=
/><br />Toby Dunn<br /><br />When everything is coming at you all at once=
, your in
the wrong lane.<br /><br />A truly happy person is someone who can smile =
and enjoy
the scenery on a <br />detour.<br /><br /><br /><br /><br /><br />From:
" XXXX@XXXXX.COM " To: "toby dunn" Subject: Re:=
Mofify
data values of n's variables<br />Date: Thu, 28 Sep 2006 15:23:12 -0300 (=
EST)<br
/><br /><br />Hey Toby,<br />I got what you did, but the problem is that =
I have
about 100<br />variables. So, I would need to do the proc format for 100 =
variables.
Do you <br />know if<br />is there a way to apply the same proc format to=
a group
of<br />variables?<br />Thanks,<br />Márcio<br /><br
/>-----------------------------------------------------------------------=
---------<br
/>Marcio ,<br /><br />Call me crazy but why dont you skip to just formtti=
ng the<br
/>YES/NO/MISSING to<br />YES/NO/NO RESPONSE?<br /><br /><br />Proc Format=
;<br
/>Value $NewRecode<br />'MISSING' =3D 'NO RESPONSE' ;<br />Run ;<br /><br=
/>Should
do<br />it.<br /><br /><br />Toby Dunn<br /><br />When everything is comi=
ng at you
all at<br />once, your in the wrong lane.<br /><br />A truly happy person=
is
someone who can<br />smile and enjoy the scenery on a<br />detour.<br /><=
br /><br
/><br /><br /><br />From: " XXXX@XXXXX.COM " Reply-To:<br
/>" XXXX@XXXXX.COM " To: XXXX@XXXXX.COM <br />Subj=
ect:
Mofify<br />data values of n's variables<br />Date: Thu, 28 Sep 2006 10:5=
9:59
-