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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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
  • 1 reply
  • 637 views
  • 0 likes
  • 2 in conversation