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

it's possible to create proc report ?

data three;
	infile datalines;
	input a $ b $ x $ y $ z $ m $;
return;
datalines;
AA 21 22 23 24 25
AB 26 27 28 29 30
;
run;

First is output on my query and second table i want .

 

Daily1_0-1663672219478.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:

  Rather than running 2 PROC REPORTS, my tendency would be to create 1 table from the original WORK.THREE dataset, as shown below:

Cynthia_sas_0-1663713095530.png

  Of course I'm not sure I understand the original data anyway or why red and blue are the same for both sections but green and black are different. But anyway, this is my take on it.

cynthia

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Explain how the original data is converted to this report. Don't make us guess. You know the logic used, tell us.

--
Paige Miller
Daily1
Quartz | Level 8

i want append two proc report 

data three;
	infile datalines;
	input a $ b $ x $ y $ z $ m $;
return;
datalines;
AA 21 22 23 24 25
AB 26 27 28 29 30
;
run;

data have;
 set three;
 group='color1';
 group1='color2';
run;

proc report data=have ;
column group ('red' a) ('blue' b) ('green' x) ('black' y);
define group /group noprint;
Compute before group;
Line @1 group $50.;
endcomp;
run;

proc report data=have ;
column group1 ('red' a) ('blue' b) ('green' z) ('black' m);
define group1 /group noprint;
Compute before group1;
Line @1 group1 $50.;
endcomp;
run;
PaigeMiller
Diamond | Level 26
ods excel file='test.xlsx' options(sheet_interval='NONE');
proc report data=have ;
column group ('red' a) ('blue' b) ('green' x) ('black' y);
define group /group noprint;
Compute before group;
Line @1 group $50.;
endcomp;
run;

proc report data=have ;
column group1 ('red' a) ('blue' b) ('green' z) ('black' m);
define group1 /group noprint;
Compute before group1;
Line @1 group1 $50.;
endcomp;
run;
ods excel close;
--
Paige Miller
Ksharp
Super User

I think you need re-organize your data .

It is impossible to get job done in one report.

Maybe @Cynthia_sas  know something.

 

data three;
	infile datalines;
	input a $ b $ x $ y $ z $ m $;
return;
datalines;
AA 21 22 23 24 25
AB 26 27 28 29 30
;
run;

ods excel file='c:\temp\temp.xlsx' options(sheet_interval='none');
proc report data=three nowd;
define a/display;
define b/display id;
define z/display page;
run;
ods excel close;

Ksharp_0-1663675182609.png

 

Cynthia_sas
Diamond | Level 26

Hi:

  Rather than running 2 PROC REPORTS, my tendency would be to create 1 table from the original WORK.THREE dataset, as shown below:

Cynthia_sas_0-1663713095530.png

  Of course I'm not sure I understand the original data anyway or why red and blue are the same for both sections but green and black are different. But anyway, this is my take on it.

cynthia

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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