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 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 5 Aug 2008 11:45:59 -0400
Reply-To:   Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject:   Re: how to attach format into PROC FREQ's output dataset
Comments:   To: zhuxuhong2000@GMAIL.COM

On Tue, 5 Aug 2008 08:11:29 -0700, Xuhong <zhuxuhong2000@GMAIL.COM> wrote:

>Hello folks, > >Here I met a problem and hope some one could help me figure it out. I >need to give reports in excel file, however I couldn't get the formats >in my output file. > >For example, I need run the age report with ageband format. It is fine >in SAS output window, however the output_1 dataset don't show the >format. So, the final excel don't have the format. > >proc freq data=temp; >tables age/missing out=output_1; >format age ageband.; >run; >libname myxls "P:\summary.XLS" ; >data myxls.age; >set output_1; >format age ageband.; >run; >libname myxls clear; ... hi, since you are already in the data step, why not just create a character type variable that will replace the age variable? here is an example. hth. cheers, chang

proc format; value ageband 11-13="11-13" 14-15="14-15" 16="sweet"; run;

libname e "d:\your dir\test.xls"; data e.ageband; set sashelp.class; ageband = put(age, ageband.); drop age; run; libname e clear;


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