I have a large input file that I need to break up into smaller files of 250 records. The size of the input file changes so the number of observations is never the same. Can I alter my code below to create multiple out files of 250 records?
Aside from a SAS-based solution, if you are licensed for DFSORT, there is a SPLIT function (part of OUTFIL coding, also, it uses the SPLITBY=nnn) to perform this function. No hassles with DCB= coding - very effective and can run on any LPAR (if you have a SAS-licensed LPAR arrangement).
Your post indicates that your input file (a plus 1 generation - maybe it's created earlier in the same job?) -- but you are attempting to generate DD statements from your SAS program *AND* in the same job/step (SAS DATA step) you are showing an INFILE / FILE combination to filter in some increments (one input file to "n" output files).
Suggest you review your SAS program processing in detail, as you have the "cart" before the "horse" -- you will need to investigate using FILENAME to dynamically allocate your output file from within your SAS program -- or if you must generate the JCL, you will need to have two jobs, one to generate the JCL (and that job will get submitted for execution), and the second "generated" jobstream will perform the data split.
However, given this thread, I still recommend you consider DFSORT (or a suitable alternative with your site's SORT package).
This continuing problem exists with the software used to host the SAS Discussion Forums. You will need to find some alternate technique to post some code, possibly leaving out or masking "special" characters, unfortunately.