You can specify DYNAMIC or EXTERNAL in the ASSIGN clause of a file description entry only if the filename is contained in a data item rather than given as a literal filename.
Resolution:
Redesign your program so that the filename is contained in a data item.