Hello,
In the LISTING destination, does anyone knows how to separate blocks with a line without the need of specifying the length?
The following code only works for the first 2 pages, but for the last one, the line is too long.
proc report data=sashelp.cars nowd ls=100 headline nocenter;
where Make in ('Acura','Cadillac');
columns ("--" Make--Length);
define make / order id;
define model / order id width=20;
compute after make;
line @3 "-------------------------------------------------------------------------------------------";
endcomp;
compute after;
line @3 "my footnote which will contain the page number,";
line @3 "the output name and other useful information.";
endcomp;
run;
I need something that works automatically because this code is for a macro which should handle several situations. Something like "--" in the column statement would be perfect, but as far as I know there is nothing similar in the compute statement.
This is the best I got, but it only adds lines under numeric variables, and adds empty space between columns.
proc report data=sashelp.cars nowd ls=100 headline nocenter width=100;
where Make in ('Acura','Cadillac');
columns ("--" Make--Length);
define make / order id;
define model / order id width=20;
break after make / ol;
compute after;
line @3 "my footnote which will contain the page number,";
line @3 "the output name and other useful information.";
endcomp;
run;
Thanks!!
Juan
With destination LISTING you have the "luxury" of being able to post-process the file with relative ease.
This example assumes that the first line is the spanning header that is the full width of the output. If you measure this line you can use that measurement to trim the LINE statement output that is too long.
For more complex output you will need alternative ways to find the optimal page with.
LINE %SYSFUNC( GETOPTION( LS))*'-' ;
Thanks Peter,
I believe this only works if I use the whole line size for my report, which is not the case. Besides, this would set the same line length for all pages in the report. In my case, the width of the report is different among pages.
Any other idea? I starting to believe that there is no simple answer to this basic requirement.
With destination LISTING you have the "luxury" of being able to post-process the file with relative ease.
This example assumes that the first line is the spanning header that is the full width of the output. If you measure this line you can use that measurement to trim the LINE statement output that is too long.
For more complex output you will need alternative ways to find the optimal page with.
Trimming the output, that was very smart.
I am very impressed, thanks. I will try to adapt it to use in my macro.
Regards, Juan
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.