Hi All,
I'm new to the sas below is my sample data and output format which I'm looking for. I tried to work on proc report which worked when my data is very low say 200 observations. But, when I applied on the whole date which contains around 32,000 observations my enterprise guide is not responding.
Please help me to resolve this issue.
proc report data=a1 nowd out=a3; by Amount transaction_date ; column customer Amount pmt_amt transaction_date System_date; define customer/order; define transaction date /order; define System_date/order; /*break after vin/skip summarize ol;*/ rbreak after/summarize dol; run;
customer | Amount | transaction date | System date |
1234 | 100 | 02-Aug-17 | 02-Aug-17 |
1234 | 200 | 03-Aug-17 | 03-Aug-17 |
2345 | 300 | 03-Aug-17 | 03-Aug-17 |
3214 | 200 | 01-Sep-17 | 01-Sep-17 |
looking for Output:
1234 | ||
transaction date | System date | Amount |
02-Aug-17 | 02-Aug-17 | 100 |
03-Aug-17 | 03-Aug-17 | 200 |
Total | 300 | |
2345 | ||
03-Aug-17 | 03-Aug-17 | 300 |
Total | 300 | |
3214 | ||
01-Sep-17 | 01-Sep-17 | 200 |
Total | 200 | |
Looking forward to hear from you
data have; infile cards expandtabs truncover; input customer Amount transaction_date : $20. System_date : $20.; cards; 1234 100 02-Aug-17 02-Aug-17 1234 200 03-Aug-17 03-Aug-17 2345 300 03-Aug-17 03-Aug-17 3214 200 01-Sep-17 01-Sep-17 ; proc report data=have nowd; column customer transaction_date System_date Amount; define customer/group noprint; compute before customer/style={just=left}; _customer=put(customer,best32. -l); line _customer $32. ; endcomp; compute after customer/style={just=right}; line 'total: ' amount.sum ; endcomp; run;
You are asking PROC REPORT to do a huge amount of work, and if you are sending the results to the default HTML destination, then it also has to create a huge HTML file, so I'm not surprised it will take a huge amount of time. What happens if you change the output destination to turn off HTML and just send it to the LISTING destination?
Will try that. While using proc report I used OUT option to move the data to SAS data set. It's not even working.
Let me google for the listing and see how it works. My final output must be in excel.
@SJN wrote:
It's not even working.
This tells us nothing that we can use to help you. You need to give us details.
But if your final output needs to be in Excel, why are you writing this to an output (HTML or LISTING) anyway? Just write it to Excel (if that will work with this many lines) using ODS Excel and skip the output to HTML or LISTING.
Oh yeah, if you want to write it to Excel, you could have (hint hint hint) stated this in your very first post, instead of misleading us that you want it written to some other destination.
data have; infile cards expandtabs truncover; input customer Amount transaction_date : $20. System_date : $20.; cards; 1234 100 02-Aug-17 02-Aug-17 1234 200 03-Aug-17 03-Aug-17 2345 300 03-Aug-17 03-Aug-17 3214 200 01-Sep-17 01-Sep-17 ; proc report data=have nowd; column customer transaction_date System_date Amount; define customer/group noprint; compute before customer/style={just=left}; _customer=put(customer,best32. -l); line _customer $32. ; endcomp; compute after customer/style={just=right}; line 'total: ' amount.sum ; endcomp; run;
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!
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.