turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- ODS and Base Reporting
- /
- ODS proc report problem trying to compute group su...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2014 11:05 AM

ODS proc report problem trying to compute group sum varibles

Below is a the potions of the log showing my error IQCURQTY AND IQQTYPLC has 0's in the data....but

I want to get the percentage on the sums of IQCURQTY AND IQQTYPLC. How do I define it and and compute it for TT

+ by descending percent_done ccontid;

755 + *****format cndtlet worddate18.*******;

756 + column gitem IQCURQTY IQQTYPLC TT;

757 + define gitem / group 'Item';

758 + define IQCURQTY / 'Quantity';

759 + define IQQTYPLC / ' Quantity Place';

760 + define TT / computed format=9.2;

761 +

762 +Compute TT;

763 + TT =IQQTYPLC_sum/IQCURQTY_sum;

764 +

765 +

766 +endcomp;

767 + run;

NOTE: Variable IQCURQTY_sum is uninitialized.

NOTE: Variable IQQTYPLC_sum is uninitialized.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Division by zero detected at line 1 column 18.

NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.

Each place is given by: (Number of times) at (Line)Column).

7 at 1:18

NOTE: The above message was for the following BY group:

percent_done=1.3341645885 CCONTID=CCCVVV

NOTE: There were 85 observations read from the data set WORK.REPORT23.

NOTE: PROCEDURE REPORT used (Total process time):

real time 0.65 seconds

cpu time 0.09 seconds

This is what I am looking for in my report

Item Quantity Quantity Place TT what I am looking for TT to be

1 7.000 2.000 . .285

2 3824.000 3065.140 . .801

3 2262.000 2185.730 . .966

4 265.000 281.310 . 1.061

6 8282.000 12883.010 . 1.555

7 254556.920 264040.305 . 1.037

8 5018.000 3826.000 . .762

Accepted Solutions

Solution

03-16-2014
11:56 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2014 11:56 AM

Hi:

PROC REPORT is telling you part of the problem with this message:

NOTE: Variable IQCURQTY_sum is uninitialized.

NOTE: Variable IQQTYPLC_sum is uninitialized.

Why do you have IQQTYPLC_sum??? That is not the correct way to reference a numeric item that has a usage of SUM. Instead of this:

TT =IQQTYPLC**_**sum/IQCURQTY**_**sum;

the correct syntax would be something like:

**TT =IQQTYPLC.sum/IQCURQTY.sum;**

I'd suggest reading the PROC REPORT documentation on how to use a compound name to reference numeric report items:

Base SAS(R) 9.4 Procedures Guide, Second Edition

where the documentation clearly explains that a compound name is:

**variable-name.statistic**

cynthia

All Replies

Solution

03-16-2014
11:56 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2014 11:56 AM

Hi:

PROC REPORT is telling you part of the problem with this message:

NOTE: Variable IQCURQTY_sum is uninitialized.

NOTE: Variable IQQTYPLC_sum is uninitialized.

Why do you have IQQTYPLC_sum??? That is not the correct way to reference a numeric item that has a usage of SUM. Instead of this:

TT =IQQTYPLC**_**sum/IQCURQTY**_**sum;

the correct syntax would be something like:

**TT =IQQTYPLC.sum/IQCURQTY.sum;**

I'd suggest reading the PROC REPORT documentation on how to use a compound name to reference numeric report items:

Base SAS(R) 9.4 Procedures Guide, Second Edition

where the documentation clearly explains that a compound name is:

**variable-name.statistic**

cynthia

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-16-2014 03:24 PM

Cynthia,

Thanks for the Link to the Procedures Guide. I'll start reading it. I had a ODS class years ago and I have two books one on ODS and the other on reports.

One of them was showing me (dot)sum but not like I was trying to use it. So as you indicated I was not sure what NOTE: Variable IQCURQTY_sum is uninitialized.

was meaning. I should have tried and google the note.

Thanks also for the syntax was looking for.