I tried to get the value label from a dynamic value in a roster.
But either it fills in blank, it just show the value with the code 1.
Here is the logic i used:
Code: Select all
PROC B01
preproc
// numeric indeks;
// do indeks = 1 while indeks in loadcase(NAMA_ART_DICT)
// if visualvalue(A5) = NORESP and visualvalue(NO_ART(indeks)) = KODEART then
// B01(indeks) = NAMAART;
// endif;
// enddo;
// do numeric indeks = 1 while indeks <= totocc(B_DAFTAR_ART000)
FindRespName = loadcase(NAMA_ART_DICT);
if visualvalue(A5) = NORESP and visualvalue(NO_ART) = KODEART then
B01 = NAMAART;
endif;
// enddo;
Code: Select all
PROC NO_ART
onfocus
numeric nextEntry = 1;
forcase LIST_ART_DICT where NO_RESP = A5 do
codes(nextEntry) = KODE_ART;
labels(nextEntry) = strip(NAMA_ART);
nextEntry = nextEntry + 1;
enddo;
codes(nextEntry) = notappl;
setvalueset($, codes, labels);
numeric vs_counter = 1;
do numeric vs_value = minvalue(NO_ART) while vs_value <= maxvalue(NO_ART)
// check if there is a label for this value, meaning that it is a valid option
if getlabel(NO_ART, vs_value) <> "" then
// make sure that this value hasn't been used
if not (NO_ART has vs_value) then
// add it to the value set
vs_codes(vs_counter) = vs_value;
vs_labels(vs_counter) = getlabel(NO_ART, vs_value);
inc(vs_counter);
endif;
endif;
enddo;
// end and set the value set
vs_codes(vs_counter) = notappl;
setvalueset(NO_ART, vs_codes, vs_labels);
Kindly please help me.
Warm Regards,
lusia