Concerning your earlier question, yes, ENFORM is a report writing tool, not a general-purpose database processing language. SQL isn't any better for the particular problem you were asking about, at least I cannot think of a way to avoid duplicating the expression within the SQL language.
As for your new question, the UNIQUE keyword does not work the way I believe you think it does. It eliminates records from the input that are the same in ALL columns, not just eliminating records that have the same value for a particular column. I do have to say that I'm not sure exactly what you want the command to do, so I'm not sure you misunderstood what DISTICT does.
I imagine the reason the command ran so long is that it had to do one or more sorts, and if the file is large, that could take a long time. I'm not sure, but I imagine ENFORM would do one sort on the full record to find any records that are identical and drop all but one of them. Then I imagine it would do a second sort to order the records using the key A,C,D to get the records in the order your LIST asks them to be. If the file happens to have its primary key or an alternate key that is composed of the fields A,C,D, then in the absence of the UNIQUE, it would not have to sort, but I think the results of the sort for UNIQUE will not have any keys, so two sorts would be needed. I supppose if ENFORM were really clever, it could do one sort on A,C,D,B and drop the duplicate records as it was doing the report, but I doubt it is that clever.
As to how you should write the LIST, I'm not sure. I don't know what you mean by "A, C and D would be a sample space for each unique values of B". If you wrote
LIST BY B, A, C, D;
ENFORM would sort the records by B if B were not a key and it would produce a report like:
B1 Ax1 Cx1 Dx1
Ax2 Cx2 Dx2
Ax3 Cx3 Dx3
B2 Ay1 Cy1 Dy1
B3 Az1 Cz1 Dz1
Az2 Cz2 Dz2
That is, the report would sort the records by B and produce a list that showed B only when it changed, but each record would be listed. The lines that have a blank where the value of B would appear really have the value of B that was last displayed above. The order of the records that have the same value for B would not be determined -- the sort key would be only B. I think the way the sort works, the records with a given value of B would appear in the order they appeared in the original file, but I believe that is not guaranteed.
If you wrote
LIST BY B, BY A, BY C, BY D;
that would sort the file with the key B,A,C,D and produce a listing similar to the above, except the values of A for a given value of B would be in order and if the value would duplicate the value above it, it would be replaced by blanks. And for a given value of B and A, the values of C would be in order and the value would be blank if it was the same as the value above it.
If you don't want a value to be blanked when it matches the value just above it, you can do that this way:
LIST BY B, BY A NOPRINT, BY C NOPRINT, BY D NOPRINT, A, C, D;
But, still, I feel that isn't what you want, since you seem to want to see only one record in the report for each distinct value of B, and neither of the above does that -- they only avoid printing the value of B when it matches the value in the previous record after sorting by B.
When you say you want the list to have unique values of B, I think that means that you want only one line to appear for each distinct value of B in the file. If that is correct, what do you want to see to the right of B in the report? Do you want to see something like the sum of the values in A for records that all have the same value of B? (It does not seem like that.) Do you somehow want to select just one of the records for each value of B, print the values of B, A, C, D from it and ignore the other records that have the same value of B? (If there is a way to do that, I don't know what it is.) Something else?
It might be that ENFORM can't do what you want to do and you would need to write a program to do it, but since I don't understand what you want, I can't say for sure that is the case.