Hi, I like to develop an macro to extract data from a big dataset. In the macro, I need to fetch all distinct values from the big dataset first to validate some parameter values provided by the user. If the parameter value match one of distinct variable values, then the parameter value provided is valid, otherwise write error message in the log or message window to list all distinct values to user. I know I can use %sysfunct(open()), %sysfunc(varnum()), &sysfunc(fetchobs()), etc to open and fetch an obs from it, however, this apparently doesn't meet my requirement as it only fetch one obs each time and it doesn't make sense to loop all dataset to find all distinct values of some var. I wonder there is any way to fetch all distinct values from a dataset during the macro process, I googled it and get nothing really useful. Thanks
... View more