BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
joaocamargo
Calcite | Level 5

Hi! 
How can i change this? 

joaocamargo_0-1715773077653.png

 

for this

joaocamargo_1-1715773101158.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

You can use a COMPUTE BEFORE block to achieve this. See example below. note that the make column is not printed but used in the COMPUTE BEFORE together with the LINE statement.

 

proc report data=sashelp.cars;
    column make model invoice horsepower;
    define make / order noprint;
    define model / display style={textalign=left};
    compute before make / 
        style={backgroundcolor=lightblue textalign=left}
    ;
        line make $20.;
    endcomp;
run;

View solution in original post

5 REPLIES 5
BrunoMueller
SAS Super FREQ

You can use a COMPUTE BEFORE block to achieve this. See example below. note that the make column is not printed but used in the COMPUTE BEFORE together with the LINE statement.

 

proc report data=sashelp.cars;
    column make model invoice horsepower;
    define make / order noprint;
    define model / display style={textalign=left};
    compute before make / 
        style={backgroundcolor=lightblue textalign=left}
    ;
        line make $20.;
    endcomp;
run;
joaocamargo
Calcite | Level 5
Wow, thanks a lot. I've been trying to do this for a few days!
joaocamargo
Calcite | Level 5
Can I create a large group and then place other groups?
Like
South America
Brazil
Type1
Type2
Type3
Argentina
Type1
Type2
Type3
Europe
Germany
Type1
Type2
Type3
France
Type1
Type2
Type3

?
BrunoMueller
SAS Super FREQ

Sure just add the variables needed specify NOPRINT for the once you use in a COMPUTE BEFORE variable block.

 


proc report data=sashelp.orsales;
    column year quarter product_line quantity;
    define year / group noprint;
    define quarter / group noprint;
    define product_line / group;
    define quantity / analysis;
    compute before year;
        line year 4.;
    endcomp;
    compute before quarter;
      line quarter $6.;
    endcomp;
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1398 views
  • 2 likes
  • 2 in conversation