Iddu Use: AS/400 Advanced Series
Iddu Use: AS/400 Advanced Series
IDDU Use
Version 4
SC41-5704-00
AS/400 Advanced Series IBM
IDDU Use
Version 4
SC41-5704-00
Take Note!
Before using this information and the product it supports, be sure to read the general information under “Notices” on page ix.
This edition applies to the licensed program IBM Operating System/400 (Program 5769-SS1), Version 4 Release 1 Modification 0,
and to all subsequent releases and modifications until otherwise indicated in new editions.
Make sure that you are using the proper edition for the level of the product.
Order publications through your IBM representative or the IBM branch serving your locality. If you live in the United States, Puerto
Rico, or Guam, you can order publications through the IBM Software Manufacturing Solutions at 800+879-2755. Publications are not
stocked at the address given below.
IBM welcomes your comments. A form for readers’ comments may be provided at the back of this publication. You can also mail
your comments to the following address:
IBM Corporation
Attention Department 542
IDCLERK
3605 Highway 52 N
Rochester, MN 55901-7829 USA
If you have access to Internet, you can send your comments electronically to [email protected]; IBMMAIL, to
IBMMAIL(USIB56RZ).
When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes
appropriate without incurring any obligation to you.
Appendixes
Contents v
Appendix B. Practice Exercise . . . . . . . . . . . . . . . . . . . . . . . . . B-1
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H-1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X-1
IBM may have patents or pending patent applications covering subject matter in this document. The fur-
nishing of this document does not give you any license to these patents. You can send license inquiries,
in writing, to the IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY
10594, U.S.A.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this one)
and (ii) the mutual use of the information which has been exchanged, should contact the software interop-
erability coordinator. Such information may be available, subject to appropriate terms and conditions,
including in some cases, payment of a fee.
IBM Corporation
Software Interoperability Coordinator
3605 Highway 52 N
Rochester, MN 55901-7829 USA
This publication may refer to products that are announced but not currently available in your country. This
publication may also refer to products that have not been announced in your country. IBM makes no
commitment to make available any unannounced products referred to herein. The final decision to
announce any product is based on IBM's business and technical judgment.
This publication contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental.
This publication contains small programs that are furnished by IBM as simple examples to provide an
illustration. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot
guarantee or imply reliability, serviceability, or function of these programs. All programs contained herein
are provided to you "AS IS". THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED.
Microsoft, Windows, and the Windows 95 logo are trademarks or registered trademarks of Microsoft Cor-
poration.
PC Direct is a trademark of Ziff Communications Company and is used by IBM Corporation under license.
UNIX is a registered trademark in the United States and other countries licensed exclusively through
X/Open Company Limited.
Other company, product, and service names, which may be denoted by a double asterisk (**), may be
trademarks or service marks of others.
Before you use this book, you must be familiar with the introductory material for
using the AS/400 system, such as System Operation for New Users, SC41-3200.
A knowledge of high-level programming languages is helpful, but not necessary to
use IDDU.
If you want to use all of the AS/400 database capabilities, you must use data defi-
nition specifications (DDS) or the Structured Query Language (SQL). Read DB2 for
AS/400 Database Programming, SC41-5701, for information about database
design. Read the DDS Reference, SC41-5712, for information about DDS. Read
the DB2 for AS/400 SQL Reference, SC41-5612, and DB2 for AS/400 SQL Pro-
gramming, SC41-5611, for information about SQL.
Select the Information Desk, and you will be able to access a variety of AS/400
information topics from that page.
Data is simply the information used in your business: customer names, account
balances, part numbers, and so forth. The data in your business can be kept in a
variety of ways and used for a variety of purposes.
For example, you may keep names and addresses and other information about
customers in an alphabetical arrangement of index cards, like this:
┌───────────────── ┌───────────────── ┌─────────────────
│ A─12345 │ A─34567 │ B─56789
│ Smith Company │ STN Company │ TUVW Corp.
│ Mr P W Bonner │ Mr Alex Jones │ Ms J Stiles
│ PO Box 9753 │ 1717 44 Street │ 5555 33 Ave.
│ Chicago, IL │ New York, NY │ Chicago, IL
│ 22334─4567 │ 65ð53─5678 │ 22334─6789
│ (516) ð32─5654 │ (2ð1) ð45─8675 │ (516) ð24─1222
Figure 1-1. Examples of Customer Data
Or you may keep employee records for your company or department arranged on a
sheet of paper, like this:
Whether stored on the computer or on paper in your office file drawer, data is
organized into fields, records, and files.
Records
A record is a collection of fields that holds information about a particular subject.
For example, each index card is a name-and-address record of a particular cus-
tomer; each line on the list is a record of a particular employee:
Customer Record
┌─────────────────
│ A─12345
│ Smith Company
│ Mr P W Bonner
│ PO Box 9753
│ Chicago, IL
│ 22334─4567
│ (516) ð32─5654
Employee Record
Files
A file is a set of related records. For example, the stack of index cards with infor-
mation on each of your customers makes up a file; so do all the pages of employee
information.
File Storage
Computer files are magnetically recorded on specific areas of disk storage, some-
what like tracks on a phonograph album, so they take up considerably less space
and are less easily damaged than the paper files in your cabinet drawer.
The specific areas of storage that hold files on this system are called libraries,
which could be compared to the drawer or cabinet holding the file folders in your
office.
Library
File
Record
Field
RSLL269-0
File Processing
File processing includes recording, classifying, sorting, calculating, storing,
selecting, retrieving, reproducing, reporting, communicating, and distributing data to
perform tasks required in your business.
Name
Select
Address Label
appropriate
Account
fields
Number
RSLL259-0
Your work with files could include the tasks described in the following sections.
Combining Data and Text: A name and address are taken from a file and com-
bined with a form letter.
October 1, 1982
Alfredo R. Romero
2948 Skyview Dr.
Indianapolis, IN 28449
Sincerely,
RSLL257-1
Querying Data
You can request information from your files (such as search for, select, and list
particular records) using the AS/400 Query program (if it is installed on your
system). Information on writing queries is in the Query/400 Use book.
Looking at Each File Record: You need to find an employee’s hiring date.
RSLL255-1
Listing All the File Information: You need to print a list of all your customers.
RSLL261-0
Selecting Records: You need to print a list of all your New York customers.
STN Corp.
NTN Inc.
Tern Co.
RSLL256-2
Maintaining Data
Adding, changing, and deleting records are all file maintenance activities. You can
do this work on the AS/400 system using a part of the AS/400 Application Develop-
ment Tools (if they are installed on your system) called the data file utility (DFU).
Information on maintaining data files is in the ADTS/400: Data File Utility book.
Kay
Balar
RSLL252-1
Matt
Thomas
961 S 19th Ave.
RSLL253-2
TRASH
RSLL254-1
Describing Data
Before you can use any of the programs just mentioned to work with your data, you
must describe (or define) that data to the system. The next chapter describes the
concepts of defining data to be used in queries and documents.
Depending on how one is using the system, there are several methods of
describing data:
Using statements within an application program written in a high-level language
such as RPG or COBOL. Data described in a program is known as program-
described data.
With this method, the file and the descriptions of its data are known only to that
application program; they cannot be used by any other program on the system.
Each program that refers to a file must contain its own set of file and data
descriptions.
Using system functions (such as DDS or IDDU) to create data descriptions (or
definitions) and keep them with the file they describe. Data described outside
of an application program is known as externally described data.
With this method, the data descriptions can be shared by all programs using
that file.
When the interactive data definition utility (IDDU) is used to describe data, it col-
lects the data definitions that it produces into a data dictionary.
Database Files
A database is a collection of data files in the system that are described together in
one place using a common method of description that allows them to be used by
more than one program. Individual data files thus described are sometimes also
called database files.
Library 1 Library 2
File A
data
.
.
.
RSLL265-0
And if you need to change an attribute of a field (for example, if your customer
account numbers now include alphabetic characters as well as numbers), you have
fewer definitions to change, and they are all in one place.
The dictionary also keeps track of where definitions are used and what files they
describe. Thus you can delete definitions that are not used or perhaps protect a
definition used in a special way in a particular file.
Data Definitions
Remember, the dictionary does not contain the data itself. Instead, it contains
information about various aspects of the data: location, format, attributes, structure,
use, and relationships.
Field Definitions
Fields are single pieces of information within a computer record, similar to each of
the areas on an invoice. Field definitions, then, are the instructions that tell you
important information about the fields in a record:
What kind of data does the field contain, numbers or letters?
How long is the field? If the field contains a number, how many positions
follow the decimal point?
How is data in the field printed or displayed? What is the thousands sepa-
rator? What is the currency symbol? Where is the minus sign shown?
You can compare a record format definition to instructions that describe the kinds
of information in a document. An invoice, for example, contains blanks that
someone must fill in, such as a customer’s name and address. In effect, a record
format definition supplies the blank form for a computer record.
Record Format
.
Field 1 Field 2 Field 3 Field 4
RSLL266-1
File Definitions
A file definition identifies the kinds of records contained in a computer file.
RSLL267-1
Country field
Customer record
Account number field Account number fie
Company name field
State field Title field
First name field
Street address field Middle initial field
Last name field
Last name Subtitle field
Street address field
Telephone number field City field
State field
Title field Zip code field
Country field
Zip code field RSLL268-1
The Operating System/400* (OS/400*) program that helps you do this grouping is
the interactive data definition utility (usually called IDDU).
The term interactive (in the program’s name) is defined as pertaining to the
exchange of information between people and a computer, and to you that means
when you give the program some piece of information, it responds immediately and
appropriately. For example:
If you type a 3 on the Select Definition Type display to indicate that File is the
definition type you want, IDDU takes you directly to the Work with File Defi-
nitions display.
If you specify that the field type is Character, IDDU shows you only the addi-
tional prompts required for character data; you don’t have to page through all
the displays that define numeric data.
IDDU Features
IDDU also includes a number of other features that make it easy to work with data
dictionaries and data definitions:
Prompts
You can respond to people-language phrases instead of remembering some-
what obscure commands and keyword parameters; for example, Definition type
instead of DFNTYPE (type), Data dictionary instead of DTADCT (name).
Lists
You can select from a list of all the available items instead of having to
remember and type names.
á ñ
Function keys
You can press a single key instead of learning and typing lengthy or cryptic
command instructions.
á ñ
Online information
You can request and read information about IDDU and the system right at your
display station instead of having to keep this and other books nearby.
à ð
Type (Field type)
Type the appropriate number to indicate which type of field definition you
are creating.
You can perform additional IDDU-related tasks using the commands listed in
Appendix D, “IDDU Commands.”
The following chapter summarizes the process of using IDDU to describe a data
dictionary and data definitions for an application and “Part 2. Defining Data” on
page 3-9 describes each part of the process in more detail. If you are responsible
for maintaining the database and data dictionaries, you can find additional informa-
Getting to IDDU
You can get to the Interactive Data Definition Utility (IDDU) menu by either of two
menu paths, starting at the AS/400 system Main Menu and selecting the following
options:
Path 1
1. On the Main Menu, choose option 2 (Office tasks).
2. On the Office Tasks menu, choose option 3 (Decision support).
3. On the Decision Support menu, choose option 1 (IDDU).
Path 2
1. On the Main Menu, choose option 4 (Files, libraries, and folders).
2. On the Files, Libraries and Folders menu, choose option 1 (Files).
3. On the Files menu, choose option 5 (IDDU).
Or you can enter one of the following on any command line to go directly to the
Interactive Data Definition Utility (IDDU) menu:
STRIDD (a command that means Start IDDU)
Selection or command.
===> __________________________________________________________________________
_______________________________________________________________________________
F3=Exit F4=Prompt F9=Retrieve F12=Cancel F13=User Support
F16=System main menu
á ñ
Choosing Options
From the IDDU menu, you can choose which of the data tasks (options 1, 2, and 3)
you want to do. You can also choose to do related tasks (options 20, 21, and 30)
or to look at or use the related IDDU commands (option 70).
á ñ
To do a task from any of the Work with ... displays, choose the task you want to do
and type the corresponding option number next to the object you want to work with
(a file definition, in the example display).
Using Lists
The names of all the available objects of the type you are working with are shown
in alphabetic order. (If the word More... appears in the lower right corner of the list,
you can see additional names by pressing the Page Down key.) If you want to
quickly find a name appearing later in the list, you can type the starting characters
of the name in the input field for the Position to prompt. The list then shifts so that
the first name starting with that character is shown in the upper left corner of the
list. For example, if you specified SA for the Position to prompt, the newly posi-
tioned list would look like this:
á ñ
If you need more information than just the object name to make your choice, you
can press F11 (Display text) to see an expanded list, like this:
á ñ
If you want to go back to the other kind of list, you can again press F11 (Display
names only).
After you press the Enter key, IDDU presents displays to do the tasks in the order
the options are specified on the list. For example, if you specified the following
multiple options, you would first see the appropriate series of displays to create a
new file definition named GEORGE, then the displays to change file definition
ABxxx, then displays to rename file definition BExxx, then displays to delete file
definition DDxxx, and so forth.
á ñ
For example, if you choose to create new field definitions, you see the Create Field
Definitions display.
Using the codes shown at the top of the display, you can type descriptions for nine
fields at a time, specifying for each what kind of field it is, its length, how many
positions after its decimal point (if it is a numeric field), a brief description, and
whether you want to specify more information about it on following displays. After
you press the Enter key, you are shown all appropriate additional displays (if any)
for the first field you specified, then all displays for the second field, and so forth.
To specify additional information about the field, you enter a Y under the More Opt
heading. The additional options for all field types include column headings, a long
comment, and keyboard control for input. For numeric fields, you can also specify
the type of numeric data and how (or if) you want the field to be edited (that is,
have commas, decimal points, currency symbols, and so forth inserted around the
numbers).
If you specify that you want more options for a character field, you see a display
like this:
Hexadecimal
data type . . . . . . . . . . . N Y=Yes, N=No
Column headings
Heading 1 . . . . . . . . . . . ____________________
Heading 2 . . . . . . . . . . . ____________________
Heading 3 . . . . . . . . . . . ____________________
More...
F3=Exit F12=Cancel
á ñ
Notice that the choices for several prompts on the above display are Select or
Remove instead of actual values. This technique helps you control the number of
displays you must page through as you create or change definitions. You only see
additional displays to enter new or different information if you specify Select for
these prompts. Or, you can leave the prompt blank and IDDU keeps the existing
information for that prompt. If you do not remember what information currently
exists, you can specify Select to see the next display.
The chapters in “Part 2. Defining Data” on page 3-9 are arranged in the creating
sequence: first, dictionaries; then, file definitions, format definitions, and field defi-
nitions; and finally, database files. Each chapter gives the information you need to
plan and create that kind of object.
While a dictionary and the applications that use its definitions do not have to be in
the same library, you must create a data dictionary if you not yet have one. Each
dictionary has the same name as the library that contains it.
You might want to create more than one data dictionary for your area. You might
create different data dictionaries for different types of data: for example, one data
dictionary to describe inventory information and another to describe employee infor-
mation.
Note: The dictionary creator has the authority to limit who can work in each data
dictionary and what kind of work they can do.
Note: If the library you specify does not exist, the system shows you the
Create a Library display (if you are authorized to create libraries). After
you create a library from that display, you continue to the Create a Data
Dictionary display.
3. On the Create a Data Dictionary display, the name of the specified library
appears as the name of the dictionary.
Text . . . . . . . . . __________________________________________________
Considerations for securing (assigning authority to) and describing a dictionary are
discussed in the following topics.
For more information about resource and office security, see the books Security –
Reference and Managing OfficeVision/400.
Levels of Authority
You can grant the following access, or levels of authority, to other users when you
create a dictionary:
*LIBCRTAUT
A user can be allowed or denied the authority to use the object created using
the Create Authority (CRTAUT) value in the library in which the object is being
created.
*ALL
All users can work with the definitions in this dictionary, including changing
them, and can change others' authority to the dictionary, subject to additional
individual security restrictions.
*USE
All users can copy and print definitions from the dictionary and display where
they are used but cannot change the dictionary or its definitions.
*EXCLUDE
No other user has any access to this dictionary.
Authorization Lists
If you want different users to have different levels of authority, you can specify the
name of a user-created authorization list containing the names of specific users to
be authorized to this dictionary and the authority level for each individual. The
authorization list must already exist on the system before you create the dictionary.
Refer to Security – Reference for details.
Long Comment
The Long comment prompt lets you enter, on the Edit a Long Comment display, up
to 1360 characters of information about the dictionary. Examples of this information
might be identifying the files defined by this data dictionary, or identifying who
created the dictionary and who is responsible for maintaining it. The information
you put in the long comment can be read on the edit display when you choose to
change the dictionary and printed by using the Print key (or other methods of
printing a copy of displays).
Text Description
The Text prompt lets you write a short description (up to 50 characters) about the
dictionary that may be helpful in reminding you of the purpose and contents of the
dictionary. The information you put in the text field is shown in lists of dictionaries
and can be printed by using the Print key (or other methods of printing a copy of
displays).
These dictionary maintenance tasks are described in Chapter 13, “Maintaining Data
Dictionaries.”
An example of a file definition work sheet, including the most commonly used file
definition prompts on the displays, is supplied on the following page. You can copy
and use this work sheet, or you may want to create one designed for your own
applications.
The descriptions that follow the work sheet will help you in completing it.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
You can begin a file definition name with any alphabetic character (A through Z) or
one of the symbols $, #, @. You can also use any of those characters and
symbols for the remainder of the name, as well as the numbers 0 through 9, the
period (.), and the underscore character (_).
However, an extended name uses all characters except the embedded blank,
device control characters, *, ?, ', and, " (for example, “PAY (12)” can be used
when it is enclosed in quotation marks).
Use meaningful names to make all of your data definitions clear to users not
familiar with your data. Use abbreviations for a file definition name when a com-
plete descriptive name cannot fit in 10 characters (8 characters for an extended
name).
For your convenience, you might give the file and the file definition the same name.
This naming convention lets all users easily associate the file (the data) with the file
definition (the description). Creating database files is discussed in “Creating a
Database File” on page 8-1.
Note: You may have more than one definition with the same name. Your
descriptions of the definitions should help you determine the differences
between the definitions.
You might want to define multiple record formats for a single file. For example, a
sales file might contain one order header record and several transaction records for
each order. If one customer placed 10 different orders, for example, there would
be 10 order header records for that customer. Information common to each trans-
action, such as the customer’s name and address and the sales representative’s
name, would be stored in the order header record, while unique information, such
as item number and quantity, would be stored in each transaction record.
Before you decide to use a file with multiple record types, however, look carefully at
the possible file uses to make sure you can create the necessary output from such
Certain kinds of fields cannot be used in a file with multiple record formats:
Date/time/timestamp fields
Variable-length fields
Null-capable fields
DBCS-graphic fields
You should use record ID codes in the record format definitions for files with mul-
tiple formats. Otherwise, if no record ID codes are defined, all the records are used
for each format in the file. For more information on record ID codes, see “Using
Record Identification Codes” on page 10-1. Additionally, a file definition that con-
tains multiple formats can produce only a program-described file when the file is
created. “Program-Described Files” on page C-4 discusses considerations when
using files with multiple record formats.
You can use key fields only in a single format file definition that does not have
record ID codes. Only fields used within the record format may be selected as key
fields.
Note: The total size of key fields is limited to 2000 bytes, unless duplicate keys
are allowed and arranged in first-changed first-out order (FCFO). For FCFO
files, the total size limit for key fields is 1995 bytes.
To determine the total combined length of your key fields, you have to make
adjustments if certain kinds of fields are used as key fields:
For each key field that is null capable, add an extra byte to the total to
account for nulls.
For each key field that is variable length, add two bytes to account for
the length value.
For each key field that is both null capable and variable length, add
three bytes to the total to account for nulls and length value.
For each key field that is DBCS-graphic, double the field length (number
of characters) to account for each character being stored as two bytes.
If all key fields are DBCS-graphic, the maximum total length is either
1000 characters or 997 characters for a FCFO file.
For more information on selecting key fields, see “Selecting Key Field Sequence”
on page 11-1.
Long Comment
You can enter up to 1360 characters of information about the content and purpose
of a definition in a long comment.
Text
You can type up to 50 characters of information when creating a file definition to
help you identify what the field contains. This description is shown when you view
a list of fields.
3. On the Work with File Definitions display, choose option 1 (Create) and specify
the name of the new file definition.
4. Next you will see the Create File Definition display. If you used the work sheet
to plan your file definition, you may want to refer to it as you continue this task.
Record formats
option . . . . . . . 2 1=Create and/or select formats
2=Create default format
and select fields
Text . . . . . . . . . __________________________________________________
See “Selecting a Record Format for a File Definition” on page 5-8 for a dis-
cussion of this display.
6. If you chose option 2 (Create default format and select fields), the next display
you see is Create and Select Field Definitions, where you can choose the field
definitions to be included in the new record format and the order in which the
fields are to be arranged in the record.
The record format name that you (or IDDU) previously specified on the Create
File Definition display appears at the top of this display.
See “Selecting a Field Definition” on page 6-6 for a discussion of this display.
a. If you type the name and sequence of a new field definition in the first posi-
tion of the list and press F6 (Create field definition), you will see the Create
Field Definitions display. Use this to choose the field definitions to include
in the new record format and the order the fields are arranged in the
record. (See “Planning a Field Definition” on page 7-1 for information on
defining fields, and “Selecting a Field Definition” on page 6-6 for informa-
tion on using the Create and Select Field Definitions display.)
b. When you return to the Create and Select Field Definitions display after
completing your work with fields, press the Enter key (without making any
changes to the display) to tell IDDU that you want the record format defi-
nition created.
7. If you entered Y at the Select key field sequence prompt, the Select Key Field
Sequence display will appear next. This display allows you to choose the order
of the key fields.
When you press the Enter key, the display appears again if you made changes.
Press the Enter key to proceed. If you do not change the display, pressing the
Enter key allows the program to proceed. See “Selecting Key Field Sequence”
on page 11-1 for more information on using the Select Key Field Sequence
display.
8. If you chose 1 (Select) for the Long comment prompt, the Edit a Long
Comment display appears next. There you can type a detailed description of
the file definition you are creating.
9. When you return to the Work with File Definitions display, press F3 (Exit) to
return to the IDDU menu or command line.
The system-supplied name for this record format definition is the file name, plus a
last character of R, unless the file definition name is 10 characters (in which case
the system duplicates the entire name). You can type over this system-supplied
name with another as your application requires.
When you press the Enter key, the Create and Select Field Definitions display
appears, and the record format definition will be created with the file definition. The
tasks on that display are discussed in “Selecting a Field Definition” on page 6-6.
Select from existing record format definitions by specifying a sequence number next
to the record format definition name in the list. When you specify a sequence
number for a format name and press the Enter key, the name is positioned accord-
ingly in the list. The list is repositioned to the sequence number or to the name you
specify (in the Position to prompt) when you press the Enter key. When you
specify a name and no name match is found, the nearest item preceding the name
To change the sequence number of a record format in the list, type the new
sequence number next to the record format name and press the Enter key; the
name will be moved to the new position.
To remove the name of a format from the list of format definitions used by the file
definition, remove the sequence number by spacing over it.
You can create a new record format definition by typing the name of a new record
format definition on the top line of the list. Then either accept the sequence
number the system assigns to it or type over it with an appropriate new number to
properly position the definition in sequence.
After you type the record format name to be created, press F6 (Create record
format definition) to go to the Create a Record Format display.
These maintenance tasks for file definitions are described in Chapter 12, “Main-
taining Definitions.”
An example of a record format definition work sheet, including the most commonly
used record format definition prompts on the displays, is supplied on the next page.
You can copy and use this work sheet, or you may want to create one designed for
your own applications.
The descriptions that follow the work sheet will help you in completing it.
Field definitions:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
You can begin a record format definition name with any alphabetic character (A
through Z) or one of the symbols $, #, @. You can also use any of those charac-
ters and symbols for the remainder of the name, as well as the numbers 0 through
9 and the underscore character ( _ ).
Use a descriptive name for a record format definition. For example, if a definition
uses field names related to vacation, you might use a name to indicate this. This
helps you identify the definition when you see the name.
Notes:
1. RPG requires that the record format name be different from the name of the file
that uses it.
2. You may have more than one record format definition with the same name.
Your descriptions of the definitions should help you determine the differences
between the definitions.
Field Definitions
When you create record format definitions for a new file, you choose the fields that
will be included in the record and the order in which they are positioned. You can
choose any definitions in the same dictionary as the record format definition, or you
can create new ones.
Long Comment
You can enter up to 1360 characters of information about the content and purpose
of a definition.
Text
You can type up to 50 characters of information to help you identify what the record
contains when creating a record format definition. This description is shown when
you view a list of formats.
Record ID Codes
Record ID codes should be specified when multiple record format definitions are
used by a file definition for a file.
See Chapter 10, “Record Format Definition Considerations,” for more information
about record ID codes.
3. On the Work with Record Format Definitions display, choose option 1 (Create),
and specify the name of the new record format definition.
4. Now the Create Record Format Definition display appears. If you used the
work sheet to plan your record format definition, you may want to refer to it as
you continue this task.
Specify
record ID codes . . . N Y=Yes, N=No
Text . . . . . . . . . . ___________________________________________________
On this display:
a. Indicate that you will create new field definitions for this format and/or
select from the definitions that exist in the dictionary. (Because this is a
Create task, you cannot change the first item.)
b. Choose whether to identify record ID codes for this format (required if mul-
tiple formats exist in the file definition).
c. Choose whether to provide an extended description (long comment) for this
definition.
d. Type a brief text description for this definition.
5. Next the Create and Select Field Definitions display appears, where you can
choose the field definitions to include in the new record format and the order
the fields are arranged in the record. See “Selecting a Field Definition” on
page 6-6 for information on using this display.
a. If you type the sequence and name of a new field definition in the first posi-
tion of the list and press F6 (Create field definitions), the Create Field Defi-
nitions display appears. (See “Planning a Field Definition” on page 7-1 for
information on defining fields.) Pressing the Enter key without changing the
display causes the Create and Select Field Definitions display to appear
again.
b. When you return to the Create and Select Field Definitions display after
completing your work with fields, press the Enter key (without making any
changes to the display) to tell IDDU that you are ready for the next step.
6. If you chose Y for the Specify record ID codes prompt, the Define Record ID
Codes display appears next. See “Using Record Identification Codes” on
page 10-1 for information on using this display.
7. If you chose 1 (Select) for the Long comment prompt, the Edit a Long
Comment display appears next. There you can type a detailed description of
this record format definition. Pressing the Enter key as you complete the Long
Comment will bring you to the Work with Record Format Definitions display.
8. When you return to the Work with Record Format Definitions display, press F3
(Exit) to return to the IDDU menu or command line.
You can use F11 (Display text) to see the field type of each field (for example,
character, variable-length character, date, packed, zoned, binary, or floating point).
Field definitions with sequence numbers have already been selected to be used by
the format definition named on the display, and will be used in the ascending order
of those sequence numbers as they appear in the upper portion of the list. The
value shown in the End column can be used to determine the length of the field
definition. By using F11 (Display text), you can use the date and text columns to
determine which of any identically named fields you want to use, because each
field must have a unique name (and alias) within the record format.
Do not let the total of field sizes used by a single record format definition exceed
32 766 bytes. If you exceed that size, IDDU will not let you save the definition.
The field definitions in this dictionary that are not selected for this format, but are
available to be used, appear without sequence numbers in the lower portion of the
list.
To create new field definitions, type each new definition name on the top line of the
list. The system will assign a sequence number which you can accept, or you can
type over it with an appropriate number. If you do not specify a sequence number
for the new definition, the new name will be placed in alphabetical order in the
lower portion of the list with the other names without sequence numbers.
After you type the name of a field definition to be created, press F6 (Create field
definition) to go to the Create Field Definitions display, which is discussed in “Cre-
ating a Field Definition” on page 7-12.
These record format definition maintenance tasks are described in Chapter 12,
“Maintaining Definitions.”
You need a different field definition for each unique field in the files. However,
when you have a data dictionary, a field that appears in many files with the same
characteristics in each file needs only one field definition. For example, a field
created to handle names could be used throughout all your applications.
The descriptions that follow the work sheet will help you in completing it.
You must define the following information for all field types:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Heading 3 . . . . . . . . . _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
More options allows this information for character (SBCS) field types:
Notes:
Field Name
The name of the field definition you are creating can be up to 10 characters.
You can begin a field definition name with any alphabetic character (A through Z)
or one of the symbols $, #, @. You can also use any of those characters and
symbols for the remainder of the name, as well as the numbers 0 through 9 and
the underscore character (_).
Use meaningful names to make all of your data definitions clear to users not
familiar with your data. Use abbreviations for a field name when a complete
descriptive name cannot fit in 10 characters. You should use the same field name
across all data dictionaries. For example, if you use LASTNAME for all the field
names that refer to the last name, this helps you identify the field definition when
you see it regardless of what dictionary you are in.
If a field is used in many files and has the same characteristics in each file, you
should reuse the same field definition in each file definition.
Note: You may have more than one field definition with the same name. Your
description of the definitions should help you determine the differences
between the definitions.
Field Type
The field type definition specifies whether the data in the field is character (single-
byte character set (SBCS) characters or numbers), numeric, double-byte character
set (DBCS characters or numbers), or date/time. (You can further define these
data types by choosing More options.)
Field Size
The field size is the length of the field, specified as follows:
For the default numeric data type, packed (decimal), field size is the number of
digits. The maximum size is 31. See “Additional Characteristics for Numeric
Fields” on page 7-8 for maximum field sizes of other numeric data types.
For character (SBCS) data type, field size is the number of characters. The
maximum size is 32 766 (32 740 for a variable-length character field).
For bracketed-DBCS data types (if your system supports DBCS), field size is
twice the number of double-byte characters plus two, which allows for the
shift-out and shift-in (bracket) characters. The maximum size is 32 766
(32 740 for a variable-length DBCS field).
For DBCS-graphic data type, field size is specified as the number of double-
byte characters. The maximum size you can specify is 16 383 characters
(16 370 characters for a variable-length graphic field). The actual storage
space required for the field is twice the number of characters.
The total space required for all fields in a single record format definition cannot
exceed 32 766 bytes.
Each field should be long enough to contain the largest number of characters or
digits for that field in any record. For example, the length of each customer’s name
varies, but 20 positions might be long enough to contain most customer names.
For another example, if you have a field that will contain the name of a state, do
not make the field long enough for Massachusetts when you are only going to enter
MA. You cannot easily make a field shorter after it is linked to a disk file.
How you plan to use the data in the field should determine the length of your data
field. For example, you might break a very long field into smaller fields to be sure
you can fit the information from the file in your report or document.
Decimal Positions
Use the decimal positions field when you are defining a numeric field. The system
allows up to 31 positions, but in all cases, the number of decimal positions cannot
exceed the field size.
In the case of floating-point numbers, the number of positions is the number of sig-
nificant digits.
Text
You can type up to 45 characters of information when creating a field definition (up
to 50 when changing). This description is shown when you view a list of fields and
helps you identify what the fields contain.
More Options
To define additional information about your field, specify yes for the More options
prompt. The topics on “Additional Characteristics for All Field Types” and “Addi-
tional Characteristics for Numeric Fields” on page 7-8 discuss this information.
Column Headings
You can specify three column headings, each up to 20 characters long, that
describe the data in the field. These headings are used in reports produced by
applications using the field. If you do not specify a column heading, the office
applications of the AS/400 system use the field name as the first column heading.
You can change the column headings in the report or document using Query/400 or
OfficeVision; the column headings in the field definition, however, remain
unchanged.
Long Comment
You can enter up to 1360 characters of detailed information about the content and
purpose of a definition.
Keyboard Shift
You can control what type of (and whether) data can be entered in each field. Key-
board shift is used when a program uses a display file that refers to fields in the
database file currently being defined. However, the data file utility (DFU) does not
use keyboard shift. See “Part 3. Maintaining Data, Definitions, and Dictionaries” for
information on keyboard shift.
Note: Keyboard shift does not support DBCS fields, but does support character
and numeric fields.
DFU supports only binary, zoned decimal, and packed decimal data types for
numeric fields. IDDU field definitions for fields used by the data file utility must
adhere to this restriction.
Field editing and date/time editing are described in the following paragraphs; edit
codes and edit words, because they are infrequently used with Office and Query
applications, are discussed in Chapter 9, “Field Editing Techniques.” A system-wide
view of edit codes and edit words is presented in the DDS Reference.
Date/Time Editing: The separator can be a period (.), slash (/), colon (:), hyphen
(-), or comma (,).
Variable Length
You can specify whether a field is to be variable length. The values allowed in this
field are Y=Yes and N=No. The default value for this field is No. If you specify a
length, it is assumed to be the maximum length of the variable-length field
(including the two bytes for the shift-out and shift-in (bracket) characters, if it is a
bracketed-DBCS field). You cannot specify a value greater than 32 740 (16 370
for a DBCS-graphic field).
The allocated length must be less than or equal to the field length. If the field is a
null-capable character field, then the maximum allowable allocated length is 32739.
Otherwise, the maximum allowable allocated length is 32740.
Example of conversion:
A field is tagged with a CCSID of 227 (Danish).
Your job CCSID is 037 and you a working on an English (037 code page) key-
board.
You enter the character $ (hex value 5B) as input into the field. Database con-
verts the hex value 5B into the CCSID 227 hex value 67 (character $) to pre-
serve the dollar sign.
Date Format
Use the Date Format field to specify how you want your date to appear. Use one
of the predefined standard formats listed in Figure 7-1, or define your own format.
Date Separator
If you specified *MDY, *DMY, *YMD, or *JUL date format, you can specify a date
separator. The date separators for the *USA, *ISO, *EUR, and *JIS values are
predetermined and cannot be changed. The following values are valid date separa-
tors:
slash (/)
period (.)
comma (,)
dash (–)
blank ( )
Time Format
Use the Time Format field to specify how you want your time to appear. Use one
of the predefined standard formats listed in Figure 7-2, or define your own format.
Time Separator
If you specified *HMS as the time format, you can specify a time separator. The
time separators for the *USA, *ISO, *EUR, and *JIS values are predetermined and
cannot be changed. The following values are valid time separators:
colon (:)
period (.)
comma (,)
blank ( )
3. On the Work with Field Definitions display, choose option 1 (Create) and
specify the name of the new field definition.
4. Now you see the Create Field Definitions display. If you used the work sheet
to plan your field definition, you may want to refer to it as you continue this
task.
From this display you can specify any additional descriptive information
needed, such as the field’s type, size, or text. For numeric fields, you have to
specify the number of decimal positions. When necessary, indicate more
options are required.
Column headings:
Heading 1 . . . . . . . . . . . ____________________
Heading 2 . . . . . . . . . . . ____________________
Heading 3 . . . . . . . . . . . ____________________
You can specify detailed data type, column headings, long comment, and an
alias for all fields. For numeric fields, you can choose numeric editing and key-
board shift. For character fields, you can choose keyboard shift.
6. If you chose numeric field editing, you see the Describe Numeric Field Editing
display, on which you can choose the specific kind of editing you want to do.
F3=Exit F12=Previous
á ñ
Depending on the edit mode you choose, you will get another display on which
to specify your requirements.
7. If you chose 1 (Select) for the Long comment prompt, the Edit a Long
Comment display appears next. There you can type as detailed a description
of this file definition as necessary.
8. Pressing the Enter key returns you to the Create Field Definitions display after
defining the field. Press the Enter key again (without making any changes to
the display) to tell IDDU that you are ready for the next step. (You could now
specify additional fields to create.)
9. Pressing the Enter key returns you to the Work with Field Definitions display,
and pressing F3 (Exit) returns you to the IDDU menu or command line.
These field definition maintenance tasks are described in Chapter 12, “Maintaining
Definitions.”
You use the Work with Database Files display to name the database files you want
to work with and to describe the kind of work you want to do. After you have
created the definitions that describe a file and placed them in a dictionary, you can
choose either to create a database file or to enter data into an existing file (using
DFU).
Create as many files as you require by entering a new file name each time you
return to the display. These file names might have a level of authority previously
assigned to them (authority holder). This will affect the authority you can assign.
3. You see the Create a Database File display next, showing the name of the new
file and its library.
á ñ
On this display, specify the name of the file definition and the dictionary, and
also choose the authority others have to this file. Press F6 (Create file defi-
nition) to create a file definition for the file.
4. When the system creates the file, it is automatically linked to its file definition.
This linking of files and file definitions is discussed in “Linking and Unlinking
Files and Definitions” on page 14-1.
When a file is created using dictionary definitions, many people can use the file,
even though they might not be authorized to use the dictionary. However, they
must be authorized to a data dictionary before they can change the definitions in
that dictionary.
The Authority prompt on the Create a Database File display allows you to specify
how much control other users have over the contents of the file.
Levels of Authority
You can grant the following access, or levels of authority, to other users when you
create a database file:
*LIBCRTAUT
A user can be allowed or denied the authority to use the file created using the
Create Authority (CRTAUT) value in the library in which the file is being
created.
*ALL
All users can work with the data in this file and can change others’ authority to
the file data.
*CHANGE
All users can work with the data in this file, including changing it, but cannot
change authority to the file.
*EXCLUDE
No other user has any access to this file.
Authorization Lists
If different users have different levels of authority, you can specify the name of a
user-created authorization list containing the names of specific users to be author-
ized to this file and the authority level for each individual. The authorization list
must already exist on the system before you create the file.
For more information about authorization lists, see Security – Reference and Man-
aging OfficeVision/400.
After the file has been created, you can enter data into it by choosing option 2
(Enter data) on the Work with Database Files display and specifying the name of
the appropriate file definition.
DFU will read the file definition name and create a temporary data entry program
that allows you to enter, change, and delete records in the associated file. DFU
uses all the formats and fields you have defined in your file definition. The tempo-
rary program will disappear when you are finished with the data entry.
See the ADTS/400: Data File Utility book for detailed information on using DFU.
These tasks include copying, changing, printing, deleting, and showing where defi-
nitions are used. Some experience with IDDU is assumed and, in some cases, an
understanding of programming relationships.
Edit Codes
Edit codes are letters or numbers indicating that a defined pattern of editing should
take place in a field before the field is displayed or printed. Edit codes allow a user
to define how data will be presented on a printer or display. For further information
on edit codes see the DDS Reference book.
Specify either an OS/400 edit code or a user-defined edit code to control the
printing of output-capable numeric fields as follows:
Suppress leading zeros.
Punctuate a field with commas and periods to show the decimal column and to
group digits by threes.
Print negative values with a minus sign or CR to the right of the value.
Print zero values as zeros or spaces.
Print asterisks to the left of significant digits to provide protection.
Print the currency symbol defined for your system (QCURSYM) immediately to
the left of the leftmost significant digit (called a floating-currency symbol).
For fixed-currency symbols, use an edit word instead of an edit code.
Edit the field as defined in a user-defined edit code.
You cannot specify an edit code and an edit word for the same field.
Use an edit code of X to suppress the leftmost zero of a 3- to 6-digit date field, and
the two leftmost zeros of a 7-digit date field. The Y edit code additionally inserts
slashes (/) between the month, day, and year. The Z edit code removes any plus
or minus sign from a numeric field and changes the sign of the units column to a
hexadecimal F.
Note: Edit code X does not affect printer files. AS/400 hardware operates with a
preferred sign of F, which is equivalent to using edit code X.
The symbols for decimal point and thousands separator (when indicated above),
and the showing of a single leading zero (to the left of the decimal point), are all
dependent on the system value for the decimal format (QDECFMT).
Decimal Show
Format Decimal Thousands Single
Value Point Separator Zero
Blank . , N
I , . N
J , . Y
The printed currency symbol and the character that replaces leading zeros depend
on the edit code modifier selected.
You can optionally specify either asterisk fill or a floating currency symbol with edit
codes 1 through 4, A through D, and J through Q. For asterisk fill, an asterisk (*) is
written for each zero suppressed, and a complete field of asterisks is printed for a
zero-balance field.
The floating-currency symbol appears to the left of the leftmost significant digit. It
does not print on a zero balance when an edit code is used that suppresses the
zero balance. The symbol you specify must match the system value for the cur-
rency symbol (QCURSYM). (The symbol must match when the file is created. It
does not have to match when the file is used.)
Note: If an edit code is changed after a file is created, the new edit code is not
used unless the file is re-created. Instead, the editing specified at the time
the file was created continues to be used.
Edit Word
You can specify the free-format editing of numeric fields on the AS/400 system
using the Specify Edit Word display.
Type edit word, press Enter. (Enclose edit word in apostrophes. Each blank is
replaced by a digit, each ampersand (&) by a blank.)
F3=Exit F12=Previous
á ñ
An edit word specifies the form in which the field values are to be displayed and
inserts characters directly. The edit word can also be used to suppress leading
zeros and provide asterisk fill protection for a field.
An edit word used to format a field can be up to 246 characters. The edit word
must be enclosed in apostrophes ('), and any embedded apostrophes must be
typed twice (''). You cannot specify both an edit code and an edit word for the
When used, an alias must be unique in the record format definition, with no other
field definition used by the same record format having either the same alias or the
same name. That is, any field’s name must not be the same as some other field’s
alias. It can be no longer than 30 characters. An alias must begin with an alpha-
betic character followed by alphanumeric characters A through Z, 0 through 9, or
underscore; however, an underscore cannot be used as the last character.
Do not make an alias the same as any other alias, or the same as any field defi-
nition name that will be used by the same record format definition. When renaming
a field definition, you cannot use a new name that is the same as a field name or
an alias within the same record format definition.
To specify which type of shift the keyboard should be placed in for the operator, or
what DBCS data type will be accepted when the file is being used, choose 1
(Select) for the Keyboard shift for display file reference prompt on the character or
numeric field options displays. The DBCS data type is chosen directly on the
DBCS Field Options display. Remember that DFU does not recognize keyboard
shift.
Note: If Hexadecimal data type is chosen, the keyboard shift cannot be specified.
Hexadecimal
data type . . . . . . . . . . . Y Y=Yes, N=No
Column headings:
Heading 1 . . . . . . . . . . . ____________________
Heading 2 . . . . . . . . . . . ____________________
Heading 3 . . . . . . . . . . . ____________________
More...
F3=Exit F12=Cancel
á ñ
Bottom
F3=Exit F12=Cancel
á ñ
If you do not specify a shift, the system selects the appropriate shift. When you do
specify a shift on the Character Field Options display, you go to the Specify Char-
acter Keyboard Shift display, where you can specify these shifts:
Alphanumeric
Lets all characters be entered.
Digits only
Allows entry of only the digits 0 through 9. No special characters or blanks are
allowed.
Numeric shift
Allows numeric entry; all characters are valid.
Katakana
Allows Katakana entry; all characters are valid.
Inhibit
Locks the keyboard so no data can be entered.
More...
F3=Exit F12=Cancel
á ñ
Bottom
F3=Exit F12=Cancel
á ñ
Signed
Allows numeric entry of only the digits 0 through 9. To leave the input field, the
operator must press the Field Exit key, the Field + key, the Field - key, or a
cursor movement key.
Numeric
Allows numeric entry; all characters are valid.
Inhibit
Locks the keyboard so no data can be entered.
Digits only
Allows numeric entry of only the digits 0 through 9. No special characters or
blanks are allowed.
Column headings:
Heading 1 . . . . . . . . . . . ______________________________
Heading 2 . . . . . . . . . . . ______________________________
Heading 3 . . . . . . . . . . . ______________________________
á ñ
Bottom
F3=Exit F12=Cancel
á ñ
You can specify:
Open
Allows both single-byte character set (SBCS) and bracketed double-byte char-
acter set (DBCS) data to be entered.
Only
Allows only bracketed-DBCS data to be entered.
Either
Initially allows entry of SBCS data, but allows the operator to change and enter
bracketed-DBCS data. The first character entered in a field determines what
can be entered in the rest of the field.
Graphic
Allows only graphic (nonbracketed) DBCS data to be entered.
Column headings:
Heading 1 . . . . . . . . . . . ______________________________
Heading 2 . . . . . . . . . . . ______________________________
Heading 3 . . . . . . . . . . . ______________________________
More...
F3=Exit F12=Cancel
á ñ
Column headings:
Heading 1 . . . . . . . . . . . ______________________________
Heading 2 . . . . . . . . . . . ______________________________
Heading 3 . . . . . . . . . . . ______________________________
More...
F3=Exit F12=Cancel
á ñ
Column headings:
Heading 1 . . . . . . . . . . . ______________________________
Heading 2 . . . . . . . . . . . ______________________________
Heading 3 . . . . . . . . . . . ______________________________
More...
F3=Exit F12=Cancel
á ñ
Bottom
F3=Exit F12=Cancel
á ñ
You should specify record ID codes when multiple record format definitions are
used by a file definition for a file. If you do not use record ID codes to specify
record selection comparisons, the system assumes you want to include all the
records that can be read from the file. The system also assumes you want to
process all the records using the first record format definition used by the file defi-
nition for the file.
You can select specific records by asking the system to search through the file for
only those records that pass certain tests. The system will select records by
making comparisons between the data in the file and the specified qualifying condi-
tions. These qualifications are called record identification (ID) codes. Record ID
codes specify tests that:
Identify different record types contained in the file.
Identify certain records in the file.
When you create a record format definition, use the Define Record ID Codes
display to specify up to 70 tests used for identifying and selecting the records to be
processed by the record format definition. Only character and zoned fields can be
used for record ID codes.
á ñ
When you use Client Access to transfer an IDDU-defined file to the personal com-
puter, you can select the record format definition you want to use to do the transfer.
Using tests defined by the record ID code specified in the selected record format
definition, Client Access transfers the records that pass those tests.
When you use AS/400 Query to report data in a file, or use the data file utility to
add or update data in a file, you select a record format definition to be used in
processing the file. The content of a field or fields within each record is compared
with the record ID codes specified in the selected record format definition. If the
specified conditions, or tests, are true (the data passes the tests specified by the
record ID codes), the record is included in the report.
The performance of some applications can be improved by using keyed files and by
accessing records by key. This chapter describes how to define key fields.
When creating or changing a file definition using key fields, you can specify the
following:
Selection and sequence of key fields
Ascending or descending sequence for each key field
Key field value of signed, unsigned, absolute value, digit portion, or zone
portion
Whether duplicate keys are allowed
Sequence of records with duplicate keys
If you enter Y at the Select key field sequence prompt on the Create File Definition
or Change File Definition displays, the Select Key Field Sequence display appears.
Note: You may see the Create and Select Field Definition display immediately, or
the Create and Select Record Format display may appear before the Select
Key Field Sequence display appears.
When your selection of fields is complete, press the Enter key. (The display may
be used for viewing only.) If changes were made, the display appears again so
you can verify the changes. Press the Enter key again to proceed. If changes
were not made, pressing the Enter key causes the process to continue.
Note: The Key order prompt is only shown if you press the Enter key with Y (the
default) in the Allow duplicate key values prompt.
The Work with ... Definitions display will appear. On that display, you can choose
to do the following:
Create a new definition
Change a definition
Copy a definition
Delete a definition
Print or display the details of a definition
Rename a definition
Display the where-used information about a definition
Changing a Definition
Before you begin to change a definition, choose option 8 (Display where used) on
the Work with ... Definitions display to confirm that the definition is not linked to a
database file, because you cannot change a linked definition. IDDU does not
check for this link until you attempt to save the changes. Linking and unlinking
definitions and files is discussed in Chapter 14, “Maintenance Requiring Com-
mands or Programming.”
This and other potential error conditions are not tested for until near the end of the
definition process. Messages presented on the End ... Definition display describe
the cause of any errors that prevent you from saving the definition.
á ñ
You change a definition by choosing option 2 (Change) on the Work with ... Defi-
nitions display.
When you press the Enter key, you will see the Change ... Definition display with
the name of the definition and its dictionary. In addition, you see the ID of the
person who originally created the definition and the date, and the ID of the person
who last changed it and the date. When you get to the Field Options display, you
can also change the long comment and the text describing the definition. When the
Long Comment field of the Change ... Definition display is marked with a >, a long
comment already exists for that definition.
IDDU cannot detect changes that affect the relationships between the file and any
other program or utility; therefore, you must be aware of these programs and the
file characteristics they expect. For example, you could use AS/400 Query to
create a query of a file, and then use IDDU to change the size of a field or the
number or arrangement of fields without changing the name of the file or its defi-
nition. These changes will cause Query errors, and Query will describe the
detected changes.
On the Change a Record Format Definition display you can also choose to create
or select field definitions, and to specify record ID codes.
The Specify record ID code field is marked with a > when record ID codes have
already been defined. If no record ID codes are defined, all the records are used
for each format in the file. When you choose to specify record ID codes, you go to
the Define Record ID codes display; see “Using Record Identification Codes” on
page 10-1.
The type of field can be character, numeric, DBCS, or date/time. You must specify
the field size (except for date/time fields) and you can also enter a brief description.
Numeric fields require that you specify the number of decimal positions.
When you choose to specify more options for each of the four types of fields, you
can also work on field options displays. These additional options include column
headings, null values, keyboard shift values, long comments, and an alias for the
field described by the definition. See “Additional Characteristics for All Field Types”
on page 7-6, and Chapter 9, “Field Editing Techniques,” for details about the addi-
tional options.
When a changed field is to be used in a record format ID code test, be sure that
the data type of the field is specified only as zoned or character. This condition is
not tested for until near the end of the definition process. If the data in a field is not
either zoned or character, you will not be able to save the new definition. Record
format ID codes are discussed in “Using Record Identification Codes” on
page 10-1.
Also, do not change the size of a field definition so that the position tested for in a
record format ID code test is greater than the new field size. This also is not tested
for until near the end of the definition process. If you exceed the size limit you will
not be able to save the definition.
Do not increase the length of a field if such an increase will make the total length of
all fields in the record format definition greater than 32 766 bytes (32 740 bytes if a
variable-length field is used).
Remember that only character (SBCS) and DBCS fields can be variable-length and
that the maximum length of a variable-length field is 32 740 (16 370 for
DBCS-graphic fields).
Do not make an alias the same as any other alias, or the same name as any field
definition name that will be used by the same record format definition.
If a field is used as a key field, you cannot save a change that would exceed the
maximum key length. Also, you cannot change to a data type that cannot provide
the key field value specified in the file definition.
When you complete your work changing a field, use the End Field Definition display
to confirm the work you did and to see the other definitions and database files
affected by the changed definition. Remember that if any of your work causes
errors, you will not be allowed to save your changes.
Selection
F12=Cancel
á ñ
To save a definition, do not use the (F3) Exit. Enter the desired information and
press the Enter key until the End ... Definition display appears.
Copying Definitions
You can create a copy of any definition (in any dictionary you are authorized to
work in) and all its associated definitions. You can copy a file definition and all of
its associated record format and field definitions, a record format definition and all
of its associated field definitions, or a field definition. The copy can be made either
to the same dictionary or to another dictionary.
Choose option 3 (Copy) on the Work with ... Definitions display. Type the name of
the definition to copy, and press the Enter key. The following display appears:
á ñ
On the Copy ... Definition display, type a name for this copy of the definition and
the name of the dictionary into which you want the copy placed.
On the Copy ... Definition display, you can see the name of the definition you are
copying, the dictionary it is in, the date when it was created and the user ID of the
person who created it. Also, if one was entered, a brief description of the definition
is shown.
When you are copying a file definition or a record format definition into a different
dictionary, new versions of the definitions used by the file or record format will be
created in the (copied to) dictionary if identical versions do not already exist.
After you press the Enter key on the Copy ... Definition display, you will go to the
Confirm Copy display. Use that display to confirm or cancel the copying of the
definition.
à Confirm Copy
ð
Copy ... Definition
From . . . . . . . . : XXXXXXXXXX Dictionary . . . . . : XXXXXXXXXX
To . . . . . . . . . : XXXXXXXXXX Dictionary . . . . . : XXXXXXXXXX
The confirmation display gives you the opportunity to check the name of the defi-
nition being copied, and the name being assigned to the copy, as well as the
names of any other definitions that will be included in the copy.
á ñ
Use the Confirm Delete of ... Definition display to be sure that you are deleting the
appropriate definition, and to determine what items will be affected by the deletion.
You will get a message when you attempt the deletion if it will cause errors in a
related definition or file.
Printing Definitions
On the Work with ... Definition display, name the definition to print, and choose
option 6 (Print). When you press the Enter key, you see the following Print Options
display, where you confirm the name of the data definition you named on the Work
with ... Definitions display as the definition you want to print. If necessary, you can
change this to the name of a different definition.
F3=Exit F12=Previous
á ñ
On this display you choose the level of detail to print or display, and you can
specify the name of a printer device (a printer or a print queue). You can also
display the definition (rather than printing it) by specifying an * for the Printer
prompt.
Note: You can also print or display the contents of a data dictionary with the
Display Data Dictionary (DSPDTADCT) command, described in
Appendix D, “IDDU Commands.”
Figure 12-1 is an example of a complete file definition printout that illustrates the
level of detail available. You must have the capability to print 132 columns to be
sure of seeing all of the detail printed.
Dictionary . . . . . . . . . . : SYSDICT
Definition or generic\ . . . . : FILEDEFN
Definition type . . . . . . . . : \FILE
File information . . . . . . . : \ALL
Record format information . . . : \ALL
Field information . . . . . . : \BASIC
File Information
FILEDEFN FILE DEF 12/29/83 practice definition for DFU and Query
á ñ
You cannot rename:
Any definition if it will cause errors in other definitions
A field definition if the new name is the same as its current alias
A field definition if the new name is the same as any another field name or
alias used by the same record format
A record format definition if the new name is the same as that for another
record format definition used by the same file definition
A file definition if it is linked to a database file
Linking and unlinking definitions and files is discussed in Chapter 14, “Maintenance
Requiring Commands or Programming.” All the IDDU commands are discussed in
Appendix D, “IDDU Commands.”
When the rename occurs, all references to the old definition name in other defi-
nitions are changed to the new name.
á ñ
All Display Where ... Definition Used displays show:
The name of the dictionary containing the definition
The date when the definition was created
The user ID of the person who created the definition
A brief description of the definition, if one was entered
On the Display Where File Definition Used display, you also see:
A list of the files that use the definition
On the Display Where Format Definition Used display, you also see:
A list of the files and file definitions that use the definition
On the Display Where Field Definition Used display, you also see:
A list of the files, file definitions, and record format definitions that use the defi-
nition
Recovering a Definition
When a system failure such as a power failure interrupts the creation or changing
of a definition, the system attempts to save the work in progress. The work is
saved for a file or record format definition that was not completely created, or for a
file, record format, or field definition that was not completely changed. When you
attempt to work with the incomplete definition, you will see the Recover ... Work
display or Recover ... Definition Changes display. Also, if a field (or group of fields)
was being created via IDDU, the next time the user working on those fields selects
to create fields, the Recover Field Definition Work display is shown.
Selection
===>
á ñ
The Created, Created by, Last changed, and Changed by fields are not shown on
the Recover ... Definition Work display.
You can either attempt to recover and resume the interrupted session or continue
with your current task, discarding the information saved from the interrupted
session. The attempt to recover will begin at the appropriate Change (or Create)
Definition display.
Use the Work with Data Dictionaries display to choose the dictionary to maintain
and to describe the kind of maintenance you want to do. On that display, you can
choose to:
Create a new dictionary
Change a dictionary
Delete a dictionary
Print information about a dictionary
Additionally, you can do maintenance of dictionaries that does not use the Work
with Data Dictionaries display. This includes:
Saving a dictionary
Restoring a dictionary
Renaming a dictionary
These tasks are described later in this chapter, as is the effect on dictionary use of
definitions created or used by the Structured Query Language/400 (SQL/400*) lan-
guage.
To confirm that you really do want to delete a dictionary, type a Y for the Delete
prompt; or, if necessary, you can cancel the deletion by typing an N for this prompt.
When a dictionary is linked to an externally described file, the links are removed
during the deletion. You cannot delete a dictionary while it is linked to a program-
described file. You must use the Link Data Definition (LNKDTADFN) command
described in Appendix D, “IDDU Commands,” to unlink them.
F3=Exit F12=Previous
á ñ
The level of detail printed is the same as for printing the individual definitions, as
described under “Printing Definitions” on page 12-6. Alternatively, you can view
the contents of a data dictionary with the Display Data Dictionary (DSPDTADCT)
command described in Appendix D, “IDDU Commands.”
When it becomes necessary to restore the dictionary (or any part of the library),
you have only to reload the saved files from the backup medium using the RSTLIB
command after deleting the existing dictionary. To recover individual definitions,
see “Recovering a Definition” on page 12-11. When files existing in one library are
dependent on the definitions in another library’s dictionary, the library containing the
data dictionary should be restored first. This would be the case if a file were linked
to the definitions in a different library, or if a logical file has been created that
depends on the definitions in a different library.
Note: A dictionary that contains or has contained variable-length character, DBCS,
null-capable, or date/time fields cannot be saved prior to Version 2 Release
1.1. A dictionary that contains or has contained DBCS-graphic fields or file
For more general information about saving and restoring libraries and about using
the SAVLIB and RSTLIB commands, see CL Reference and Backup and Recovery.
SQL Terminology
SQL uses its own terminology in naming objects. When SQL creates a collection, it
is actually a library with a dictionary. When SQL creates a table, it is actually a file
with a definition. In general, the definitions in the dictionary can be worked with by
using IDDU. The following table shows the relationship between AS/400 object
names and SQL object names:
When SQL users and IDDU users share the same dictionary, some definitions
created by one may be used by the other. Both IDDU users and SQL users must
understand how they will affect each other.
When SQL no longer needs a definition, it is deleted unless it has been used by
IDDU. If the definition has been used by IDDU, it will not be dropped from the
dictionary when the SQL table is dropped. Only through SQL can you delete defi-
nitions created and used only by SQL (and then only when the definition is not
linked to a file).
Because SQL automatically links the definitions to files, definitions being used by
SQL cannot be deleted or changed by IDDU users. IDDU users can continue to
use the definition. They can print it, copy it, and view where it is used.
Unsupported SQL
SQL-created files are linked to the data dictionary associated with the collection
when the file is created. The Add Data Definition (ADDDTADFN) command does
not support SQL-created files because of this link. An error message informs you
that the command does not operate on SQL files.
Dictionaries created by SQL cannot be deleted using IDDU unless they have been
created as part of a library during a restore operation. Also, IDDU cannot restore a
SQL dictionary into an existing library. The library to receive the dictionary must be
created by the restore command. SQL files cannot be linked again to different dic-
tionaries.
In other cases, various other control language commands not directly related to
IDDU must be used. Yet other operations require that various programming lan-
guages be used because they support the type of data being worked on.
To use the command, you must know the name of the file and the library containing
it (library name/file name) so the file's name and library can be added to the speci-
fied dictionary. The default library for the file is *LIBL, or you can specify *CURLIB
for the library if you know the name of the current library.
You can place the file definition in any dictionary in any library to which you are
authorized. For example:
The ADDDTADFN command also creates a link between the file and the definition.
If you use the command again with the same file, the first link is dropped, and the
file is linked to the new definition.
Not all file definitions can be added to a dictionary using the ADDDTADFN
command. In general, these can be added:
Physical files
Nonjoin logical files with one format and no select/omit specifications
When a database file uses a function not supported by IDDU, all of the file’s
descriptions might not be added to the dictionary by the ADDDTADFN command,
and only field and record format definitions are created. Database files using the
following functions lose the description of the given function, and the file definition
is not created:
Field default values
Field validity check codes
Key fields defined using names based on a physical file
Database files using the following functions do not have any definitions added to a
dictionary by the ADDDTADFN command:
Access path sharing
Alternative collating sequence
After the file is unlinked from its definitions, you can add fields or make other
changes to the definitions. See Chapter 12, “Maintaining Definitions” for informa-
tion about changing the file, field, and record format definitions that describe a file.
Data Unchanged
If the data can be copied exactly, use the CPYF command:
CPYF tempfile filename FROMMBR(\ALL) TOMBR(\FROMMBR) MBROPT(\ADD) FMTOPT(\NOCHK)
The data can be copied exactly for the following types of changes:
Renaming a definition
Changing a definition’s text or long comment
Changing a field’s column headings, editing characteristics, keyboard shift, or
alternative (alias) name
Adding fields to the end of a record format
Changing record ID codes for a record format
Adding or sequencing record formats again within a file definition
Deleting a record format from a file definition, if the record length of the file
remains the same
Changing a character field to a zoned numeric field of the same size
Changing a zoned numeric field to a character field of the same size
Changing a character field to a DBCS field of the same size
Changing a DBCS field to a character field of the same size
Changing decimal positions for a zoned or packed numeric field
Selecting key fields for a file definition
Changes other than those listed here will require that you to create a high-level
language program to copy the data; for example, changing a character field to a
numeric field other than zoned numeric. You must use a programming language
that supports the types of data being converted.
CPYF tempfile filename FROMMBR(\ALL) TOMBR(\FROMMBR) MBROPT(\ADD) FMTOPT(\MAP \DROP)
The data can be converted by the CPYF command for the following types of
changes:
Adding fields to a record format definition (the CPYF command inserts default
values for new fields)
Deleting fields from a record format definition (the data for these fields is
deleted during the copy)
Sequencing fields again in a record format definition
Changing the size of a field (the data is either padded or truncated)
Changing the numeric field from one numeric type to another (unless it is a
binary field with decimal positions greater than zero, which cannot be changed)
When the original file is linked to the dictionary in the library containing the file, and
the library containing the new file also contains a dictionary, the system attempts to
link the new file to the dictionary in the library containing the new file. For program-
described files there is no assurance that the definition matches the old definition,
and if the definition is not found, the file is not linked. If no dictionary exists in the
To library, the link is made to the original dictionary.
Change File
When a linked, externally described file is changed using the Change Physical File
(CHGPF) or Change Logical File (CHGLF) commands, the new definition of the file
is added to the data dictionary.
Link File & Definition *USE *USE 1. *ALL 2. *USE 1. LNKDTADFN *USE
The following tables show levels of authority required for operations done outside of
IDDU and how generic authority levels correspond to specific rights.
When you have special save system authority (*SAVSYS), the authorities listed for
saving and restoring a dictionary are not required.
Authority/Rights Table
Figure 15-3 shows how generic authority levels correspond to specific rights.
*CHANGE X X X X X
*CHANGE 1. X X
*CHANGE 2. X X X
*USE X X
*USE 1. X
*EXCLUDE
As initially created, these files have *EXCLUDE authority assigned to them. The
authority level must be changed to the *USE level for any files that are to be
accessed.
IDDU users will not use all of the information in these appendixes.
Current Operations
Before setting up data files in your office, you should review your current file oper-
ations. The file processing operations that are discussed here are manual file and
computer-based file processing operations on an AS/400 system. The manner of
your current operation controls how you should now handle files in your area using
the AS/400 system.
Analyze your current manual operations by asking yourself and others the following
questions:
About the input:
– What information do you want to keep in the system?
– What source documents (including handwritten notes and telephone
memos) do you now use? Where does the information originate?
– Is any data duplicated in these documents?
– Is any data supplied regularly?
About the process:
– What operations do you need to do for each task?
– What decisions are necessary?
– What steps are repeated?
– What paths does the paperwork follow?
– How dependent is each process on the completion of the preceding
process?
About the output:
– What lists, reports, and letters are now being made from the information in
the file; and what other types of output could you make from the informa-
tion in the file? For example, would you like to sort the information into an
alphabetic or numeric arrangement, or calculate mathematical results?
– How often are reports made?
– To whom are reports distributed?
– Do any reports or documents contain duplicate information?
– Is useful information missing from the reports?
– Can the data be resorted or recalculated quickly?
You should also check potential sources of files by talking to the people who work
in the area where files are kept. They might be able to supply additional informa-
tion about how the file is maintained and used.
As you identify existing files, define the various purposes of each file by completing
the following steps:
1. Collect and examine the different sample output documents made from a file.
When you need to make new reports or letters, sketch a sample to show what
information to include and in what sequence.
2. Identify the variable information on each sample document. When the sample
document is a list or report, you might find almost the entire output consists of
variable information.
3. Mark the fields of the sample document represented by variables.
4. Mark the variables that are a result of calculations using fields in the file; indi-
cate those that are inquiries of the data.
5. List the fields of information currently in the existing file, and for each field:
A field name (a maximum of 10 characters) that is descriptive of the data.
A field data type: character, numeric, DBCS (double-byte character set),
date, time, or timestamp.
The maximum possible field length.
The number of decimal positions in numeric fields.
Any other relevant information about each field, such as:
– Are the names of states indicated by 2-character abbreviations?
– Are leading zeros shown; indicated; replaced?
– How are decimal points indicated?
– How are credits or negative values indicated?
– Does a currency symbol appear; where?
– How are dates and times shown?
How each field is used, and any relationships it might have with other
fields.
Name Fields
As you design your file, you might consider a person’s full name (first name, middle
initial, last name, and title) to be one field of information. However, you should look
at how the name will be used in output.
For example, when you list a field in a query report or in a document, the
system prints all the information in the field. Thus, if a person’s full name is in
one field, the full name will be printed every time that field is used.
When you are sending a person a letter, a salutation such as Dear Mr. William
A. Jones is awkward. Also, if you are using such a name field to alphabetically
sort a list of names, the field will be sorted by the M, not by the J in Jones.
Remember to include a title field (Mr., Mrs., and so on) in any file in which you
have names. The system does not know what title belongs with a name.
Unless you have a title field in your file, one solution would be to use one title
in the shell document with all names; but that can result in a letter to a Mr.
Sally Brown. Another solution would be to include the title with the name, but
Therefore, for maximum versatility, a name field should be broken up into at least
five separate fields in the file stored on the system: title, first name, middle name
or initial, last name, and subtitle. This arrangement will give you maximum flexi-
bility for using the name in output.
Address Fields
As you design a file, you might put the entire address in one field. However, doing
this prevents you from selecting parts of the address or sorting them into a specific
order based on information in the address field. You might want to sort your file so
that names and addresses appear in order by zip codes. You can do this only if
the zip code is in a field by itself. If you want to select all the records for people
living in Texas, the state must appear in a separate field.
For maximum flexibility, you should use at least one field for the street or postal
address, one field for the city, one field for the state, and one field for the zip or
postal code. You might also consider creating a country field.
Date Fields
The following method of handling dates is an alternative to the AS/400 date
support; this method may be useful in special situations.
When dates are arranged as YYMMDD, the records sort by year, then by month,
then by day. This arrangement should suit most of your needs. However, you
might want to print lists such as a monthly birthday list. To do this with the fields
arranged by month, then by day without regard to the year, your field would be
MMDD or MMDDYY.
To gain the greatest flexibility, separate your data into three fields: year, month,
and day. You still type the year as YY, the month as MM, and the day as DD, but
each part of the date is in a different field. This allows you to sort or select the
fields in any arrangement of year, month, and day for an application using all three
fields, or by only month and day for the birthday list.
Using three fields for each date does require more fields, but it is more useful than
the YYMMDD design. Generally, if you are not sure about all the possible uses of
your file, use one field for dates using the months by name, and one field each for
the numeric representation of the year, month, and day. Furthermore, if you define
the three date fields as containing numeric data, you have the ability to perform
calculations based on these values.
Combined Fields
If a file will contain a large number of fields, consider a combined field for informa-
tion that you want to track but not necessarily print. In a combined field, you can
use codes for information instead of spelling the information out to compress a
number of fields into one field.
For example, instead of designing one field for sex and one field for age, you might
define one field and use a code for sex (M for male, and F for female, for example)
and a number for age. An entry for a female, age 24, would be F24; a male, age
31, would be entered as M31.
Before you decide to use combined fields in your file, you must consider carefully
how the file is to be used. You can still select records using this method.
However, your flexibility in sorting is limited. In this example, if you sorted
according to the combined sex and age field, the records with females would
always appear before males because F sorts before M. It would not be easy to
sort the records into order based on age.
In addition, because you cannot easily print part of a field, to print a list of names
and ages you would normally have to print the entire field. Instead of printing Jane
Doe, 24, the system would print Jane Doe, F24.
1. Go to the IDDU menu by choosing the IDDU option from either the Files menu
or the Decision Support menu; or you can type the Start IDDU (STRIDD)
command on any command line.
2. Create a data dictionary, unless one exists in a library you can use. If a data
dictionary exists that you can use, go to step 7.
3. Choose the Work with Data Dictionary option on the IDDU menu.
4. Choose option 1 (Create) on the new display, type the name of the library that
will contain the dictionary, and press the Enter key.
Note: If you attempt to create a data dictionary and the named library does
not exist, you will see the Create a Library display. From this display
you can create the library that will contain the data dictionary. When
you have finished creating a library, you will continue to the Create a
Data Dictionary display.
5. On the Create a Data Dictionary display, the name of the library will appear as
the name of the dictionary. Later in this exercise, we will use a dictionary name
of SYSDIC; you can replace SYSDIC with the name of another dictionary.
6. You can accept the system-supplied values and press the Enter key. You also
can type a brief description in the Text field and choose to enter a long
comment. If you choose option 1 (Select) for the Long comment prompt, you
will be shown the Edit Long Comment display, where you can type detailed
information about the dictionary. The dictionary will be created when you end
your work on that display.
The AS/400 system can take some time to create the dictionary; it will advise
you with a message when the dictionary has been created. After you create
the dictionary, press F12 (Previous) on the Work with Data Dictionary display to
return to the IDDU menu.
7. Choose the Work with data definitions option on the IDDU menu and press the
Enter key.
8. You will name the file definition first, so select option 3 (File).
We have used SYSDIC as an example of a dictionary name; you can replace
that name if another is appropriate.
Record formats
option . . . . . . . 2 1=Create and/or select formats
2=Create default format
and select fields
F3=Exit F12=Cancel
á ñ
Then press the Enter key.
11. You are now ready to begin creating the field definitions that will be used by
the record format definition you just named. Name the first field definition you
will create for the record format definition on the Create and Select Field Defi-
nitions display. Use the system-supplied sequence number on the display.
Then press F6 (Create field definition). You will complete the description of this
first field definition, as well as name and describe the remaining field defi-
nitions, using the next display.
12. Complete the first description with its type, size, and any other characteristics,
and then name and describe the remaining field definitions.
For numeric fields, you have to specify the number of decimal positions.
13. When you have completed specifying the field characteristics, press the Enter
key; the fields are created. The Create Field Definitions display is shown
again, which allows you to specify more fields. If you do not want to specify
more fields, press the Enter key without making any changes to the display.
14. When you see the Create and Select Field Definitions display, verify that the
field names are arranged in the proper sequence.
More ...
F3=Exit F5=Refresh F1ð=Work with database files
F11=Display text F12=Cancel F22=Work with data dictionaries
á ñ
You are finished creating the definitions describing a database file. The
instructions to create the file and to enter data into the file are in Chapter 8,
“Working with Database Files.”
Data Descriptions
You can use DDS to describe how the data is organized. The system saves these
descriptions with the file when it is created (using, for example, the Create Physical
File (CRTPF) command).
Data
RSLL479-0
DDS allows you to define database files on the AS/400 system. You might have to
use this method to use all of the AS/400 database features. For more information
see DB2 for AS/400 Database Programming.
Data Definitions
You can create field, record format, and file definitions with IDDU. The system
stores them in a data dictionary. These data definitions are associated with the file
when the file is created using IDDU.
Field Definitions
(field characteristics)
Data File
Data Descriptions
(created using the
data definitions
from the data
dictionary)
Data
RSLL477-0
Dictionary Descriptions
Dictionary descriptions have the definitions of the file, its format, and the fields used
by the format described once in a data dictionary and have these definitions used
by many programs for many purposes. It is necessary to describe all the fields
only once, and then organize those fields in different ways, using different record
formats, for differing file uses.
In all cases, the file and the dictionary definitions are linked during creation. The
following figure illustrates this relationship.
Field Definitions
(field characteristics)
Data
RSLL476-1
All files created by IDDU will have one member that has the same name as the file.
If you do not use CL commands to add additional members to the file, then you can
use that file name when you enter data into the file or query the file.
Program-Described Files
Program-described files are database files that do not have the data descriptions
stored with the file. This means that some programs, such as Query/400, cannot
use these files without a method of determining the format of the file. (IDDU is
such a method.) Application programs written in a “high-level” programming lan-
guage, such as RPG or COBOL, use program statements to describe the files and
data they use. These files are called program-described files. The database file
and its data descriptions are known to the program in which the descriptions are
contained; they cannot be used by any other program on the system. Each
program that refers to a database file must contain its own set of data descriptions.
Conceptual Differences
The following list identifies the concept that is different on the AS/400 system along
with an explanation of the differences as it applies to the listed concept:
Concept Differences
Folders On System/36, a data dictionary was stored in a folder. On
the AS/400 system, a data dictionary is stored in a library.
You can only have one data dictionary specified per library.
Both the data dictionary and the library have the same name.
#USRDCT The data dictionary name #USRDCT was automatically
created and used as a default dictionary on System/36. If
you require a dictionary named #USRDCT on the AS/400
system, you must create it on your AS/400 system.
Communications files
Definitions for communication files are not stored in data dic-
tionaries on the AS/400 system as they were on System/36.
You must use DDS to define intersystem communications
function (ICF) files on the AS/400 system.
Filler fields On System/36, filler fields did not have to be named. On the
AS/400 system, filler fields must be named; they show up
when you define your queries.
Linking files On the AS/400 system, date-differentiated files are stored as
members in the same file. Therefore, all date-differentiated
files must be linked to the same definition.
Operational Differences
The following list identifies the operation that is different on the AS/400 system
along with an explanation of the differences as it applies to the listed operation:
Operation Differences
Changing definitions On the AS/400 system, you cannot change a long comment,
text, and editing comments when the file is linked, as you
could on System/36.
ANK/IGC Either On System/36, you could use either ANK Either or IGC
Either. On the AS/400 system, you can only use ANK Either.
Command Differences
The following table lists the System/36 data dictionary commands and the equiv-
alent AS/400 commands (if appropriate) plus some system commands that work
with data dictionaries:
System/36 AS/400 System
IDDU STRIDD
IDDUDCT WRKDTADCT
IDDUDFN WRKDTADFN
IDDUDISK WRKDBFIDD
IDDULINK LNKDTADFN
IDDUPRT DSPDTADCT
IDDURBLD Not required
IDDUXLAT1 Not supported
DELETE1 DLTDTADCT
SAVEFLDR1 SAVLIB
RESTFLDR1 RSTLIB (or RSTS36FLR2)
RENAME1 RSTLIB to different library
No equivalent ADDDTADFN (new)
No equivalent CRTDTADCT (new)
1 These IDDU commands do not work within the AS/400 System/36 environment.
2 Restores a dictionary saved on a System/36 using the SAVEFLDR command.
Index X-3
display (continued)
Describe Numeric Field Editing 7-13 F
Editing a Long Comment 4-3 field
End ... Definition (example) 12-1 additional characteristics
Field Options 7-13 numeric fields 7-8
IDDU Main (system) Menu B-1 allocated length 7-10
list example 2-5 basic characteristics 7-5
Print Options 12-6, 13-2 column headings 7-6
Select Definition Type 2-5, 5-5, 6-4, 7-12, B-2 concepts 1-2
Selecting Field Definitions 5-7 data type 7-5
Specify Edit Code 9-1 defining key 11-1
Specify Edit Word 9-3 design considerations A-3
Work with ... Definitions (example) 12-1 editing
Work with Data Dictionaries 4-1, 13-1 date/time 7-10
Work with Database Files 8-1 in a record
Work with Field Definitions 7-12 considerations 6-3
Work with File Definitions 3-2, 3-3, 3-4, 5-5, B-2, key 11-1
B-5 name A-3
Work with Record Format Definitions 6-4 null attribute 7-7
displaying size 7-5
data definitions 12-6 field definition
data dictionary contents 12-6 changing 12-3
DLTDTADCT (Delete Data Dictionary character 7-9
command) D-1 column headings 7-6
document copy confirm 12-5
merging data A-1 copying 12-4
double-byte character set (DBCS) creating 7-12
additional characteristics 7-9 DBCS 7-9
data types 7-9 delete confirm 12-6
defining 7-5 deleting 12-6
DSPDTADCT (Display Data Dictionary description 2-3
command) D-1 design considerations
duplicating address fields A-4
data dictionaries 13-4 character and number fields A-4
combined fields A-5
name fields A-3
E field type 7-5
edit code (EDTCDE) grouping 2-4
description 9-1 long comment, text 7-7
parameters 9-1 name 7-5
table 9-2 null attribute 7-7
edit word 9-3 planning 7-1
editing renaming 12-10
fields 9-1 size 7-5
numeric fields 7-8, 9-3 where used 12-11
techniques 9-1 work sheet 7-4
Editing a Long Comment display 4-3 work with 7-14
EDTCDE (edit code) field described files
description 9-1 externally described C-4
parameters 9-1 Field Options display 7-13
table 9-2 file
End ... Definition display example 12-1 concepts 1-1, 1-2
exercise creating the database 8-1
practice example B-1 cross-reference 16-2
externally described files C-4 database C-3
dictionary
cross-reference 16-2
Index X-5
numeric
L character shift 9-4, 9-6
level of authority keyboard shift 9-6
data dictionary 4-2 numeric shift 9-6
generic 15-2 numeric field
library for data dictionary 4-1 additional characteristics 7-8
link data definition and file 14-1 data type 7-8
linked definition decimal positions 7-6
changing 14-2 edit word 9-3
linked files editing 7-8
externally described C-4
list
using 3-3 O
list display office security, resource 4-2
example 2-5 operation
listing authority requirements
data definitions 12-6 IDDU 15-1
data dictionary contents 12-6 non-IDDU dictionary 15-2
LNKDTADFN (Link Data Definition) command D-1 current file A-1
long comment manual file processing A-1
dictionary 4-3 option
field definition 7-7 choosing 3-2
file definition 5-4 multiple 3-4
record format definition 6-4 IDDU menu 3-1
Main IDDU (system) Menu 3-1, B-1
M
maintaining P
data concepts 1-5 packed data 7-8
data dictionaries 13-1 position to sequence number 5-8
definitions 12-1 practice exercise B-1
manual file processing A-1 print options display 12-6, 13-2
members and file C-3 printing
menu data definitions 12-6
IDDU options 3-1 data dictionary contents 12-6, 13-2
main menu options 3-1, B-1 processing files
missing database file definition 14-2 computer A-2
multiple record format 5-3 design considerations A-3
manually A-1
reports, documents A-1
N processing operation A-1
name program linked files (externally described) C-4
alias 7-7, 9-4 program-described file 14-2, C-4
alternative 7-7, 9-4
dictionary 4-1
field A-3 Q
field definition 7-5 querying data concepts 1-4
file definition 5-3
position to 5-8
record format definition 5-3, 6-3 R
new definition, field 7-12 record concept 1-2
non-IDDU authority requirement 15-2 record format
nondictionary described file C-1 changing 12-2
null attribute 7-7 considerations 10-1
number field A-4 create 5-7
create format for a file definition 5-7
defining 6-1
Index X-7
task, data dictionary 4-3
text (description)
dictionary 4-3
field definition 7-7
file definition 5-4
record format definition 6-4
time format 7-11
time separator 7-11
U
unlink data definition and file 14-1
V
viewing a data dictionary 13-3
W
Work with ... Definitions (example) 12-1
Work with Data Dictionaries display 4-1, 13-1
Work with Database Files display 8-1
Work with Field Definitions display 7-12
Work with File Definitions display 3-2, 3-3, 3-4, 5-5,
B-2, B-5
Work with Record Format Definitions display 6-4
working with
data dictionary 4-3
database files 8-1
definitions 12-1
dictionary
access rights 4-2
authority 4-2
field definitions 7-14
file definitions 5-9
nondictionary described files C-1
record format definitions 6-7
WRKDBFIDD (Work with Database Files)
command D-2
WRKDTADCT (Work with Data Dictionaries)
command D-2
WRKDTADFN (Work with Data Definitions)
command D-2
Z
zoned data 7-8
Very
Very Dissatis-
Satisfied Dissatis-
Satisfied fied
fied
Overall satisfaction
How satisfied are you that the information in this manual is:
Accurate
Complete
Easy to find
Easy to understand
Well organized
Applicable to your tasks
THANK YOU!
Note that IBM may use or distribute the responses to this form without obligation.
Name Address
Company or Organization
Phone No.
Cut or Fold
Reader Comments—We'd Like to Hear from You!
IBM
Along Line
SC41-5704-00
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
Cut or Fold
SC41-5704-00 Along Line
IBM
SC41-57ð4-ðð
Spine information: