Additional Features

Writing Character Strings and Variable Values

You can use a PUT statement to write both character strings and variable values to a raw data file. To write out a character string, simply add a character string, enclosed in quotation marks, to the PUT statement. It's a good idea to include a blank space as the last character in the string to avoid spacing problems.
filename totaldat 'c:\records\junsales.txt'; 
data _null_; 
   set work.totals; 
   file totaldat; 
   put 'Sales for salesrep ' salesrep  
       'totaled ' sales : dollar9.; 
run;
SAS Data Set Work.Totals
SAS data set Work.Totals
Raw Data File Created Using the PUT Statement
For more information ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.