In SAS 9 data step, even with the varchar() type, there are restrictions on the size of a variable that can be processed.

Fortunately with direct macro processing, large variables (up to approx 65k) can be written directly from macro variables into text files using an approach like the following:

%let filrf=somefile;
%let rc=%sysfunc(filename(filrf, 
   %sysfunc(pathname(work))/test2.txt));
%let fid=%sysfunc(fopen(&filrf,o,0,P));
%let a=%sysfunc(repeat(A,65000));

%let rc=%sysfunc(fput(&fid,&a));
%let rc=%sysfunc(fwrite(&fid));
%let rc=%sysfunc(fclose(&fid));