Hi i have a code which export many datasets out. However, some of the datasets can be empty sometimes. Is there any command which i can use to export only non-empty data?
I don't know the neatest way in EG to do this, but you can use either DICTIONARY.TABLES or the ATTRN function to find out whether your input table(s) has observations or not, and combine this with some conditional logic using macro programming.
use open() and attrn function, you can get the attribution of the table such as variable number , if it is a empty table, the variable number should be 0
> use open() and attrn function, you can get the
> attribution of the table such as variable number , if
> it is a empty table, the variable number should be 0
The number of variables is not reduced to 0 if a dataset is empty, to find out how many observations are in a dataset use NOBS as second parameter for the attrn function.
Thanks so much everyone, I manage to find out the number of observation using the attrn function. However, does anybody knows how to link the following 2 codes together such that it only export data testing if it is non-empty? I tried '%if... then..." but it returns with error message.