Intro to the AS/400

Download Report

Transcript Intro to the AS/400

Intro to the AS/400
Chapter 8 - Data File Utility
Copyright 1999 by Janson Industries
1
Objectives



Explain the capabilities of a DML
Explain how DFU performs typical
DML functions
Demonstrate the advantages and
disadvantages of DFU
2
Data Manipulation Language


Allows you to add, delete and
modify data
On the AS/400 you can use
 Application
programs
 SQL/400
 DFU
3
DFU


Allows you to create temporary or
permanent update programs
Permanent update programs are stored
as program objects with an attribute
equal to DFU.
Library
User
DFU
Type = *PGM
Att = DFU
4
DFU generated programs



Allow you to display, modify or delete a
single record (from one file) at a time
Generate an audit report and a screen
When creating permanent programs
you can control:
 Which
 The
format of the displayed data
 Audit
 The
fields can be accessed
report content
update screen appearance
5
Using DFU

To Create and Run a Temporary
Program:
 STRDFU
- Option 5
 Option
18 from the “Work with
Objects using PDM” screen

You are prompted for a library
and file name
6
STRDFU
AS/400 Data File Utility (DFU)
Select one of the following:
1.
2.
3.
4.
5.
Run a DFU program
Create a DFU program
Change a DFU program
Delete a DFU program
Update data using temporary program
Selection or command
===> ___________________________________________________________________
________________________________________________________________________
F3=Exit
F4=Prompt
F9=Retrieve
F12=Cancel
7
Using DFU
Update Data Using Temporary Program
Type choices, press Enter.
Data file . . . . . . . . .
Library . . . . . . . . .
Member . . . . . . . . . .
F3=Exit
F4=Prompt
__________
*LIBL
__________
Name, F4 for list
Name, *LIBL, *CURLIB
Name, *FIRST, F4 for list
F12=Cancel
8
Using DFU

If file is empty, default is entry mode

If file has data, default is change mode

To switch between modes:
 F9
- Entry Mode
 F11
- Change Mode
 F23
- Deletes current record
9
DFU update screen
WORK WITH DATA IN A FILE
Format . . . . :
ITEMREC
Mode . . . . :
File . . . . :
CHANGE
ITEM
INUM: ______
F3=Exit
F9=Insert
F5=Refresh
F10=Entry
F6=Select format
F11=Change
10
Defining Permanent Programs

Option 2: Create a Program

Prompts for file and program names

A series of screens will be displayed
which allow you to:
 Control
program functions - update on
scroll, generate an audit report, etc.
 Define
the screen layout and save the
DDS definition
 Control
data fields - select and
sequence, format, etc.
11
Defining Permanent DFU Programs
Define General Information/Indexed File
Type choices, press Enter.
Job title . . . . . . . . . . . . . .
Display format . . . . . . . . . . .
ITEMUPDATE
2
1=Single, 2=Multiple
3=Maximum, 4=Row oriented
Audit report . . . .
S/36 style . . . . .
Suppress errors . . .
Edit numerics . . . .
Allow updates on roll
Keys:
Generate . . . . .
Changes allowed . .
.
.
.
.
.
Y
N
N
N
Y
Y=Yes,
Y=Yes,
Y=Yes,
Y=Yes,
Y=Yes,
. . . . . . . .
. . . . . . . .
N
Y
Y=Yes, N=No
Y=Yes, N=No
F3=Exit
F12=Cancel
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
N=No
N=No
N=No
N=No
N=No
F14=Display definition
12
Defining Permanent DFU Programs
Select and Sequence Fields
File . . . . . . . . . . . :
Record format . . . . . . . :
ITEM
ITMFMT
Library
. . . . :
YOURLIBXX
Select fields and their sequence or press F21 to select all; press Enter.
Sequence
______
______
______
______
Field
ITMNUM
ITMNAM
ITMDESC
ITMQTY
F3=Exit
F20=Renumber
Attr
KEY
Length
6
15
30
10
F5=Refresh
F21=Select all
Type
CHAR
CHAR
CHAR
DEC
F12=Cancel
Description
ITEM NUMBER
ITEM NAME
ITEM DESCRIPTION
ITEM QUANTITY
Bottom
F14=Display definition
13
Defining Permanent DFU Programs
Exit DFU Program Definition
Type choices, press Enter.
Save program . . .
Run program . . . .
For choice Y=Yes:
Type of run . .
Modify program . .
Save DDS source . .
. . . . . .
. . . . . .
Y
Y
Y=Yes, N=No
Y=Yes, N=No
. . . . . .
. . . . . .
. . . . . .
1
N
N
1=Change, 2=Display
Y=Yes, N=No
Y=Yes, N=No
ITEMUPDATE
YOURLIBXX
*LIBCRTAUT
ITEMUPDATE
Name
Name, *CURLIB, . . .
Name, *LIBCRTAUT, . . .
For Save program Y=Yes:
Program . . . . . . .
Library . . . . . .
Authority . . . . . .
Text . . . . . . . .
For Save DDS source
Source file . . .
Library . . . .
Source member . .
F3=Exit
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Y=Yes:
. . . . . .
. . . . . .
. . . . . .
F14=Display definition
*CURLIB
ITEMUPDATE
Name
Name, *CURLIB, . . .
Name
F17=Fast path
14
Defining permanent programs

DFU creates:



The permanent program
A display file (a screen)
Optionally, the DDS screen definition
Library
*FILE
DSPF
User
*PGM
DFU
DFU
Source
Physical File
Type = DSPF
15
DFU generated update programs

Allow you to update data

Generate an audit report
Library
Audit
Report
User
data
Data
Physical
File
Update
Program
data
Member
16
Managing Permanent DFU Pgms

Option 1: Run a Program
 Activates
previously defined update
programs

Option 3: Change a Program
 The
create screens are redisplayed with
the originally specified values
 You can change any value

Option 4: Delete a Program
 Deletes
any previously defined update
program
17
Points to Remember




DFU is a quick way to generate
update programs
Update programs allow you to easily
add, delete and update data, one
record at a time.
Any significant amount of data is
burdensome to manipulate with DFU
generated programs.
Permanent programs can be tailored
re: function and format.
18