In reply to Leonid Batkhan.

Hi Leonard,
I think Sample 24599 can mislead when it says "the files must have the same layout" - it really means little more than you can't change other file specification options (such as RECFM), it doesn't mean you can't arrange data elements in different orders, create repeating groups or anything like that. Using FILEVAR= has the advantage that you don't need to know the 'rec-types' or number of files being created before-hand, as you would with constructs like SELECT ... WHEN ...
In any case, if you're doing little else than PUTting the_INFILE_ variable to the output files then they'd effectively have the same 'layout'.
I've used this many times to implement data-driven ETL.