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

Dear Experts,

How can I modify the style in proc report for the following code;

PROC REPORT DATA= SASHELP.SHOES NOWD HEADLINE HEADSKIP SPLIT='*'
STYLE(HEADER)=[ BACKGROUND=ORANGE FONT_WEIGHT = bold];

COLUMN ('Global shoe sales in USD' ('Regional Shoe sales' REGION PRODUCT)('In USD only' SALES));
DEFINE REGION / 'Region' GROUP WIDTH=6 CENTER;
DEFINE PRODUCT / 'Product' ORDER GROUP WIDTH=6 CENTER STYLE=[ borderbottomwidth=1];
DEFINE SALES / 'Regional * Sales' SUM RIGHT FORMAT=DOLLAR15.2;
BREAK AFTER REGION /style=default ;

ENDCOMP;
RUN;

 

expected outcome:

RegionRegional Sales
  
AFRICA 
Boot$119,835.00
Men's Casual$562,794.00
Men's Dress$318,500.00
Sandal$190,409.00
Slipper$337,076.00
Sport Shoe$22,150.00
Women's Casual$417,516.00
Women's Dress$374,308.00
  
ASIA 
Boot$62,708.00
Men's Casual$11,754.00
Men's Dress$119,366.00
Sandal$8,208.00
Slipper$152,032.00
Sport Shoe$2,092.00
Women's Casual$25,837.00
Women's Dress$78,234.00
  
CANADA 
Boot$385,613.00
Men's Casual$441,903.00
Men's Dress$920,101.00
Sandal$14,798.00
Slipper$952,751.00
Sport Shoe$140,389.00
Women's Casual$410,807.00
Women's Dress$989,350.00
  
CENTRAL AMERICA/CARIBBEAN 
Boot$190,743.00
Men's Casual$756,513.00
Men's Dress$404,895.00
Sandal$378,382.00
Slipper$883,181.00
Sport Shoe$26,964.00
Women's Casual$399,357.00
Women's Dress$617,718.00
  
EASTERN EUROPE 
Boot$306,785.00
Men's Casual$576,396.00
Men's Dress$335,761.00
Sandal$3,716.00
Slipper$509,698.00
Sport Shoe$91,202.00
Women's Casual$209,256.00
Women's Dress$362,126.00
  
MIDDLE EAST 
Boot$171,282.00
Men's Casual$2,058,254.00
Men's Dress$839,571.00
Sandal$35,186.00
Slipper$662,480.00
Sport Shoe$4,007.00
Women's Casual$748,792.00
Women's Dress$1,112,207.00
  
PACIFIC 
Boot$123,575.00
Men's Casual$662,368.00
Men's Dress$426,191.00
Sandal$48,424.00
Slipper$390,740.00
Sport Shoe$26,169.00
Women's Casual$219,886.00
Women's Dress$399,441.00
  
SOUTH AMERICA 
Boot$245,675.00
Men's Casual$544,950.00
Men's Dress$425,669.00
Sandal$165,925.00
Slipper$462,651.00
Sport Shoe$33,061.00
Women's Casual$179,227.00
Women's Dress$377,625.00
  
UNITED STATES 
Boot$448,296.00
Men's Casual$1,372,527.00
Men's Dress$969,271.00
Sandal$12,039.00
Slipper$967,927.00
Sport Shoe$104,403.00
Women's Casual$541,536.00
Women's Dress$1,087,987.00
  
WESTERN EUROPE 
Boot$296,031.00
Men's Casual$946,248.00
Men's Dress$747,918.00
Sandal$11,349.00
Slipper$857,298.00
Sport Shoe$201,030.00
Women's Casual$985,647.00
Women's Dress$827,479.00
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26
Hi:
This paper https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf has an example of what you want to do starting on page 18. Look at Output 15.
Cynthia

View solution in original post

7 REPLIES 7
tekish
Quartz | Level 8

ChrisNZ,

I want to drop the "product" column and merge it to "Region" column.

ChrisNZ
Tourmaline | Level 20

Also, paste your code using the appropriate icon.

tekish
Quartz | Level 8

Here is the sample code I am using. I dont have any idea how to start to code for this one.

 

PROC REPORT DATA= SASHELP.SHOES NOWD HEADLINE HEADSKIP SPLIT='*'
STYLE(HEADER)=[ BACKGROUND=ORANGE FONT_WEIGHT = bold];

COLUMN ('Global shoe sales in USD' ('Regional Shoe sales' REGION )('In USD only' SALES));
DEFINE REGION / 'Region' GROUP WIDTH=6 CENTER;
DEFINE PRODUCT / 'Product' NOPRINT ORDER GROUP WIDTH=6 CENTER STYLE=[ borderbottomwidth=1];
DEFINE SALES / 'Regional * Sales' SUM RIGHT FORMAT=DOLLAR15.2;
BREAK AFTER REGION /style=default ;

ENDCOMP;
RUN;

ChrisNZ
Tourmaline | Level 20

 

Also, paste your code using the appropriate icon.

 
You need to:
1. Set the REGION as noprint.
2. Add a line before PRODUCT, and set the value of the string in the line to REGION. 
 
 
Cynthia_sas
Diamond | Level 26
Hi:
This paper https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf has an example of what you want to do starting on page 18. Look at Output 15.
Cynthia
tekish
Quartz | Level 8

Cynthia_SAS

It works. thanks,

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 7 replies
  • 2827 views
  • 1 like
  • 3 in conversation