Help using Base SAS procedures

Need help with UNIVARIATE procedure

Reply
New Contributor
Posts: 4

Need help with UNIVARIATE procedure

I am a VERY light SAS user who had the product handed to him when a coworker retired and am having a problem with a SAS program that uses the UNIVARIATE procedure.  Results that used to look like this:

   Quantiles (Definition 5)

                                                       Quantile      Estimate

                                                       100% Max       291.318

                                                       99%              0.160

                                                       95%              0.030

                                                       90%              0.014

                                                       75% Q3           0.004

                                                       50% Median       0.002

                                                       25% Q1           0.000

                                                       10%              0.000

                                                       5%               0.000

                                                       1%               0.000

                                                       0% Min           0.000

Now look like this:

                                                      Quantiles (Definition 5)

                                                     Quantile          Estimate

                                                     100% Max       1.31885E+02

                                                     99%            2.93500E-01

                                                     95%            5.50994E-02

                                                     90%            2.70000E-02

                                                     75% Q3         8.00000E-03

                                                     50% Median     3.50000E-03

                                                     25% Q1         1.58333E-03

                                                     10%            3.99668E-04

                                                     5%             9.99998E-05

                                                     1%             0.00000E+00

                                                     0% Min         0.00000E+00

I know it is a format issue on the output, but I'm struggling with trying to figure out where to look.  Any help would be greatly appreciated.

SAS Super FREQ
Posts: 3,475

Re: Need help with UNIVARIATE procedure

Have you recently changed versions of SAS, edited macros, or otherwise made changes to the software?

New Contributor
Posts: 4

Re: Need help with UNIVARIATE procedure

No changes to the software, but the data now contains 4 positions to the right of the decimal place when there were 3 before.

Super User
Posts: 9,671

Re: Need help with UNIVARIATE procedure

Maybe Someone just changed the TEMPLATE of proc univariate.

Delete it and Restore the default TEMPLATE. But I don't know how to do it. Post it at ODS and REPORT forum.

@Cynthina should know how to do it.

New Contributor
Posts: 4

Re: Need help with UNIVARIATE procedure

Xia,

   Thanks for the reply.  The TEMPLATE wasn't changed because if I use old data, the results look ok.  As I said, the data now has 4 positiions to the right of the decimal place, when before there were 3.  If I run a delete for everything smaller than .001 before I run the UNIVARIATE proc, then it works. I suspect my data has too large a range.  (Some values larger than 1000...some less than .001.)

Super User
Posts: 9,671

Re: Need help with UNIVARIATE procedure

Maybe you assign a Ew.d format to that variable ?

format var best32.;

Not sure if it could work.

Xia Keshan

Super User
Posts: 17,784

Re: Need help with UNIVARIATE procedure

Please post your proc univariate code.

I can't replicate that issue even with various formats on SAS 9.3...

New Contributor
Posts: 4

Re: Need help with UNIVARIATE procedure

Here's the code that works:

OPTIONS LINESIZE=133 PAGESIZE=60;

 

DATA ONE;                        

  INFILE IFILE ;                  

INPUT  @58   FREQ      10.      

        @73  RESP       9.;      

RESP=RESP/FREQ;

if resp < .001 then delete;

proc printto file='d:/sas/dbparesp.txt';

PROC UNIVARIATE DATA=ONE ;       

  FREQ FREQ;                      

  VAR RESP;                      

proc printto;

run;

If you remove the highlighted code, I get the unreadable results.

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