BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
Want to display total for supplier name in my report.
Below is the code through which i am not able to display the customize total..

proc report data=WORK.QUERY3051 nowd headskip split='*' spacing=1;
by Cf_Su_Name Gb_Br_Name;
title2 'SUPPLIER : #byval(Cf_Su_Name) ' ;
column Cf_Su_Name Gb_Br_Name
Pi_In_Grnno Pi_In_Grn Pi_In_Orderno Pi_In_Ordtype Pi_In_Partno
Pi_In_Grndate Pi_In_Recqty Pi_In_Recgoods Pi_In_Recprice;
define Cf_Su_Name /group noprint order=formatted ;
define Gb_Br_Name / group order=formatted;
define Pi_In_Orderno / order;
define Pi_In_Ordtype / 'Order*Type' flow width=5;
define Pi_In_Grndate / order;
define Pi_In_Recqty / 'Quantity*Received' SUM format=8.;
define Pi_In_Recgoods / 'Net*Goods*Value' SUM format=comma16.2;
define Pi_In_Recprice / 'Net*Purchase*Cost' SUM format=comma16.2;
break after Gb_Br_Name / summarize OL skip;
rbreak after / summarize;
compute after ;
Cf_Su_Name = 'Total for' || Cf_Su_Name;
endcomp;


run;

Can you modify the code to display below layout.
i am displaying the report layout

Supplier:xyz
Branch GRN Order_type date quantity value
abc
abc subtotal --------- ---------
Total for xyz --------- ---------
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Cf_Su_Name is a NOPRINT variable. So changing its value in the COMPUTE block is not going to work (as you discovered).

If you look at this previous forum posting:
http://support.sas.com/forums/thread.jspa?threadID=1840&tstart=0 and review and run ANY of the Example programs, you will notice that REGION in the programs is defined as a NOPRINT variable.

So, in the COMPUTE block:
[pre]
compute after region;
if region = 'Central America/Caribbean' then region = 'C Amer/Carib';
else if region = 'Western Europe' then region = 'W Eur';
else if region = 'Eastern Europe' then region = 'E Eur';
product = trim(region)|| ' SubTot';
endcomp;
[/pre]

Notice that the COMPUTE block will be executed at the break for REGION, but, the report item that is being "renamed" is PRODUCT ... not REGION. Because PRODUCT is the first "visible" report item on the report.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 725 views
  • 0 likes
  • 2 in conversation