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

Below is my code and output.

data a;
input gr $ TRT $ Visno $ Param $ value;
datalines;
Gr1 TRT1 v1 A 8
Gr1 TRT1 v1 B 6
Gr1 TRT1 v1 C 5
Gr1 TRT1 v2 A 6
Gr1 TRT1 v2 B 7
Gr1 TRT1 v3 C 8
Gr1 TRT2 v1 A 3
Gr1 TRT2 v1 B 7
Gr1 TRT2 v1 C 5
Gr1 TRT2 v2 A 10
Gr1 TRT2 v2 B 6
Gr1 TRT2 v3 C 10
Gr2 TRT3 v1 A 10
Gr2 TRT3 v1 B 16
Gr2 TRT3 v1 C 18
Gr2 TRT3 v2 A 14
Gr2 TRT3 v2 B 11
Gr2 TRT3 v3 C 15
;

proc report data=a nocompletecols;
column gr trt visno, (param, value);
define gr / group ;
define trt / group;
define visno / across;
define param / across;

run;

 

In  output, the gr column has a blank and it should be filled with 'Gr1'.  How can I fill the blank with gr value? please advice thanks.

 

Below is the output, with blank in gr column

 Capture1.JPG

 

Below is what I want,  Filled with Gr1 


Capture1.JPGCapture2.JPG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Niugg2010,

 

Most probably, you can adapt the solution I provided to another user in 2016:

PDF Report: How to let a group variable show up multiple times

I think in the last COMPUTE block you won't need the IF condition.

View solution in original post

4 REPLIES 4
FreelanceReinh
Jade | Level 19

Hi @Niugg2010,

 

Most probably, you can adapt the solution I provided to another user in 2016:

PDF Report: How to let a group variable show up multiple times

I think in the last COMPUTE block you won't need the IF condition.

Niugg2010
Obsidian | Level 7

Thanks a lot.

If there is an option to control grouped value display, it will be great.

 

 

shahsn11
Fluorite | Level 6

Could you post the solution that work for you.

 

Thanks.

Niugg2010
Obsidian | Level 7

 

 

proc report data=a nocompletecols;
column gr _gr trt visno, (param, value);
define gr / group noprint;
define trt / group;
define visno / across;
define param / across;
define _gr/ computed;

compute before gr;
temp=gr;
endcomp;
compute _gr / character length=8;
_gr=temp;
endcomp;

run;

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

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
  • 4 replies
  • 1062 views
  • 0 likes
  • 3 in conversation