I am too lazy presently to locate any specifics [beyond to suggest
reviewing second level text from DSPMSGD SQL0449 QSQLMSG], but the
solution is likely both to ensure the proper PATH is established before
issuing the CREATE request and\or to specify the external name within
apostrophes [as delimiters] along with including the library name. Thus
on the second-to-last line, specifying the following should resolve:
EXTERNAL NAME 'TheLibraryName/DATE2ISO(DATE2ISO)'
Or as an old-release copy of the text for the -449 sqlcode suggests,
"The external program name for a procedure or function must be of the
form 'library-name/program-name' or
'library-name/program-name(entry-point-name)'."