I have been trying to export a SAS data set with 49 variables. Each of these variables can potentially be 32767 characters long. I want to write this data set to a txt file, but SAS limits me with the lrecl
option at 32767 characters. Is there a way to do this? I tried using the data step.
data _null_;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
%let _EFIREC_ = 0; /* clear export record count macro variable */
file 'C:path\TEST.txt';
if _n_ = 1 then do;
put "<BLAH>"
;
end;
set WORK.SAS_DATASET end=EFIEOD;
format raw1 $32767. ;
format raw2 $32767. ;
etc...
do;
EFIOUT + 1;
put raw1 $ @;
put raw2 $ @;
etc...
;
end;
if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
if EFIEOD then
do;
put "</BLAH>"
;
call symputx('_EFIREC_',EFIOUT);
end;
run;