put _all_;
but this is definitely not recommended. The result of this technique cannot easily be described; try it some time, and you'll see why it should be avoided.
Unlike most SAS DATA steps, the DATA step used to write out raw data usually does not need to create and keep a SAS Data Set, so typically people will use a DATA _NULL_; statement. SAS also needs to know what file to put the raw data into, and this is specified by the FILE statement.
Suppose you have a SAS Data Set called MYTRY, which you created at some point earlier in your session. (You can also use SAS Data Sets saved permanently from previous sessions or jobs, by using a LIBNAME statement and a two-level name in the SET statement.) MYTRY has 100 observations, and ten variables called:
ID SEX AGE RACE TEST1 TEST2 HEIGHT WEIGHT IQ INCOME
Now, you want to create an ASCII (raw) file containing only three of those variables. This is how your program might look (the FILE statement example is for the UNIX environment; modify the external-file specifications accordingly for use on Windows or Macintosh files):
data _null_; set mytry;
file '~/rawinfo.dat';
put id test1 income;
run;
This will create (or overwrite) a file called rawinfo.dat in the home directory, and the file will contain all the values for ID, TEST1 and INCOME, separated from the other values by a single space.
Sometimes you have variables whose values aren't always the same number of digits or characters. In that case, the program above would output the values, but they would not line up. If you want values to be put in specific columns, regardless of their length, add column pointers (@n) to the PUT statement, as in the following example (the FILE statement example is for the UNIX environment; modify the external-file specifications accordingly for use on Windows or Macintosh files):
data _null_; set mytry;
file '~/rawinfo.dat';
put @1 id @10 test1 @20 income;
run;
data _null_; set mytry;
file '~/rawinfo.dat';
put id--income;
run;