BookmarkSubscribeRSS Feed
twildone
Pyrite | Level 9

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;

1 REPLY 1
ballardw
Super User

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 ..."

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 935 views
  • 0 likes
  • 2 in conversation