16create table test as select * from dictionary.tables where libname=
'SASHELP';
22 libds=cats(
'sashelp.',memname);
23 if exist(libds) then line=cats(
'%mp_ds2fmtds(',libds,
',',memname,
')');
29 length
id $6 label $6 amount when 8;
30 format label $char12. amount comma12.2 when yymmdd10.;
31 id=
'A'; label=
'First'; amount=12.5; when=
'02JAN2024'd; output;
32 id=
'B'; label=
'Second'; amount=-3.25; when=
'31DEC2023'd; output;
35%mp_assertscope(SNAPSHOT)
36%mp_ds2fmtds(work.fmt_input,work.fmt_output)
37%mp_assertscope(COMPARE,
38 desc=Formatted dataset conversion does not leak macro variables,
39 outds=work.test_results
43 length
id $6 label $12 amount when $24;
44 call missing(
id,label,amount,when);
48%mp_assertmodel(work.fmt_output,base=work.fmt_model,key=
id,
49 desc=Formatted dataset model and key,
50 outds=work.test_results
53%mp_assertdsobs(work.fmt_output,
55 desc=Formatted dataset has both rows,
56 outds=work.test_results
61 if not ((
id=
'A' and label='First' and amount='12.50'
62 and when='2024-01-02')
63 or (
id=
'B' and label='Second' and amount='-3.25'
64 and when='2023-12-31'));
67%mp_assertdsobs(work.fmt_bad,
69 desc=Formatted values match the input rows,
70 outds=work.test_results
78 desc=Checking tables were created successfully,
79 outds=work.test_results