1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-08 18:00:06 +00:00

fix: all the fixings

This commit is contained in:
Allan Bowe
2022-05-03 15:46:15 +00:00
parent e0469be0d8
commit 4a8f7bb014
5 changed files with 80 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
<h4> SAS Macros </h4>
@li mf_getvarcount.sas
@li mp_assertscope.sas
**/
@@ -13,6 +14,10 @@ data work.all work.nums(keep=num1 num2) work.chars(keep=char1 char2);
output;
run;
%mp_assertscope(SNAPSHOT)
%put scope check:%mf_getvarcount(work.all);
%mp_assertscope(COMPARE)
%mp_assert(
iftrue=(%mf_getvarcount(work.all)=5),
desc=%str(Checking for mixed vars),

View File

@@ -10,10 +10,48 @@
**/
data work.class ;
attrib
Name length= $8
Sex length= $1
Age length= 8
Height length= 8
Weight length= 8
;
infile cards dsd;
input
Name :$char.
Sex :$char.
Age
Height
Weight
;
datalines4;
Alfred,M,14,69,112.5
Alice,F,13,56.5,84
Barbara,F,13,65.3,98
Carol,F,14,62.8,102.5
Henry,M,14,63.5,102.5
James,M,12,57.3,83
Jane,F,12,59.8,84.5
Janet,F,15,62.5,112.5
Jeffrey,M,13,62.5,84
John,M,12,59,99.5
Joyce,F,11,51.3,50.5
Judy,F,14,64.3,90
Louise,F,12,56.3,77
Mary,F,15,66.5,112
Philip,M,16,72,150
Robert,M,12,64.8,128
Ronald,M,15,67,133
Thomas,M,11,57.5,85
William,M,15,66.5,112
;;;;
run;
/* regular usage */
%mp_assertscope(SNAPSHOT)
%mp_getmaxvarlengths(sashelp.class,outds=work.myds)
%mp_getmaxvarlengths(work.class,outds=work.myds)
%mp_assertscope(COMPARE,desc=checking scope leakage on mp_getmaxvarlengths)
%mp_assert(
iftrue=(&syscc=0),