Hi, I'm practicing the following program on the book of learning sas through examples on SAS Studio. But the result is not as demonstrated on the book, there's no line wrapping, no expected column widths... I dont know why? Thanks in advance!
Program 15.7: Demonstrating the FLOW Option with PROC REPORT
title "Demonstrating the FLOW Option";
proc report data=Learn.Medical headline
split=' ' ls=74;
column Patno VisitDate DX HR Weight Comment;
define Patno / "Patient Number" width=7;
define VisitDate / "Visit Date" width=9 format=date9.;
define DX / "DX Code" width=4 right;
define HR / "Heart Rate" width=6;
define Weight / width=6;
define Comment / width=30 flow;
run;
For some unknown reason SAS does not have any feature in SAS/Studio to display normal output files. Only the LOG and ODS outputs.
Write the output to a file and then open it yourself.
ods listing file="~/listing.txt";
You could add a step to dump the file to the log.
data _null_;
infile "~/listing.txt";
input;
put _infile_;
run;
Flow and width options only apply to the LISTING output destination.
For example from the on line help:
FLOW
wraps the value of a character variable in its column. The FLOW option honors the split character. If the text contains no split character, then PROC REPORT tries to split text at a blank.
Restriction This option affects only the LISTING output. It has no affect on other ODS output.
Unless you have an ODS LISTING, or have changed the output to listing you will not see the Flow behavior in HTML, RTF, PDF, EXCEL or any other ODS destination.
Because Proc Report has been around a long time it has many options involved for sending output essentially direct to line printers or text files that emulate line priter behavior, which is ODS LISTING. If you do not include an option to send the output to LISTING you will not see any change in output.
@wxzhai wrote:
Hi, I'm practicing the following program on the book of learning sas through examples on SAS Studio. But the result is not as demonstrated on the book, there's no line wrapping, no expected column widths... I dont know why? Thanks in advance!
Program 15.7: Demonstrating the FLOW Option with PROC REPORT
title "Demonstrating the FLOW Option";
proc report data=Learn.Medical headline
split=' ' ls=74;
column Patno VisitDate DX HR Weight Comment;
define Patno / "Patient Number" width=7;
define VisitDate / "Visit Date" width=9 format=date9.;
define DX / "DX Code" width=4 right;
define HR / "Heart Rate" width=6;
define Weight / width=6;
define Comment / width=30 flow;
run;
Thank you!
Do you mean something like this:
ods listing;
title "Demonstrating the FLOW Option";
proc report data=Learn.Medical headline
split=' ' ls=74;
column Patno VisitDate DX HR Weight Comment;
define Patno / "Patient Number" width=7;
define VisitDate / "Visit Date" width=9 format=date9.;
define DX / "DX Code" width=4 right;
define HR / "Heart Rate" width=6;
define Weight / width=6;
define Comment / width=30 flow;
run;
Yes but you will have to look to the listing output window, not the typical "results" window.
But I can't see the listing window you said. The following is what my SAS studio shows:
For some unknown reason SAS does not have any feature in SAS/Studio to display normal output files. Only the LOG and ODS outputs.
Write the output to a file and then open it yourself.
ods listing file="~/listing.txt";
You could add a step to dump the file to the log.
data _null_;
infile "~/listing.txt";
input;
put _infile_;
run;
Thank you so much! It worked.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.