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 (December 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 5 Dec 2001 11:30:51 -0500
Reply-To:     "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject:      Re: Our language
Comments: To: "A. L." <franz_cl2003@YAHOO.FR>
Content-Type: text/plain; charset="iso-8859-1"

> From: A. L. [mailto:franz_cl2003@YAHOO.FR] > I am sure there is a much better way to say this in > our language! Thanks. > > IF var_1 = 1 THEN var_1_n = 'yes'; > IF var_1 = 0 THEN var_1_n = 'no' ; > IF aaa_1 = 1 THEN aaa_1_n = 'yes'; > IF aaa_2 = 0 THEN aaa_2_n = 'no' ;

proc FORMAT; value YN 0='no' 1='yes';

data RECODES; set ThePreviousDSN; var_1_n = put(Var_1,YN.); aaa_1_n = put(aaa_1,YN.); ...

or: data RECODES; array Nmbrs (*) Var_1 Aaa_1 Aaa_2 ...; array Chars (*) $ 3 Var_1_n Aaa_1_n Aaa_2_2 ...; set ThePreviousDSN; do I = 1 to dim(Nmbrs); Chars(I) = put(Nmbrs(I),YN.);end;

Ron Fehd the macro maven CDC Atlanta GA USA OpSys: Win_Pro Ver: 8.2 ---> cheerful provider of UNTESTED SAS code from the KludgeWrx !*! <---

By using your intelligence you can sometimes make your problems twice as complicated. -- Ashleigh Brilliant

... or half as complicated, whichever the case -- or array -- may be -- RJF2

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