I do have an input file. I have to split the files based on a key and send it to FTP server. Issue here is I am not sure of how many unique keys the input file will have. if there are 3 keys then 3 files needs to be created. If there are 5 keys, 5 files needs to be created.
You could dynamically build your split JCL using a DFSORT step and then submit it through internal reader. But if you're planning to implement this in production, you might want to follow the programming approach depending on your site standards and policies.