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:
Region | Regional 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 |
what do you want to change?
ChrisNZ,
I want to drop the "product" column and merge it to "Region" column.
Also, paste your code using the appropriate icon.
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;
Also, paste your code using the appropriate icon.
Cynthia_SAS
It works. thanks,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.