Help using Base SAS procedures

Proc Report

Accepted Solution Solved
Reply
Super Contributor
Posts: 266
Accepted Solution

Proc Report

proc import datafile="~bank.xls" out= bank dbms=excel replace;

getnames=yes;

run;

proc report data=bank nowd;

column accttype branch amount,sum;

define accttype/group;

define branch/across;

define amount /sum;

run;

OUTPUT:

18:48 Wednesday, September 28, 2011  34

                                                                Branch                           Amount

                    AcctType      Central       North County  Westside            sum

                    CD               97              60                    54              3145845

                    Checking      158            61                    59              1487914

                    IRA              8               15                     5                212754

                    Savings        99             61                     35              1689259

Is it possible to see amount in place of no of records ie. 34000 or (whatever sum is) in place of 97 , 60 54 or all????????????


Accepted Solutions
Solution
‎09-29-2013 07:56 AM
Contributor
Posts: 64

Re: Proc Report

Hi Aman,

I think this code might help you.. please change the data set name as per your records..

proc report data=bank nowd;                                                                                                       
column acctype (branch,amount);                                                                                                   
define acctype / group;                                                                                                           
define branch / across;                                                                                                           
define amount / sum ;                                                                                                             
run;                                                                                                                              

--

Durga.

View solution in original post


All Replies
Solution
‎09-29-2013 07:56 AM
Contributor
Posts: 64

Re: Proc Report

Hi Aman,

I think this code might help you.. please change the data set name as per your records..

proc report data=bank nowd;                                                                                                       
column acctype (branch,amount);                                                                                                   
define acctype / group;                                                                                                           
define branch / across;                                                                                                           
define amount / sum ;                                                                                                             
run;                                                                                                                              

--

Durga.

Trusted Advisor
Posts: 1,137

Re: Proc Report

You can get the output you want with proc tabulate procedure as well, here is the code for that

proc tabulate data=bank;

class accttype branch;

var amount;

tables (amount)*sum, accttype,branch all="Amount sum";

run;

Thanks,

Jagadish

Thanks,
Jag
Super Contributor
Posts: 266

Re: Proc Report

Thanks for your kind help.

i would like to share my effort with you please suggest me  and please any one can help me to know what is the use of  'nofs' ?

proc report data=bank nowd ;

column accttype branch,amount amount;

define accttype/group;

define branch/across;

define amount /analysis sum;

compute after;

Accttype="Total:";

endcomp;

rbreak after / dol dul summarize;

run;

Trusted Advisor
Posts: 1,137

Re: Proc Report

The options nofs and nowd are both same. By using these option we are preventing the proc report directing the output to report window. The output is displayed in the normal output window instead of report window.

The default if we are not mentioning any option is proc report will send the output to report window. 

Thanks,

Jagadish

Thanks,
Jag
🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 241 views
  • 1 like
  • 3 in conversation