But it does not work.
This is a TOTALLY useless statement to make. Among other things, you could mean (and could have said to clarify for us):
- your FTP job is failing with JCL error before executing
- your FTP job is executing but one of the FTP sub-commands is failing
- your FTP job is executing but giving an error
- your FTP job is executing but the input data set has a problem
- your FTP job is executing but the output data set is not recognizable
- your FTP job is executing but the output data set has unrecognizable data
As a wild guess, I would say that probably you have discovered that FTP does not substitute YYMMDD and HHMMSS with the date and time. And this is normal because FTP does not have any variables for date or time. The usual way to resolve this is to build the FTP sub-commands in the language of your choice (PERL and Unix shell script are both common, but even COBOL can be used) in one job step, then the next job step executes FTP with the input being the data set you just created.