Help using Base SAS procedures

How to add a new sum column in proc print?

Accepted Solution Solved
Reply
Contributor
Posts: 68
Accepted Solution

How to add a new sum column in proc print?

Dear All,

 

Im doing PROC PRINT using SAS EG. I got this result:

PRINT TRANSPOSED 25th-Feb-2016.jpg

 

As you can see, i can get the SUM of BONUS and SALARY.

What if i want to add a new column called "Individual Income" next to SALARy, how should i do?

 

I know in PROC REPORT that just have to define it as computed. But what about in Proc PRINT?

 

BTW, here is my code:

PROC PRINT DATA=WORK.TRANSPOSED (DROP=CASE_RK _NAME_);
TITLE 'PRINT TRANSPOSED';
SUM X_AAG_BONUS X_AAG_SALARY;
RUN;

Accepted Solutions
Solution
‎02-24-2016 10:54 PM
Contributor
Posts: 68

Re: How to add a new sum column in proc print?

I found the solution myself.

Just add a new datastep and put newsum=A+b;

 

View solution in original post


All Replies
Solution
‎02-24-2016 10:54 PM
Contributor
Posts: 68

Re: How to add a new sum column in proc print?

I found the solution myself.

Just add a new datastep and put newsum=A+b;

 

Super User
Super User
Posts: 7,392

Re: How to add a new sum column in proc print?

Move to proc report, you can do things like this very simply.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 247 views
  • 0 likes
  • 2 in conversation