12data work.varformat_test;
13 length str1 $1 num1 8 str2 $10 num2 8;
14 format str1 $1. num1 datetime19.;
22%mp_assertscope(SNAPSHOT)
23%put scope check:%mf_getvarformat(work.varformat_test,str1);
24%mp_assertscope(COMPARE,
25 desc=Checking that mf_getvarformat does not leak scope,
26 outds=work.test_results
30 iftrue=(%mf_getvarformat(work.varformat_test,str1)=$1.),
31 desc=Checking the format of a character variable is returned,
32 outds=work.test_results
36 iftrue=(%mf_getvarformat(work.varformat_test,num1)=DATETIME19.),
37 desc=Checking the format of a numeric variable is returned,
38 outds=work.test_results
42 iftrue=(%mf_getvarformat(work.varformat_test,str2,force=1)=$10.),
43 desc=Checking force=1 supplies a character
default of the variable length,
44 outds=work.test_results
48 iftrue=(%mf_getvarformat(work.varformat_test,num2,force=1)=best.),
49 desc=Checking force=1 supplies a numeric
default of best.,
50 outds=work.test_results
54 iftrue=(%length(%mf_getvarformat(work.varformat_test,nosuchvar))=0),
55 desc=Checking a variable that does not exist returns nothing,
56 outds=work.test_results
60 iftrue=(%length(%mf_getvarformat(work.no_such_dataset,str1))=0),
61 desc=Checking a dataset that cannot be opened returns nothing,
62 outds=work.test_results