My data consists of financial transactions, and I need to create a report with detailed records as well as customized summary (SAS 9.1.3 on Unix). Simplified version of Data looks like: Portfolio, Expiration Date, Trade Date, Master Ticket Number, Ticket Number, Ticket Type, Transaction Type, Amount ABCDE, 2/28/2013, 2/20/2013, 1000, 1000, Type1, Buy, $100,000.00 ABCDE, 2/28/2013, 2/21/2013, 1000, 1001, Type1, Buy, $50,000.00 ABCDE, 2/28/2013, 2/22/2013, 1000, 1002, Type1, Buy, $40,000.00 ABCDE, 2/28/2013, 2/22/2013, 1000, 1003, Type1, Transfer, $60,000.00 ABCDE, 2/28/2013, 2/23/2013, 1000, 1004, Type1, Sell, $100,000.00 DEF, 2/28/2013, 2/20/2013, 1005, 1005, Type2, Buy, $100,000.00 DEF, 2/28/2013, 2/22/2013, 1005, 1006, Type2, Sell, $100,000.00 XYZ, 2/28/2013, 2/18/2013, 1007, 1007, Type1, Buy, $100,000.00 XYZ, 2/28/2013, 2/22/2013, 1007, 1008, Type1, Buy, $100,000.00 XYZ, 2/28/2013, 2/10/2013, 1009, 1009, Type1, Buy, $100,000.00 XYZ, 2/28/2013, 2/22/2013, 1009, 1010, Type1, Sell, $60,000.00 Report should look like: On Page 1 Portfolio: ABCDE Expiration Date, Trade Date, Master Ticket Number, Ticket Number, Transaction Type, Amount 2/28/2013, 2/20/2013, 1000, 1000, Buy, $100,000.00 2/28/2013, 2/21/2013, 1000, 1001, Buy, $50,000.00 2/28/2013, 2/22/2013, 1000, 1002, Buy, $40,000.00 2/28/2013, 2/22/2013, 1000, 1003, Transfer, $60,000.00 2/28/2013, 2/23/2013, 1000, 1004, Sell, $100,000.00 Net Position: $90,000.00 On Page 2 Portfolio: DEF Expiration Date, Trade Date, Master Ticket Number, Ticket Number, Transaction Type, Amount 2/28/2013, 2/20/2013, 1005, 1005, Buy, $100,000.00 2/28/2013, 2/22/2013, 1005, 1006, Sell, $100,000.00 On Page 3 Portfolio: XYZ Expiration Date, Trade Date, Master Ticket Number, Ticket Number, Transaction Type, Amount 2/28/2013, 2/18/2013, 1007, 1007, Buy, $100,000.00 2/28/2013, 2/22/2013, 1007, 1008, Buy, $100,000.00 Net Position: $0 2/28/2013, 2/10/2013, 1009, 1009, Buy, $100,000.00 2/28/2013, 2/22/2013, 1009, 1010, Sell, $60,000.00 Net Position: $40,000.00 So, the requirements are: 1. Whenever Portfolio changes, a new page should begin. One portfolio can span over multiple pages, and if it does, the page header "Portfolio: ABCDE" should repeat on each page. 2. Show in groups of Master Ticket Number. 3. If Ticket Type is "Type1", a calculated summary needs to be shown. 4. Summary to be calculated as {Add amount if "Buy", Subtract if "Sell", Ignore if "Transfer"} 5. Output should be PDF I am using PROC REPORT, and trying to do the following: define Portfolio / ORDER NOPRINT; define expiry / ORDER; define master_ticket / ORDER; define all others as DISPLAY; compute before _page_; line 'Portfolio: ' portfolio $6.; endcomp; compute after master_ticket; line 'Net Position: ' @321 calculated_amount.sum comma15.2; endcomp; break after portfolio / page; where in a previous data step, I have calculated the calculated_amount by multiplying the amount by +1, -1 or 0 based on Ticket Type. However, I am facing the issues with following requirements; 1. When the Portfolio changes, a new page is started, but if the portfolio has many transactions, the portfolio does not repeat on the next page. 2. I am not able to show the summary only for Ticket Type1. The summary comes for all currently, and users want it removed for Type2. 3. I am not able to align the summary amount perfectly to the amount column since this is a customized summary. Please let me know if you can help me with any of the above issues. Now I am wondering if PROC REPORT is the correct choice, or are there better suited choices for these kind of requirements? Thanks! Raj
... View more