Code
#**
#* To check if all members of a customer group are flagged as "Base contract"
#* @return 0- Not flagged; 1- Flagged as Base contract
#*!
Funprog ISGCBC
Local Integer VRETURN: [L]VRETURN=1
If !clalev([F:YYBPC]): Local File BPCUSTOMER[YYBPC] : Endif
Columns [F:YYBPC](BPCNUM,YBPCGRP,YBASECONFLG) #Required columns only
Local Char YFILTER(250)
[L]YFILTER = "YBPCGRP='" + [M:YCC0]BPCGRP + "'"
For [F:YYBPC]reckey Where evalue(YFILTER) #reckey indicates no Order By is necessary. More efficient.
If [F:YYBPC]YBASECONFLG<>2 Then
[L]VRETURN=0
Break
Endif
Next
End [L]VRETURNre