You should dynamic value sets for this with the valueset object. You can read more about them in the help:
https://www.csprousers.org/help/CSPro/valuesets.html. You can also check out this blog post that gives some additional examples:
https://www.csprousers.org/posts/2019-0 ... bject.html
You have two procs where you need to create dynamic value sets based on the names entered in the first five questions. First you need to create a value set for the SMARTEST which will contain each of the names (NAME1, NAME2...). Declare a valueset object. Since this is a checkbox field it needs to be a string valueset so it can contain alpha codes. Then add each name to the value set with a code (A for the first name, B for the second...).
PROC SMARTEST
onfocus
valueset string smartestVs;
smartestVs.add(NAME1, "A");
smartestVs.add(NAME2, "B");
smartestVs.add(NAME3, "C");
smartestVs.add(NAME4, "D");
smartestVs.add(NAME5, "E");
setvalueset($, smartestVs);
For the BEST question, you want to create another value set but this time only for those names that were checked in SMARTEST. To do that use the pos function (
https://www.csprousers.org/help/CSPro/pos_function.html) to see if each of the options (A,B,C...) were checked in the previous questions and only add the ones that were picked from the first value set into the second:
PROC BEST
onfocus
valueset string bestVs;
if pos("A", SMARTEST) > 0 then
bestVs.add(NAME1, "A");
endif;
if pos("B", SMARTEST) > 0 then
bestVs.add(NAME2, "B");
endif;
if pos("C", SMARTEST) > 0 then
bestVs.add(NAME3, "C");
endif;
if pos("D", SMARTEST) > 0 then
bestVs.add(NAME4, "D");
endif;
if pos("E", SMARTEST) > 0 then
bestVs.add(NAME5, "E");
endif;
setvalueset($, bestVs);