diff --git a/base/mp_ds2cards.sas b/base/mp_ds2cards.sas index 379620c..626439b 100644 --- a/base/mp_ds2cards.sas +++ b/base/mp_ds2cards.sas @@ -139,8 +139,9 @@ create table datalines1 as /** Due to long decimals cannot use best. format So - use bestd. format and then use character functions to strip trailing - zeros, if NOT an integer!! - resolved code = ifc(int(VARIABLE)=VARIABLE + zeros, if NOT an integer or missing!! Cannot use int() as it upsets + note2err when there are missings. + resolved code = ifc( mod(coalesce(VARIABLE,0),1)=0 ,put(VARIABLE,best32.) ,substrn(put(VARIABLE,bestd32.),1 ,findc(put(VARIABLE,bestd32.),'0','TBK'))); @@ -151,7 +152,7 @@ data datalines_2; set datalines1 (where=(upcase(name) not in ('PROCESSED_DTTM','VALID_FROM_DTTM','VALID_TO_DTTM'))); if type='num' then dataline= - cats('ifc(int(',name,')=',name,' + cats('ifc(mod(coalesce(',name,',0),1)=0 ,put(',name,',best32.-l) ,substrn(put(',name,',bestd32.-l),1 ,findc(put(',name,',bestd32.-l),"0","TBK")))'); diff --git a/base/mp_ds2csv.sas b/base/mp_ds2csv.sas index 3b3d533..1b556be 100644 --- a/base/mp_ds2csv.sas +++ b/base/mp_ds2csv.sas @@ -41,7 +41,7 @@ data _null_; dsid=open("&ds.","i"); num=attrn(dsid,"nvars"); do i=1 to num; - header = trim(left(coalescec(varlabel(dsid,i),varname(dsid,i)))); + header = cats(coalescec(varlabel(dsid,i),varname(dsid,i))); put header @; end; rc=close(dsid); diff --git a/base/mp_filtercheck.sas b/base/mp_filtercheck.sas index 40ebc5b..7159dee 100644 --- a/base/mp_filtercheck.sas +++ b/base/mp_filtercheck.sas @@ -109,7 +109,7 @@ data &outds; output; end; if mod(SUBGROUP_ID,1) ne 0 then do; - REASON_CD='SUBGROUP_ID should be integer, not '!!left(subgroup_id); + REASON_CD='SUBGROUP_ID should be integer, not '!!cats(subgroup_id); putlog REASON_CD= SUBGROUP_ID=; call symputx('reason_cd',reason_cd,'l'); call symputx('nobs',_n_,'l'); @@ -127,7 +127,7 @@ data &outds; if OPERATOR_NM not in ('=','>','<','<=','>=','BETWEEN','IN','NOT IN','NE','CONTAINS') then do; - REASON_CD='Invalid OPERATOR_NM: '!!left(OPERATOR_NM); + REASON_CD='Invalid OPERATOR_NM: '!!cats(OPERATOR_NM); putlog REASON_CD= OPERATOR_NM=; call symputx('reason_cd',reason_cd,'l'); call symputx('nobs',_n_,'l'); diff --git a/base/mp_getddl.sas b/base/mp_getddl.sas index b60f522..5adadfc 100644 --- a/base/mp_getddl.sas +++ b/base/mp_getddl.sas @@ -158,7 +158,7 @@ run; lab=" label="!!cats("'",tranwrd(label,"'","''"),"'"); if notnull='yes' then notnul=' not null'; if type='char' then typ=cats('char(',length,')'); - else if length ne 8 then typ='num length='!!left(length); + else if length ne 8 then typ='num length='!!cats(length); else typ='num'; put name typ fmt notnul lab; run; diff --git a/base/mp_init.sas b/base/mp_init.sas index f88fbb7..47fd2eb 100644 --- a/base/mp_init.sas +++ b/base/mp_init.sas @@ -51,6 +51,7 @@ noautocorrect /* disallow misspelled procedure names */ compress=CHAR /* default is none so ensure we have something! */ datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */ + dsoptions=note2err /* undocumented - convert bad NOTEs to ERRs */ %str(err)orcheck=STRICT /* catch errs in libname/filename statements */ fmterr /* ensure err when a format cannot be found */ mergenoby=%str(ERR)OR /* throw err when a merge has no BY variables */ diff --git a/base/mp_testservice.sas b/base/mp_testservice.sas index 3b70649..b16a991 100644 --- a/base/mp_testservice.sas +++ b/base/mp_testservice.sas @@ -76,7 +76,7 @@ else do; x+1; call symputx(name,quote(cats(value)),'l'); - call symputx('pval'!!left(x),name,'l'); + call symputx(cats('pval',x),name,'l'); call symputx('pcnt',x,'l'); end; run; diff --git a/base/mp_validatecol.sas b/base/mp_validatecol.sas index ae25cca..9294813 100644 --- a/base/mp_validatecol.sas +++ b/base/mp_validatecol.sas @@ -48,9 +48,11 @@ %let tempcol=%mf_getuniquename(); %if &rule=ISINT %then %do; - &tempcol=input(&incol,?? best32.); &outcol=0; - if not missing(&tempcol) then if mod(&incol,1)=0 then &outcol=1; + if not missing(&incol) then do; + &tempcol=input(&incol,?? best32.); + if not missing(&tempcol) then if mod(&tempcol,1)=0 then &outcol=1; + end; drop &tempcol; %end; %else %if &rule=ISNUM %then %do; diff --git a/meta/mm_getservercontexts.sas b/meta/mm_getservercontexts.sas index 99fc69f..4d8d2a7 100644 --- a/meta/mm_getservercontexts.sas +++ b/meta/mm_getservercontexts.sas @@ -35,7 +35,7 @@ data _null_; set repos; where repositorytype in('CUSTOM','FOUNDATION'); keep id name ; - call symputx('repo'!!left(_n_),name,'l'); + call symputx(cats('repo',_n_),name,'l'); call symputx('repocnt',_n_,'l'); run; diff --git a/meta/mm_webout.sas b/meta/mm_webout.sas index 9e9e5dd..64370e6 100644 --- a/meta/mm_webout.sas +++ b/meta/mm_webout.sas @@ -122,7 +122,7 @@ set &tempds; if not (upcase(name) =:"DATA"); /* ignore temp datasets */ i+1; - call symputx('wt'!!left(i),name,'l'); + call symputx(cats('wt',i),name,'l'); call symputx('wtcnt',i,'l'); data _null_; file &fref mod encoding='utf-8'; put ",""WORK"":{"; @@ -166,6 +166,7 @@ put ',"SYSVLONG" : ' sysvlong; put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" "; put ',"END_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '" '; + length memsize $32; memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; memsize=quote(cats(memsize)); put ',"MEMSIZE" : ' memsize; diff --git a/server/ms_webout.sas b/server/ms_webout.sas index f531a81..a14c257 100644 --- a/server/ms_webout.sas +++ b/server/ms_webout.sas @@ -114,7 +114,7 @@ set &tempds; if not (upcase(name) =:"DATA"); /* ignore temp datasets */ i+1; - call symputx('wt'!!left(i),name,'l'); + call symputx(cats('wt',i),name,'l'); call symputx('wtcnt',i,'l'); data _null_; file &fref mod encoding='utf-8' termstr=lf; put ",""WORK"":{"; @@ -165,6 +165,7 @@ length autoexec $512; autoexec=quote(urlencode(trim(getoption('autoexec')))); put ',"AUTOEXEC" : ' autoexec; + length memsize $32; memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)"; memsize=quote(cats(memsize)); put ',"MEMSIZE" : ' memsize; diff --git a/tests/crossplatform/mp_validatecol.test.sas b/tests/crossplatform/mp_validatecol.test.sas index 64c66a9..766752e 100644 --- a/tests/crossplatform/mp_validatecol.test.sas +++ b/tests/crossplatform/mp_validatecol.test.sas @@ -112,6 +112,9 @@ datalines4; 0 above are good the rest are bad +0.1 +1.1 +-0.001 %abort 1&somethingverybad. & diff --git a/tests/testinit.sas b/tests/testinit.sas index 5019170..e1026ea 100644 --- a/tests/testinit.sas +++ b/tests/testinit.sas @@ -4,6 +4,7 @@