The SAS Output Delivery System and reporting techniques

re: Format Error Message

Reply
Regular Contributor
Posts: 228

re: Format Error Message

Hi...I am trying to insert a Error Message when a dataset has no records. I am creating a pdf file and would like to be able to format the text message so that it is left justified and continues onto the next line without breaking within a word. For example, right now it end the first line with "Janu" and continues onto the second line with "ary". Would like it to resemble the same format as if it would be typed in a Word document. Any help would be greatly appreciated....Thanks.

DATA _NULL_;

IF &nobs = 0 THEN DO;

FILE PRINT;

PUT "A query for the Purchase History for Client, John Smith, for the period of January 1, 2014 to December 31, 2014 has revealed that no purchases have been made for this client during this time period.";

END;

STOP;

RUN;

Super User
Posts: 11,134

Re: re: Format Error Message

With Put statements you need to control everything, including line counts and such. You could use multiple Put statements but changes to the output format or document properties may not look very good.

Or try File Print ODS and Put _ods_;

I would be very tempted to see if I could get an ODS Text statement to work.

I don't use PDF much but with RTF this would work.

ods text="A query for the Purchase History for Client, John Smith, for the period of January

1, 2014 to December 31, 2014 has revealed that no purchases have been made for this

client during this time period.";

Would work. For readability in a code editor I would break the line at which point you want a blank space at the beginning of each line for the ODS processor to put a space in the right spot. Also you may get a message about "current quote exceeds ..."

Ask a Question
Discussion stats
  • 1 reply
  • 442 views
  • 0 likes
  • 2 in conversation