BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vidyasagar1
Obsidian | Level 7
DATA HAVE;
 INFILE DATALINES;
 INPUT @1 SUP $6. @8 REC 1. @10 ERR 1. @12 DATE $8. @21 E_C $1. @23 R_C $2. @26 C_A $2. 
 @29 P_A $2. @32 S_C $2. @35 E_D $2.;
 DATALINES;
AAAAAA 9 0 1/1/2020 Y NA NA NA NA NA
AAAAAA 8 2 2/1/2020 Y NA NA NA NA NA
AAAAAA 7 5 3/1/2020 Y NA NA NA NA NA
BBBBBB 8 3 1/1/2020 N NA NA NA NA NA
BBBBBB 6 5 2/1/2020 N NA NA NA NA NA
BBBBBB 8 7 3/1/2020 N NA NA NA NA NA
CCCCCC 8 2 1/1/2020						
CCCCCC 2 1 2/1/2020						
CCCCCC 3 1 3/1/2020						
DDDDDD 9 3 1/1/2020						
DDDDDD 6 2 2/1/2020						
;
RUN;

I have a data like above and i need to get the output like below using proc report.

Any help would be greatly appreciated.

 

vidyasagar1_0-1592566049339.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ed_sas_member
Meteorite | Level 14

Hi @vidyasagar1 

Please try this:

proc report data=have missing;
	column sup date, (rec err) E_C R_C C_A P_A S_C E_D;
	define sup / group;
	define date / across;
	define rec / sum;
	define err / sum;
	define E_C / group;
	define R_C / group;
	define C_A / group;
	define P_A / group;
	define S_C / group;
	define E_D / group;
run;

Best,

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Most of us will not download or open Microsoft Office documents, as they are a security risk. Please just show us the desired output in your message.

--
Paige Miller
vidyasagar1
Obsidian | Level 7
Hi, I have added the screenshot of the required output in my message, could you please help me with the code.
ed_sas_member
Meteorite | Level 14

Hi @vidyasagar1 

Please try this:

proc report data=have missing;
	column sup date, (rec err) E_C R_C C_A P_A S_C E_D;
	define sup / group;
	define date / across;
	define rec / sum;
	define err / sum;
	define E_C / group;
	define R_C / group;
	define C_A / group;
	define P_A / group;
	define S_C / group;
	define E_D / group;
run;

Best,

vidyasagar1
Obsidian | Level 7
Hi, Thank you so much.
The code is working for me to get the output as desired.
I appreciate your help.
ed_sas_member
Meteorite | Level 14
Thank you @vidyasagar1. You're welcome

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 412 views
  • 0 likes
  • 3 in conversation