From 92f575551d073d8037c8fe9ef191596993e64e2d Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 Feb 2024 10:26:33 +0000 Subject: [PATCH] chore: updating all.sas --- all.sas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/all.sas b/all.sas index 87abdc53..46f5644d 100644 --- a/all.sas +++ b/all.sas @@ -5541,13 +5541,21 @@ data _null_; header = cats(coalescec(varlabel(dsid,i),varnm),dlm); %end; %else %if &headerformat=SASJS %then %do; - if vartype(dsid,i)='C' then header=cats(varnm,':$char',varlen(dsid,i),'.'); + vlen=varlen(dsid,i); + if vartype(dsid,i)='C' then header=cats(varnm,':$char',vlen,'.'); else do; vfmt=coalescec(varfmt(dsid,i),'0'); fmttype=mcf_getfmttype(vfmt); if fmttype='DATE' then header=cats(varnm,':date9.'); else if fmttype='DATETIME' then header=cats(varnm,':E8601DT26.6'); else if fmttype='TIME' then header=cats(varnm,':TIME12.'); + /** + * there is not much point importing a short length numeric like this, + * eg with best4., as the resulting variable will still be stored as + * length 8. We need a length or format statement to ensure variable + * is creatd with the smaller length... + **/ + else if vlen<8 then header=cats(varnm,':best',vlen,'.'); else header=cats(varnm,':best.'); end; %end; @@ -5574,6 +5582,7 @@ data _null_; set &ds end=last; %do i=1 %to &vcnt; %let var=%scan(&varlist,&i); + %local vlen&i; %if %mf_getvartype(&ds,&var)=C %then %do; %let dsv1=%mf_getuniquename(prefix=csvcol1_); %let dsv2=%mf_getuniquename(prefix=csvcol2_);