BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fred_major
Calcite | Level 5

Hi,

The table that I am working with contains over 600 metrics that I need to summarize and perform analysis on.

Without manually typing Sum(******)as ******  can this be performed keeping the metric names in source table?

Fred

1 ACCEPTED SOLUTION

Accepted Solutions
fred_major
Calcite | Level 5

Hi,

I am still getting the Error: A bug in Sas but the proc means is working.

Thanks you for your help.

Fred

View solution in original post

9 REPLIES 9
data_null__
Jade | Level 19

PROC MEANS

Reeza
Super User

Yes, use proc means or proc summary NOT proc SQL.

data have;

    array test(100) test1-test100;

    do i=1 to 1000;

    do j=1 to 100;

        test(j)=rand('normal');

    end;

    output;

    end;

    drop i j;

run;

proc means data=have noprint;

var test1-test100;

output out=want sum=;

run;

data_null__
Jade | Level 19

You can even omit the VAR statement to make it "more automatic".

proc means data=have noprint;
  
output out=want sum=;
   run;
Reeza
Super User

That will include all numeric variables by default.

A lot of our identifiers facility/patient are numeric so I usually want to exclude them from summaries Smiley Happy

data_null__
Jade | Level 19

I think for the most part identifiers "patient numbers" should be character. 

Also for the OP with 600 metrics he may be more inclined to ignore a few sums or drop a few variables with a data set option.  Also depends on what kind of "SAS Variable Lists" the OP can use, he did not mention the var names.

fred_major
Calcite | Level 5

Hi,

I tried this

Proc Means noprint data = results (where =(date >= 2014-08-01 and date = 2014-08-07));

CLASS date;

output out=BM SUM=;

RUN;

I Get

ERROR: A bug in SAS has been encountered. please call your sas rep and report the following.

Error: zaqlopt - option 1003 not supported fro data set

data_null__
Jade | Level 19

date constants in SAS are written 'ddMONyyyy'd where MON is three char abbreviation for month.

PGStats
Opal | Level 21

I have to guess what you really meant in your where condition ... but try this instead:

Proc Means noprint data = results (where =(date >= '01AUG2014'd and date <= '07AUG2014'd));

CLASS date;

output out=BM SUM=;

RUN;

PG

PG
fred_major
Calcite | Level 5

Hi,

I am still getting the Error: A bug in Sas but the proc means is working.

Thanks you for your help.

Fred

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1026 views
  • 0 likes
  • 4 in conversation