if you’ll put the file into a separate library then use CHGCURLIB before executing your ftp script. Another option is to do a LCD YOURLIB (local change directory) within your script.
Create a ‘template’ script with a line like PUT @@@@@@@@@@
Copy the template into your QTEMP file before running FTP.
Create a QM query that UPDATEs the script replacing either the entire PUT line or just the special characters with whatever is needed.
Then run FTP.