Good day all,
I have a report with me in sas format which needs to be formatted to the sample provided.
The sample report is -
data bike;
input bike $ sales engine comp stock;
datalines;
A 1 1 23 30
B 4 3 21 27
Tot_med 5 4 44 57
C 4 3 27 21
D 5 2 31 36
Tot_sup 6 34 58 57
;
I want the final report to look like the attached format.
Can someone please suggest and guide how it can be achieved in Proc Report.
Also, if it can be done in any other SAS procedure more easily. Please suggest.
Regards,
Rishi
@75063 wrote:
Thank you for your reply and I stand corrected that I should have mentioned that I want the reports to come one after the other in the order.
I still have a doubt.
What if my two reports came from two entirely different data-sets having no common variables in the two reports.
Can i still have the output of the reports in the same page one after the other with two blank spaces in them?
You can control that. As long as the tables can fit on the page you can set it up that way. In ODS PDF you would use STARTPAGE to control when a new page is started. I’m not sure how to control the number of spaces between the tables, in ODS TAGSETS.EXCELXP you would use the SKIP_SPACE option to control the spacing between tables. If a similar option isn’t available for the destination you’re using you can try ODS LAYOUT and ODS DOCUMENT or PROC TEMPLATE but that adds another level of complexity to your reports.
There is no report sample shown. If you choose to attach a report, it should not be in Microsoft Office (Word, Excel Powerpoint) format as these are considered security risks. Use PDF or TXT or PNG or GIF.
Thank you for the clarification regarding attaching the report format. I have attached a pdf format now.
1. Rather than include summaries in your data, I would let the PROC REPORT/PRINT do that instead
2. Add a grouping variable so that you know the first two records belong to the MED group and the last two to the SUP group.
3. Try with PROC PRINT - SUM statement. If that doesn't meet your needs then move on to the PROC REPORT option.
4. PROC REPORT with a RBREAK and SUMMARIZE option. See some of the examples here with code:
@75063 wrote:
Is it possible to concatenate two or more proc reports?
What do you mean by concatenate?
They can come one after the other in the output.
You can split a data set into distinctive sections using BY or BREAK statements depending on your needs.
Thank you for your reply and I stand corrected that I should have mentioned that I want the reports to come one after the other in the order.
I still have a doubt.
What if my two reports came from two entirely different data-sets having no common variables in the two reports.
Can i still have the output of the reports in the same page one after the other with two blank spaces in them?
@75063 wrote:
Thank you for your reply and I stand corrected that I should have mentioned that I want the reports to come one after the other in the order.
I still have a doubt.
What if my two reports came from two entirely different data-sets having no common variables in the two reports.
Can i still have the output of the reports in the same page one after the other with two blank spaces in them?
You can control that. As long as the tables can fit on the page you can set it up that way. In ODS PDF you would use STARTPAGE to control when a new page is started. I’m not sure how to control the number of spaces between the tables, in ODS TAGSETS.EXCELXP you would use the SKIP_SPACE option to control the spacing between tables. If a similar option isn’t available for the destination you’re using you can try ODS LAYOUT and ODS DOCUMENT or PROC TEMPLATE but that adds another level of complexity to your reports.
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: