@sasjs/core 4.49.0 → 4.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mp_ds2csv.sas +10 -1
- package/package.json +1 -1
package/base/mp_ds2csv.sas
CHANGED
|
@@ -118,13 +118,21 @@ data _null_;
|
|
|
118
118
|
header = cats(coalescec(varlabel(dsid,i),varnm),dlm);
|
|
119
119
|
%end;
|
|
120
120
|
%else %if &headerformat=SASJS %then %do;
|
|
121
|
-
|
|
121
|
+
vlen=varlen(dsid,i);
|
|
122
|
+
if vartype(dsid,i)='C' then header=cats(varnm,':$char',vlen,'.');
|
|
122
123
|
else do;
|
|
123
124
|
vfmt=coalescec(varfmt(dsid,i),'0');
|
|
124
125
|
fmttype=mcf_getfmttype(vfmt);
|
|
125
126
|
if fmttype='DATE' then header=cats(varnm,':date9.');
|
|
126
127
|
else if fmttype='DATETIME' then header=cats(varnm,':E8601DT26.6');
|
|
127
128
|
else if fmttype='TIME' then header=cats(varnm,':TIME12.');
|
|
129
|
+
/**
|
|
130
|
+
* there is not much point importing a short length numeric like this,
|
|
131
|
+
* eg with best4., as the resulting variable will still be stored as
|
|
132
|
+
* length 8. We need a length or format statement to ensure variable
|
|
133
|
+
* is creatd with the smaller length...
|
|
134
|
+
**/
|
|
135
|
+
else if vlen<8 then header=cats(varnm,':best',vlen,'.');
|
|
128
136
|
else header=cats(varnm,':best.');
|
|
129
137
|
end;
|
|
130
138
|
%end;
|
|
@@ -151,6 +159,7 @@ data _null_;
|
|
|
151
159
|
set &ds end=last;
|
|
152
160
|
%do i=1 %to &vcnt;
|
|
153
161
|
%let var=%scan(&varlist,&i);
|
|
162
|
+
%local vlen&i;
|
|
154
163
|
%if %mf_getvartype(&ds,&var)=C %then %do;
|
|
155
164
|
%let dsv1=%mf_getuniquename(prefix=csvcol1_);
|
|
156
165
|
%let dsv2=%mf_getuniquename(prefix=csvcol2_);
|
package/package.json
CHANGED