Creating and using the sample data sets
Many of the examples in this document refer to the sample data sets SORT.SAMPIN, SORT.SAMPADD, SORT.BRANCH and SORT.SAMPOUT. Appendix A, "Creating the Sample Data Sets" shows you how to create your own copies of these data sets, using a program called ICESAMP shipped with DFSORT, if you want to try the examples in this document that use them.
Before you begin, turn to Descriptions of the sample data sets. Many of the examples in this document refer to the sample bookstore data sets as the input data sets, so you should become familiar with them. The input data sets contain the data that you want arranged or sorted. You must specify an input data set for every DFSORT job you run. The sample bookstore data set is named SORT.SAMPIN and the additional bookstore data set is named SORT.SAMPADD.
Each record in the bookstore data sets has 12 fields (book title, author’s last name, and so on). A record can be represented by one horizontal row on the page. A field can be represented by one vertical column on the page.
To sort a data set, you choose one or more fields that you want to use to order the records (arrange in ascending or descending order). These fields are called control fields (or, in COBOL, keys).
As you work through the exercises on the following pages, remember that each entire record is sorted, not just the control field. However, for the sake of simplicity, the figures in the text show only the control fields being discussed. The sorted records actually contain all of the fields, but one page is not wide enough to show them. Descriptions of the sample data sets, shows all of the fields in each record. It is also arranged with headings and numbers that show the byte positions of each field. The numeric fields are in binary format (see Table 2) and therefore will not appear on most displays as they do in this document. Methods you can use to arrange and view the data are explained in the chapters on DFSORT functions that follow.
Table 1 shows an example of sorted fields. Notice the line of numbers above the sorted fields. These numbers represent the byte positions of those fields. You use byte positions to identify fields to DFSORT. The examples show the byte positions to help you while you are learning to use DFSORT. The byte positions do not actually appear in any of your processed data sets.
In Table 1, the first two records, which show nothing in the course department fields, are general purpose books not required for a particular course. For this example, the control field is the Course Department field.
Book Title | Course Department | Price |
---|---|---|
1 75
|
110 114
|
170 173
|
LIVING WELL ON A SMALL BUDGET
PICK'S POCKET DICTIONARY INTRODUCTION TO BIOLOGY SUPPLYING THE DEMAND STRATEGIC MARKETING COMPUTER LANGUAGES VIDEO GAME DESIGN COMPUTERS: AN INTRODUCTION NUMBERING SYSTEMS SYSTEM PROGRAMMING INKLINGS: AN ANTHOLOGY OF YOUNG POETS EDITING SOFTWARE MANUALS MODERN ANTHOLOGY OF WOMEN POETS THE COMPLETE PROOFREADER SHORT STORIES AND TALL TALES THE INDUSTRIAL REVOLUTION EIGHTEENTH CENTURY EUROPE CRISIS OF THE MIDDLE AGES INTRODUCTION TO PSYCHOLOGY ADVANCED TOPICS IN PSYCHOANALYSIS |
BIOL BUSIN BUSIN COMP COMP COMP COMP COMP ENGL ENGL ENGL ENGL ENGL HIST HIST HIST PSYCH PSYCH |
9900
295 2350 1925 2350 2600 2199 1899 360 3195 595 1450 450 625 1520 795 1790 1200 2200 2600 |
Also notice that records in Table 1 with equally collating control fields (in this case,the same department) appear in their original order. For example, within the Computer Science department (COMP), the title Video Game Design still appears before Computers: An Introduction.
You can control whether records with equally collating control fields appear in their original order or whether DFSORT orders them randomly. The system programmer sets defaults at installation time that you can change with some DFSORT options at run time. The examples in this document assume that the default is for records with equally collating control fields to appear in their original order.
Summary |
---|
So far in Getting Started you covered the following concepts:
In addition, this chapter covered how to use and read the sample data sets provided with DFSORT. Now continue with tutorials on how to write DFSORT control statements. |