Hi,
I am trying to create a report using ods pdf proc report and separating the dataset into separate tables on different pages using "BY Customer_Number". This part works fine. The problem I am having is that I would like extract the appropriate Customer_Number, Name and Address and placing these corresponding values in the title on each page that represent the appropriate data results. The dataset that I using for the report is similiar to the one below:
Customer_Number | Name | Address | Item_Number | Sale_Price |
1654 | Smith J. | 123 Lowe | 23127687 | 100.34 |
1654 | Smith J. | 123 Lowe | 32146745 | 54.35 |
1721 | Anderson B. | 34 Buffalo | 11450955 | 37.89 |
1922 | Rae S. | 6709 Mayfair | 78663456 | 115.78 |
I would like the pdf file to look like the following where the first row is actually the title:
1654 | Smith J. | 123 Lowe |
Item_Number | Sale_Price | |
23127687 | 100.34 | |
32146745 | 54.35 |
1721 | Anderson B. | 34 Buffalo |
Item_Number | Sale_Price | |
11450955 | 37.89 |
1922 | Rae S. | 6709 Mayfair |
Item_Number | Sale_Price | |
78663456 | 115.78 |
I wonder if someone can help...thanks...
data have; input (Customer_Number Name Address) (&$20.) Item_Number Sale_Price ; cards; 1654 Smith J. 123 Lowe 23127687 100.34 1654 Smith J. 123 Lowe 32146745 54.35 1721 Anderson B. 34 Buffalo 11450955 37.89 1922 Rae S. 6709 Mayfair 78663456 115.78 ; run; proc report data=have nowd noheader; column Customer_Number Name Address dummy Item_Number Sale_Price; define Customer_Number /order noprint; define Name /order noprint; define Address /order noprint; define dummy/computed ; compute dummy/char length=10; dummy=' '; endcomp; compute before Address ; line @1 Customer_Number $20. +4 Name $20. +4 Address $20. ; line @22 "Item_Number" +20 "Sale_Price"; endcomp; quit;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.