JCL sort example using dfsort (Outrec parameter).



Free Tips, Tutorials, and Examples

Main Page    Submit Question or Tip     View List

Detailed Description:

JCL sort is actually really easy to do and very easy to limit the number or columns or positions on the output file. You simply just call the sort job, pass it the files, and tell it the parms on what type of sorting you want and also what data you want to appear on the output result file, and what limitations if any. For example, if you want your JCL to only include a certain fields or columns on the final result file, just use the sample parms on your sysin as shown:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,92,C'80',93,10) (This is simple. What this means is that you want your output file to show only the first 92 bytes of the input file (i.e. position 1 to 92), and then followed by a hard coded 80 (you are telling it to put a 2 byte character there which is 80), and then followed by the next 10 bytes of your input file (i.e. you are telling it to then copy to the output file whatever is in position 93 of the input file, for 10 bytes). The outrec example is simple once you use it a few times. Basically you are just identifying what field on the input to be included on the output, and its called the outrec parameter.


This site provides a list of interesting subjects, tips, and tricks. Although it is mostly computer tips, there are also tips and tricks related to various other helpful topics besides just computers. If you have an important tip that you think should be listed, feel free to post it below. Although I still take tips via email, I often scan and review posts on the page below and prefer that method.

Submit Tip or Ask Question:

Post It Here

View Other Databases:

View All Tips and Tricks
Spyware and System Task Database