If I do this:
data mydata;
input dept : $10. jan : numx. feb : numx8.2 mar comma8.3;
datalines;
hoes 4344 35555 26664
ousewares 3777 48886 79998
pliances 5311 71223 41333
;
PROC EXPORT DATA= mydata OUTFILE= testtxtfile dbms= tab replace;
PUTNAMES=YES;
run;
I get testtxtfile that looks like:
dept jan feb mar
hoes 4344 355.55 26.664
ousewares 3777 488.86 79.998
pliances 5311 712.23 41.333
But then if you go look in the log where the PROC Export ran you will see this:
data _null_;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
%let _EFIREC_ = 0; /* clear export record count macro variable */
file 'TESTTXTFILE' delimiter='09'x DSD DROPOVER lrecl=32767;
if _n_ = 1 then /* write column names or labels */
do;
put
"dept"
'09'x
"jan"
'09'x
"feb"
'09'x
"mar"
;
end;
set MYDATA end=EFIEOD;
format dept $10. ;
format jan best12. ;
format feb best12. ; format mar best12. ;
do;
EFIOUT + 1;
put dept $ @;
put jan @;
put feb @;
put mar ;
;
end;
if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
if EFIEOD then call symputx('_EFIREC_',EFIOUT);
run;
If you then replace your Proc Export with that code, and change
format mar best12.
to
format mar numx8.3.
I get this output:
dept jan feb mar
hoes 4344 355.55 26,664
ousewares 3777 488.86 79,998
pliances 5311 712.23 41,333
which is what I think you want.
Roundabout, and I'm sure there is a better way, but it gets there.
... View more