Professional Documents
Culture Documents
UNIQUE
R PF1REC
ENAME
ENO
ESAL
EAGE
EBASIC
ESEX
EADD
20A
4S
4S
2S
4S
1A
50A
RANGE(1 1000)
VALUES(1000 3000 9000)
COMP(EQ 'M')
CHECK(ME)
0010.00
0011.00
EJD
K ENO
DATFMT(*DMY)
2)
PF90
0001.00
0002.00
0003.00
0004.00
0005.00
0006.00
UNIQUE
R PF90REC
ENAME
ESAL
EID
K EID
20A
4S
4S
3)
PF91
0001.00
0002.00
0003.00
0004.00
0005.00
0006.00
4)
PF100
0001.00
0002.00
0003.00
R PF91REC
EID
EDEPT
EAGE
K EID
A
A
A
UNIQUE
4S
4A
2S
R REC1
NAME1
ADDR
10A
20A
R REC2
NAME2
TELEPHONE
10A
8S
5)
PF101
0001.00
0002.00
0003.00
6)
PF10
0001.00
0002.00
0003.00
0004.00
R REC1
NBR
NAME
K NBR
3S 0
20A
R PFL
EMPNAME
EMPNUM
EMPAGE
EMPSAL
K EMPNAME
20A
3S
2S
6P 2
7)
PF3
0001.00
0001.01
0003.00
0004.00
0005.00
0006.00
0007.00
A
A
A
A
A
A
2) LOGICAL FILES
1) NON-JOIN LOGICAL FILES
A)
LF1
0001.00
0002.00
0003.00
0004.00
0005.00
R LF1REC
ENAME
ENO
ESAL
K ENO
PFILE(PF1)
R LF1REC
ENO
ENAME
K ENO
R LF2REC
EDEPT
ENO
K ENO
PFILE(PF1)
PFILE(PF2)
JFILE(PF1 PF2)
JOIN(PF100 PF101)
JFLD(NAME1 NAME2)
JDUPSEQ(TELEPHONE
JFILE(PF1 PF2)
JOIN(PF1 PF2)
JFLD(ENO ENO)
JDUPSEQ(ENAME)
JREF(PF1)
left outer
LF4
0001.00
0002.00
0003.00
0004.00
0005.00
0006.00
0007.00
R LF4REC
J
EID
EDEPT
K EID
JDFTVAL
JFILE(PF90 PF91)
JOIN(PF90 PF91)
JFLD(EID EID)
JREF(PF91)
LF12
0001.00
0002.00
0003.00
0004.00
0005.00
0006.00
0007.00
08.0
R LF123REC
J
ENO
EDEPT
ESAL
JDFTVAL
JFILE(PF2 PF1)
JOIN(PF2 PF1)
JFLD(ENO ENO)
JREF(PF2)
K ENO
JLF2
0000.01
0002.00
0003.00
0004.00
0005.00
0006.00
0007.00
08.0
R JOINREC
J
NBR
NAME
SALARY
JDFTVAL
JFILE(PF10 PF11)
JOIN(PF10 PF11)
JFLD(NBR NBR)
JREF(PF10)
K NBR
A
A
A
A
R LREC1
J
A
A
A
A
A
A
EMPNUM
EMPNAME
EMPAGE
EMPSAL
K EMPNUM
O EMPNUM
pf
0001.00
R RCD1
DYNSLT
JDFTVAL
JFILE(PF3 PF4)
JOIN(PF3 PF4)
JFLD(EMPNUM EMPNUM)
JDUPSEQ(EMPAGE)
JREF(PF3)
COMP(LT 502)
0002.00
0003.00
0004.00
NBR
000001
000002
000003
000004
******
NBR
NAME
MGRNBR
NAME
MGRNBR
235
shankar
440
440
praveen
729
500
srinivas
440
729
srikanth
888
******** End of report
3S
10A
3S
DFT('NONE')
********
SJ3
LF (Self join Source Member)
0000.01
0002.00
A
R JOINREC
0003.00
A
J
0004.00
A
0005.00
A
NBR
0006.00
A
NAME
0007.00
A
MGRNAME
0008.00
A
JDFTVAL
JFILE(SJ1 SJ1)
JOIN(1 2)
JFLD(MGRNBR NBR)
JREF(1)
JREF(1)
RENAME(NAME)
JREF(2)
O/P:000001
000002
000003
000004
NBR
235
440
500
729
NAME
shankar
praveen
srinivas
srikanth
NAME
praveen
srikanth
praveen
NONE
3)
A
A
A
A
A
A
R RF1REC
EMPNUM
EMPNAME
EMPAGE
EMPSAL
EMPTELPNUM
3S
20A
2S
6P 2
7S
TEXT('EMPLOYEE NUMBER')
A
A
A
A
A
A
A
R PR1REC
EMPNUM
EMPNAME
EMPAGE
EMPSAL
K EMPNUM
REF(PVN/RF1)
R
R
R
R
PF2
0001.00
0002.00
d0003.00
0004.00
0005.00
R PF2REC
ENO
EDEPT
K ENO
REF(PF1)
TEXT('EMPLOYEE RECORD')
R
4A
REFACCPTH(PRA1/PF1)
PFILE(PF1)
BASIC COMMANDS
1)
2)
3)
4)
5)
6)
7)
To
To
To
To
To
To
To
===============================================================
FAQs related to DB2/400 part:What are Database files?
Database files are AS/400 objects that contain data or provide access to data.
What are Device files?
Device files contain no actual data, but gives introduction about how to use a
particular device.
Ex: - Printer File (PRTF), Display File (DSPF), Tape File (TAPF), Diskette
File (DKTF)
What are Save Files?
Save Files are of type *File and attrib *Save are a special form of files that
are used to save or restore data.
Ex: - Similar to Log Files in Windows.
What are DDM Files?
DDM files are AS/400 objects, which represent files that exist on a remote
machine
Important Points to be covered
1.
2.
3.
4.
5.
6.
7.
8.
9.
DSPFFD
DSPFD
DSPDBR
DSPOBJD with parameter Detail (*service)
WRKOBJ with parameter Detail (*service)
Access Path & Open Data Path
DSPPFM You can view the data that exists in a specific data member of
a file by using DSPPFM command.
Externally Described Files Data base files that are created with field
level description are referred to as Externally Described Files.
Program Described Files - Only the length of the record in the file is
described to the system, the system does not know about the fields in
the file. These database files are referred to as Program Described
Files.
Note: - by using RCDLEN parameter on CRTPF or CRTSRCPF.
types in AS/400
mmddyy
ddmmyy
yymmdd
yyyy-mm-dd
It will accept as the format of the system.
yyddd
mm/dd/yy
How will you read or update the records of the file which are using Arrival
sequence access path?
Using RRN Relative Record Number.
Two Logical Files LF1 & LF2 are based on a Physical File PF1. The Unique
Keyword is specified for LF1. If you use LF2 to add a record to PF1, can
you add a record if it causes a duplicate key value in PF1?
No.
High Priority Questions:Can you update a data base file using Join Logical Files?
No, U can update a d/b file using Single Record Format Non Join Logical
File
Usage of DDS Keyword REFACCPTH with real time example - to be covered with
out fail
What is Level Check Error? Why does that occur and whats the logic behind
it?