Help using Base SAS procedures

Formatting Proc Univariate Variables as a Percent

Reply
New Contributor
Posts: 2

Formatting Proc Univariate Variables as a Percent

Hi,

 

I am running a statistical analysis using the proc univariate (proc uni) function and to format the proc uni variable, I used the percent function percentn.n.  It worked for just the first variable but not for the others.  I was wondering if there is a special/different function for formatting proc uni variables as a percent?

Trusted Advisor
Posts: 1,128

Re: Formatting Proc Univariate Variables as a Percent

I believe you need to apply the format to the variables in the separate dataset with the existing dataset created by the proc univariate
Thanks,
Jag
SAS Super FREQ
Posts: 3,475

Re: Formatting Proc Univariate Variables as a Percent

[ Edited ]

Please show the statements that you are using. PROC UNIVARIATE ignores formats except for CLASS variables and for the display of INSET statistics.

New Contributor
Posts: 2

Re: Formatting Proc Univariate Variables as a Percent

Hi, 

 

Here is an example of the statements I am using (the percentages work for the output but not for the results):

 

 

PROC SQL;

CREATE TABLE SET100 AS SELECT DISTINCT

A.YRY,

A.MTM,

A.ID,

A.RES,

A.PRES,

(PRES * MoDays*24) as total_month,

A.DRES/calculated total_month  format percentn10.2 AS PTRES

 

FROM SET00 A

 

WHERE A.CRES>0 AND A.DRES>0

order by calculated ptres desc;

QUIT;

 

proc univariate data=SET100;

var PTRES;

run;

ODS RTF CLOSE;

Super User
Posts: 9,671

Re: Formatting Proc Univariate Variables as a Percent

A.DRES/calculated total_month  AS PTRES   format=percentn10.2

Ask a Question
Discussion stats
  • 4 replies
  • 316 views
  • 0 likes
  • 4 in conversation