A flat file of fixed length 80 bytes has a numeric value from 01 to 99 in the first two positions. Based on this value, we need to split this file into 99 different files. For example, if the Value is 01, it should write to FILE01, if it has a Value 02, it should write to FILE02 and so on.
I know, I can use OUTFIL FNAMES and INCLUDE COND parameters to achieve this. But in doing so I need to write 99 such statements.
If you are leaning towards a solution to dynamically build sort control statements then you can use sample job as below which requires an extra input file with sequence number from 01-99 (or any number you want).
Below is an example for 4 files only but you will get the idea. Alternatively, you can create a sequence number file using SORT or other utility as well. You can also create entire JCL dynamically (if you don't want to code 99 FILE01-FILE99 dd statements) and submit through INTRDR.