/* Accepts the name of a possibly multivalued select list input from a web form. It will define and assign values to global macro variables corresponding to the one whose name is passed as the argument, but with the 0 and 1 suffixes. For example, if the call specifies an argument value of cnty and: cnty=123 --> cnty0=1 cnty1=&cnty [no cnty values] --> cnty0=0 cnty0=2 cnty1=015 cnty2=017 --> [nothing] Thus, the macro ensures that for multi-value parms, the corresponding parm0 and parm1 variables are defined, where parm0 contains the number of values passed for the parm and parm1 is a copy of parm. */ %macro mvparms(__v__); %global &__v__ &__v__.0 &__v__.1 &__v__.2 ; %*put &&__v__= &&&__v__ &&__v__.0= &&&__v__.0 &&__v__.2= &&&__v__.2; %if %quote(&&&__v__.2) eq %then %do; %if %quote(&&&__v__) eq %then %let &&__v__.0=0; %else %do; %let &&__v__.0=1; %let &&__v__.1=&&&__v__; %end; %end; %mend mvparms;