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 (June 2004, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 29 Jun 2004 14:14:32 -0400
Reply-To:   Bruce Johnson <bjohnson@SOLUCIENT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Bruce Johnson <bjohnson@SOLUCIENT.COM>
Subject:   Re: Creating Multiple formats from same dataset
Comments:   To: Nicole Bibb <nicole.d.bibb@WELLSFARGO.COM>
Content-Type:   text/plain; charset="us-ascii"

Try this, Nicole:

data nicole; length type $4; input type $ decile grp; cards; core 34 4 core 56 3 core 65 2 core 78 2 sec 9 5 sec 88 4 sec 80 6 sec 56 1 old 3 1 old 5 1 old 11 6 ; run; proc sort data=nicole; by type; run; data nicform; set nicole; by type; fmtname=type; start=decile; label=grp; type="N"; keep fmtname start label type; run; proc format cntlin=nicform; run; ***********LOG*******************************************************; 49 data nicole; 50 length type $4; 51 input type $ decile grp; 52 cards;

NOTE: The data set WORK.NICOLE has 11 observations and 3 variables. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds

64 ; 65 run; 66 proc sort data=nicole; 67 by type; 68 run;

NOTE: There were 11 observations read from the dataset WORK.NICOLE. NOTE: The data set WORK.NICOLE has 11 observations and 3 variables. NOTE: PROCEDURE SORT used: real time 0.03 seconds cpu time 0.01 seconds

69 data nicform; 70 set nicole; 71 by type; 72 fmtname=type; 73 start=decile; 74 label=grp; 75 type="N"; 76 keep fmtname start label type; 77 run;

NOTE: There were 11 observations read from the dataset WORK.NICOLE. NOTE: The data set WORK.NICFORM has 11 observations and 4 variables. NOTE: DATA statement used: real time 0.03 seconds cpu time 0.01 seconds

78 proc format cntlin=nicform; NOTE: Format CORE is already on the library. NOTE: Format CORE has been output. NOTE: Format OLD is already on the library. NOTE: Format OLD has been output. NOTE: Format SEC is already on the library. NOTE: Format SEC has been output. 79 run;

NOTE: PROCEDURE FORMAT used: real time 0.03 seconds cpu time 0.01 seconds

NOTE: There were 11 observations read from the dataset WORK.NICFORM.

________________________________ Bruce A. Johnson bjohnson@solucient.com

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nicole Bibb Sent: Tuesday, June 29, 2004 11:46 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Creating Multiple formats from same dataset

I have a dataset that looks like this:

tyoe decile grp core 34 4 core 56 3 core 65 2 core 78 2 sec 9 5 sec 88 4 sec 80 6 sec 56 1 old 3 1 old 5 1 old 11 6

I want to create different formats for each of the types in the file. I know how to create the format using ctrlin. I was hoping to create all the formats at once.

I wrote this code so far but not sure how to change it so it creates a new format for each type in the dataset.

data convctrl(rename=(decile=start bucket=label)); set scrconv2b(end=last); retain fmtname 'scr2_typ' type 'N'; run;

proc format cntlin=convctrl; run; This message is a private communication. It may contain information that is confidential and legally protected from disclosure. If you are not an intended recipient, please do not read, copy or use this message or any attachments, and do not disclose them to others. Please notify the sender of the delivery error by replying to this message, and then delete it and any attachments from your system. Thank you, Solucient LLC (rev eXclaimer 2x)


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