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 (August 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 10 Aug 2004 07:55:58 -0700
Reply-To:     "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:      Re: smart ways for formating value?
Comments: To: ougya <jieguo01@YAHOO.COM>

Hi Jay -

I agree using a datastep and ctrlin is the best automated way to create a format like this, but having said that, if you just need the format this once, writing it should be a snap if you fully use your editor features.

In your non-enhanced SAS editor and the num command shows line numbers. Line commands can be used on the line numbers for working with blocks of repetitious code like in formats. Once you type 10000-<15000='lt15k' then use the r13 line command to repeat it 13 times. Put your cursor in over-write mode (insert key) and type in the correct numbers, vertically is much faster than horizontally. After you repeat it with r13 if you copy paste it (ctrl-c ctrl-v) into the enhanced editor you can select columns of code by holding down your alt key why dragging your mouse. Then ctrl-v will insert-paste the column. Knowing your editor features it should take under 30 seconds to create a format like your example.

Elsewhere in the list you'll hear that Utra-Edit is the way to go. I use a combination of the SAS enhanced and non-enhanced, Excel and Word, and ISPF occasionally. Any editing environment leads to different styles of coding due to its unique features. Enhanced editors like SAS's or Ultra-Edit are extremely useful because they highlight the code as you type, displaying potential syntax problems as you work.


Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of ougya Sent: Tuesday, August 10, 2004 6:42 AM To: SAS-L@LISTSERV.UGA.EDU Subject: smart ways for formating value?

Hi, I was tying the following code, as you will see it is tedious to type format. Wondering anyone has a smart way to minimize the pain? Thanks. Jay

proc format value cbalf low-10000='lt10k' 10000-<15000='lt15k' 15000-<20000='lt20k' 20000-<25000='lt25k' 25000-<30000='lt30k' 30000-<35000='lt35k' 35000-<40000='lt40k' 40000-<45000='lt45k' 45000-<50000='lt50k' 50000-<55000='lt55k' 55000-<60000='lt60k' 60000-<65000='lt65k' 65000-<70000='lt70k' 70000-<75000='lt75k' 75000-high='75khi' ; run; proc freq data=a; tables cbal; format cbal cbalf.; run;

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