37%macro mp_updatevarlength(libds,var,len
40%
if %index(&libds,.)=0 %then %let libds=WORK.&libds;
42%mp_abort(iftrue=(%mf_existds(&libds)=0)
44 ,msg=%str(Table &libds not found!)
47%mp_abort(iftrue=(%mf_existvar(&libds,&var)=0)
49 ,msg=%str(Variable &var not found on &libds!)
53%mp_abort(iftrue=(%mf_getvartype(&libds,&var)=0)
55 ,msg=%str(Only character resizings are currently supported)
59%let oldlen=%mf_getvarlen(&libds,&var);
60%
if &oldlen=&len %then %
do;
61 %put &sysmacroname: Old and
new lengths (&len) match!;
65%let libds=%upcase(&libds);
69%local dsconst; %let dsconst=&syslast;
70%mp_getconstraints(lib=%scan(&libds,1,.),ds=%scan(&libds,2,.),outds=&dsconst)
72%mp_abort(iftrue=(&syscc ne 0)
74 ,msg=%str(syscc=&syscc)
77%
if %mf_getnobs(&dscont)=0 %then %
do;
80 alter table &libds modify &var char(&len);
86%mp_deleteconstraints(inds=&dsconst,outds=&dsconst._dropd,execute=YES)
89alter table &libds modify &var char(&len);
91%mp_createconstraints(inds=&dsconst,outds=&dsconst._addd,execute=YES)
93%mend mp_updatevarlength;