(lc_xls) is Name Expression. A Name expression can replace a name in any command or function.
FIELDS clause is not a name but a list of column names. As such it cannot be replaced with Name Expression
>This works:
>
>lc_xls = "C:\myfile.xls"
>lc_fileldlist = "invno, invdte, invamt"
>COPY TO (lc_xls) FIELDS &lc_fieldlist TYPE xl5
>
>This gives a syntax error:
>lc_xls = "C:\myfile.xls"
>lc_fileldlist = "invno, invdte, invamt"
>COPY TO (lc_xls) FIELDS (lc_fieldlist) TYPE xl5
>
>Why?
--sb--