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 (January 2010, 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 Jan 2010 02:51:14 -0800
Reply-To:     "data _null_;" <datanull@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "data _null_;" <datanull@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: How to utilize the FORMAT statement to format the produce
              output data set.
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Jan 5, 4:06 am, zhang3stone <zhang3st...@gmail.com> wrote: > Hi Guys: > > This is a section of code come from a book. > > ROC MEANS DATA=JES.Results_1 NOPRINT; > VAR Defects Resistance Fail; > OUTPUT OUT=Tab_3 > N(Defects)=N > SUM(Defects) = N_DEF > MEAN(Defects) = M_Def > MEAN(Resistance) = M_Res > SUM(Fail) = N_Fail > MEAN(Fail) = P_Fail; > FORMAT M_Def P_Fail 6.2; > RUN; > > The Format statment at last line but one mean to format the var M_Def > and P_Fail that exist in the output data set Tab_3. When submit the > code, However, SAS give the warning of > WARNING: Variable M_DEF not found in data set JES.RESULTS_1. > WARNING: Variable P_FAIL not found in data set JES.RESULTS_1. > although this statment has worked on the output data set. > > My question is that how could I specify the Format statment for the > output dataset only and remove the warning.

Using the : after the name in the format statement will quiet the message. Doing so specifies a "SAS Variable List" which changes the FORMAT statement operands slightly. This could have a negative effect depending on the other names you are creating. If the variable names are unique then there should be no problem. You can also run PROC DATASETS; MODIFY ...; FORMAT ....;

580 proc summary data=sashelp.class; 581 class sex; 582 output out=test mean(weight height)=mWeight mHieght; 583 format mWeight: 7.1 mHeight: 8.2; 584 run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.TEST has 3 observations and 5 variables. NOTE: PROCEDURE SUMMARY used (Total process time): real time 0.00 seconds cpu time 0.00 seconds


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