z/OS DFSORT: Getting Started
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


JCL for merging data sets directly

z/OS DFSORT: Getting Started
SC23-6880-00

As in a sort, the JCL you need depends on whether you run DFSORT directly or call it from a program. This chapter only discusses running DFSORT directly.

The JCL needed for a merge is the same as that for a sort, with the following exceptions:
  • You do not need dynamic allocation of work data sets or SORTWKdd DD statements.
  • Instead of the SORTIN DD statement, you use SORTINnn DD statements to define the input data sets. The SORTINnn DD statements name the input data sets, and tell how many data sets will be merged. You need one SORTINnn DD statement for each data set being merged. nn in SORTINnn is a number from 00 to 99. Thus, if you wanted to merge 5 data sets, you would typically use DD statements for SORTIN01, SORTIN02, SORTIN03, SORTIN04 and SORTIN05.

To merge the pre-sorted bookstore data set and the data set containing the new records, code the following JCL statements for this example. The new data set is called A123456.NEW and the sorted version of the bookstore data set is called A123456.MASTER. For this example, it is assumed that the input data sets are cataloged and that the output data set will be cataloged.

//EXAMP    JOB  A492,PROGRAMMER
//MERGE    EXEC PGM=SORT
//SYSOUT   DD   SYSOUT=A
//SORTIN01 DD   DSN=A123456.MASTER,DISP=SHR
//SORTIN02 DD   DSN=A123456.NEW,DISP=SHR
//SORTOUT  DD   DSN=A123456.SORT.SAMPOUT,DISP=OLD
//SYSIN    DD   *
  MERGE  FIELDS=(110,5,CH,A,1,75,CH,A)
/*

In Calling DFSORT from a program, you learn how to merge data sets when calling DFSORT from a program.

So far
So far in this chapter you covered how to write both the SORT and MERGE program control statements and how to process those control statements using JCL statements. Now you continue with the tutorial on COPY.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014