Your code gives the following error.
num8. " " ----- 48 ERROR 48-59: The format NUM was not found or could not be loaded.
I substituted as in the following:
data have; a='abc'; b=1.23; c='xyzy'; output; a='ac'; b=11.23; c='xy'; output; a='ab'; b=111.23; c='x'; output; a='a'; b=1.2; c='zyz'; output; a='a'; b=1; c=' '; output; run;
data _null_; set sashelp.vcolumn (where=(libname="WORK" and memname="HAVE")) end=last; if _n_=1 then call execute('data _null_; file "g:\temp\test.txt"; set work.have; put '); if type='num' then call execute(cat(' ',name,' ',cats('best',length,'. " "'))); else call execute(cat(' ',name,' ',cats(type,length,'. " "'))); if last then call execute(';run;'); run;
however the result is not what I hoped.
1. the numeric column is not left aligned
2. I would like to know the position and the length of the field for each variable (as I have to document the data file)
... View more