CORE
mp_setkeyvalue.sas
Go to the documentation of this file.
1 
22 %macro mp_setkeyvalue(key,value,type=C,libds=work.mp_setkeyvalue);
23 
24  %if not (%mf_existds(&libds)) %then %do;
25  data &libds (index=(key/unique));
26  length key $32 valc $256 valn 8 type $1;
27  call missing(of _all_);
28  stop;
29  run;
30  %end;
31 
32  proc sql;
33  delete from &libds
34  where key=symget('key');
35  insert into &libds
36  set key=symget('key')
37  %if &type=C %then %do;
38  ,valc=symget('value')
39  ,type='C'
40  %end;
41  %else %do;
42  ,valn=symgetn('value')
43  ,type='N'
44  %end;
45  ;
46 
47  quit;
48 
49 %mend;