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 (March 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 31 Mar 2006 07:06:26 -0500
Reply-To:     Arild S <kog@SSB.NO>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arild S <kog@SSB.NO>
Subject:      Re: New variable based on FORMAT

On Fri, 31 Mar 2006 03:26:07 -0800, RasmusJo <rjo.cebr@CBS.DK> wrote:

>Hi comp.soft-sys.sas, > >Is it possible to generate variables based on formats? > >Consider the following example: > >proc format; >value group >0-10 = 1 >11-20 = 2 >; >run; >quit; > >data wealth; >format wealth group.; >input id wealth; >cards; >1 1 >2 5 >3 11 >4 17 >; >run; >quit; > >Is it possible to recode wealth in accordance with the format 'group'? >For instance, I would like to do a proc freq where I can condition on >wealth group=1 > >Regards, > >Rasmus

Hejsa Denmark, it's a PUT with the format:

wealthgroup = put(wealth, group.);

(or wealth = put(wealth, group.); if you want to overwrite/ recode it, but why.. or just proc freq .. where 0<=wealth<=10; ? )

Rgds Arild


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