From 8b68c3bb271187af687c1d4267ab97f57906f910 Mon Sep 17 00:00:00 2001 From: Ivor Townsend Date: Fri, 17 Dec 2021 15:08:56 +0000 Subject: [PATCH] fix: check charvars and numvars exist. Closes #119 --- base/mp_makedata.sas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/mp_makedata.sas b/base/mp_makedata.sas index 4e1b40f..8f5c696 100644 --- a/base/mp_makedata.sas +++ b/base/mp_makedata.sas @@ -64,13 +64,13 @@ data &ds1; &n1=ranuni(1)*5000000; drop &c1 &n1; %let charvars=%mf_getvarlist(&libds,typefilter=C); - %do i=1 %to %sysfunc(countw(&charvars)); + %if &charvars ^= %then %do i=1 %to %sysfunc(countw(&charvars)); %let col=%scan(&charvars,&i); &col=subpad(&c1,1,%mf_getvarlen(&libds,&col)); %end; %let numvars=%mf_getvarlist(&libds,typefilter=N); - %do i=1 %to %sysfunc(countw(&numvars)); + %if &numvars ^= %then %do i=1 %to %sysfunc(countw(&numvars)); %let col=%scan(&numvars,&i); &col=&n1; %end;