16create table work.maxkeytable(
17 keytable varchar(41) label=
'Base table in libref.dataset format',
18 keycolumn
char(32) format=$32.
19 label=
'The Retained key field containing the key values.',
21 'Integer representing current max RK or SK value in the KEYTABLE',
22 processed_dttm num format=E8601DT26.6
23 label=
'Datetime this value was last updated',
24 constraint pk_mpe_maxkeyvalues
25 primary key(keytable));
27create table work.locktable(
30 lock_status_cd
char(10) not
null,
31 lock_user_nm
char(100) not
null ,
34 lock_start_dttm num format=E8601DT26.6,
35 lock_end_dttm num format=E8601DT26.6,
36 constraint pk_mp_lockanytable primary key(lock_lib,lock_ds));
45 if mod(_n_,2)=0 then name=cats(
'New',_n_);
56 ,append_dsn=APPENDTABLE
67 desc=Checking errors in test 1,
68 outds=work.test_results
72 do val=1,3,5,20,21,22;
76%mp_assertcolvals(work.append.rk_col,
77 checkvals=work.check.val,
78 desc=All values have a match,
88data work.appendtable2;
97%mp_retainedkey(base_dsn=targetds2
98 ,append_dsn=APPENDTABLE2
101 ,check_uniqueness=YES
102 ,maxkeytable=x.maxkeytable
103 ,locktable=work.locktable
109 desc=Checking errors in test 2,
110 outds=work.test_results
113 iftrue=(%mf_nobs(work.append2)=21),
114 desc=Checking append records created,
115 outds=work.test_results