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


Defining symbols for fields

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

Descriptions of the sample data sets shows the fields of the bookstore data set. To define the symbols for these fields, write a SYMNAMES statement for each one in SORT.SYMBOLS. The SYMNAMES statements for the symbols Title and Author_Last_Name look like this:
* Symbols for fields
Title,1,75,CH
Author_Last_Name,*,15,CH

To write these SYMNAMES statements that define the symbol Title for the Title field and the symbol Author_Last_Name for the Author's Last Name field, follow these steps:

Table 1. Steps to Define Symbols for Fields
Step Action
1 Write a comment statement (optional):

* Symbols for fields

2 Type Title followed by a comma.

This is the symbol you will use for the Title field. A symbol can be 1 to 50 characters consisting of uppercase letters (A-Z), lowercase letters (a-z), numbers (0-9), the number sign (#), the dollar sign ($), the commercial at sign (@), the underscore(_), and the hyphen (-). However, the first character must not be a number. Title, TITLE, and title are three different symbols.

3 Type the position of the Title field followed by a comma.

The position of the Title field is 1.

4 Type the length of the Title field followed by a comma.

The length of the Title field is 75.

5 Type the format of the Title field followed by a blank.

The format of the Title field is CH.

6 Type Author_Last_Name followed by a comma.

This is the symbol you will use for the Author's Last Name field.

7 Type * for the position followed by a comma.

An asterisk (*) for the position shows that this field immediately follows the previous field. The * here will automatically assign 76 as the position of the Author_Last_Name symbol. You could specify 76 instead of *, but * is preferable when fields are adjacent. * allows symbols for fields to be inserted without changes to symbols for other fields.

8 Type the length of the Author's Last Name field followed by a comma.

The length of the Author's Last Name field is 15.

9 Type the format of the Author's Last Name field followed by a blank.

The format of the Author's Last Name field is CH.

The SYMNAMES statements to define the symbols for the other fields in the bookstore data set look like this:
Author_First_Name,*,15,CH
Publisher,*,4,CH
Course_Department,*,5,CH
Course_Number,*,5,CH
Course_Name,*,25,CH
Instructor_Last_Name,*,15,CH
Instructor_Initials,*,2,CH
Number_in_Stock,*,4,BI
Number_Sold_YTD,*,4,BI
Price,*,4,BI
So far
So far, you have learned how to create a SYMNAMES data set and use it to define symbols for your fields. Now you will learn how to use the symbols for the fields you defined.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014