AS400 Introduction
AS400 Introduction
It is multiuser, multitasking and very secure system and hence is used for the industry
which requires sensitive data to be stored and processed simultaneously.
It has integrated the DB2 database management system, menu-driven interfaces, multiuser support, security, communications, clientserver and web-based applications.
It is best suited for mid-level industry and hence is used in pharmaceutical industry,
banking, malls, hospital administration, manufacturing, distribution industry, financial
organization, e-commerce etc.
The AS/400 (Application System/400) was first introduced by IBM on June 21st, 1988
and later renamed to as eServer iSeries in 2000, then in 2006, it was renamed
as System i . In 2008 System igot unified with System p to become Power system.
The operating system for AS400 also got renamed with the rebranding. Initially, it
was OS/400 theni5/OS and then iBM i (Power system).
OS/400
Version
4,
introduced
Programming
languages
available
for
the
AS/400
language, C, C++, Pascal,Java, Perl, Smalltalk, COBOL, SQL, BASIC, PHP, Python.
It has Object orientation i.e. everything that can be stored or retrieved on the system is
known as anobjects. AS400 can recognize only the object types that have been
defined for it. It cannot identify any unknown objects that dont seem to be known. It
adds extra security to the system.
It provides contiguous memory between main storage and disk storage. It provides
authority to add any disk space so that use.
Another feature of AS400 is that it is very secure system making it to store sensitive
data. It incorporates security at various levels. Any user can be limited to access/process
only particular information on the system.
Library
When we execute a command or call a program, the AS/400 must know where to find
the command or program and the answer is library.
QSYS is the root library where the entire user defined/ system defined library is
created.
System library is the library that contains the objects that was created at the time
OS400 was installed.
When you logon the first library to be load is QSYS. The system library is loaded at
the first time.
System library: All IBM supplied library e.g. QSYS, QHLPSYS, QUSRSYS
Current Library: Current library is the working library i.e. all the work done by you
is stored in current library. If you want that all the things done by you should be stored
in your personal library AMINEM , then just change the current library as your
personal library.
To
change
AMINEM: CHGCURLIB
current
library
to
your
AMINEM
personal
library
Related commands:
I.
ASP
Opt
Library
Type
Device
Text
USALID09
QSYS
SYS
System Library
QSYS2
SYS
QHLPSYS
SYS
QUSRSYS
SYS
AMINEM
CUR
QGPL
USR
QTEMP
USR
LOAD
USR
F3=Exit
II.
F12=Cancel
F17=Top
F18=Bottom
IROBO1 Press F4
Bottom
*PROD
Database files in production libraries cannot be opened for updating if a user
is in debug mode and he requested that production libraries be protected.
A user can protect all database files in
production libraries from updates by specifying *NO for the Update production
files (UPDPROD) parameter on the Start Debug (STRDBG) command to begin
testing. However, this protection does not prevent the program from deleting
database files or from changing other objects (such as data areas) in the
library.
*TEST
This is a test library. All objects in a test library can be updated during testing,
even if special protection is requested for production libraries.
III.
DSPLIB IROBO1
It gives you the information of all objects that resides in the library with
its
size.
Display Library
Library
. . . . . . :
IROBO1
Number of objects
. :
Type . . . . . . . . :
PROD
Create authority . . :
*EXCLUDE
*SYSBAS
Opt
Object
Type
Attribute
PRINT1PGM
*PGM
RPGLE
ACCOUNT
*FILE
PF
PRINT1
*FILE
QCLSRC
Size
Text
131072
49152
PRTF
4096
*FILE
PF
8192
Sources CL-Programs
QDDSSRC
*FILE
PF
8192
DDS-Sourcen
QRPGLESRC
*FILE
PF
69632
QRPGLESRC2
*FILE
PF
65536
QRPGSRC
*FILE
PF
8192
Bottom
F3=Exit
F12=Cancel
F17=Top
F18=Bottom
IV.
You can add your personal library to any position just update the sequence
no. 0 with the required where you want your library to be and the
corresponding library name.
PUB1
Sequence
Number
Sequence
Library
Number
Sequence
Library
Number
150
300
10
GAMES400
160
310
20
QGPL
170
320
30
QTEMP
180
330
40
190
340
50
200
350
60
210
360
70
220
370
80
230
380
90
240
390
Library
V.
It adds your personal library at the first position in the library list.
VI.
Sourcephysical file
Source physical file is anobject. But the source member is not an object.
When we compile the member, theobject is created for that source.
To see all thesource members of a source physical file, the command used
is WRKMBRPDM.
Work with MembersUsing
PDM
PUB1
File
.. . . . .
QRPGLESR
to
Library . . . .
. . . . .
IROBO1
Position
6=Print
3=Copy 4=Delete
7=Rename
8=Display description
14=Compile
15=Create
module...
Opt Member
Type
Text
ACCOUNT
PF
ACCOUNT RELATED
PRINT1
PRTF
PRINT1PGM
RPGLE
INFORMATION
GENERATED
print1
Bot
tom
Parameters or
command
===>
_________________________________________________________________________
___________________________________________________________________________
____
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve
F10=Command entry
F23=More options
F24=More
keys
To add source ofany type of object in a source physical file we use the
command WRKMBRPDMand then F6.
80
12
Serial no./Date
Comment
Display
Report
Position to
line
. . . . .
Line
Shift to column
....
+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...1
SRCSEQ
SRCDAT
SRCDTA
000001
1.00
121,019
FPRINT1
PRINTEROFLIND(*IN90)
000002
2.00
121,019
FACCOUNT
IF
000003
3.00
121,019
000004
4.00
121,019
000005
5.00
121,019
WRITE
HEADER2
000006
6.00
121,019
READ
REC1
000007
7.00
121,019
DOW
*IN80=*OFF
000008
8.00
121,019
WRITE
DETAIL
000009
9.00
121,019
000010
10.00
121,019
EVAL
000011
11.00
121,019
READ
000012
12.00
121,019
ENDDO
000013
13.00
121,019
EVAL
TOTAL=COUNT
000014
14.00
121,019
WRITE
FOOTER
000015
15.00
121,019
DISK
Z-ADD
*ZEROS
2 0
WRITE
HEADER1
80
90
90
WRITE
HEADER2
COUNT=COUNT+1
REC1
80
LR
****** ********
report ********
End of
SETON
COUNT
Other than WRKMBRPDM, we can get the detail of Source physical fileby
command DSPFD.
Related commands
I.
DSPFD
IROBO1/QRPGLESRC
Member Level Identifier: It is actually the timestamp that relate to creation date/time
ofMembers.
File/Member Level Identifiers are used by operations
such as RSTOBJ tohelp avoid restoring files that are the wrong versions.
Record FormatLevel Identifiers: are hashes ofattributes of all of the fields in the
format. Attributes such as lengths andbuffer positions are hashed in order to generate
a nearly unique value.
A difference betweenFormat Level Identifiers in a
program and in a file will result in a "levelcheck" exception when the program
attempts to open the file.
Initial no. of records: Initially what is the no. of records(Here it is 10000)
Increment no. of record: Indicates, what should be the number of times the
increment willhappen.(Here it is 1000)
Maximum no. of increment: Indicates, what should be the increment factor by which
the record will increase.(Here it is 499)
Record capacity: Hence, on the basis of above three, themaximum no. of record
could be 10000+499*1000=509000 i.e. given as recordcapacity below.
Current number of records: Current no.of record for each member.
No. of format=01
Total record length : 112
In the bottom summary of all members.
.. . . . :
QPDSPFD
Control . . . . .
Find
.. . . . .
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.
12/31/12
QRPGLESRC
*LIBL
QRPGLESRC
Library . . . . . . . . . . . . . . . . . .:
IROBO1
Type of file
. . . . . . . . . . . . . . . :
Physical
*SRC
00001
Yes
1121019191538
Creation date . . . . . . . . . . . . . . .:
10/19/12
*NOMAX
Number of constraints . . . . . . . . . . .:
Number of triggers
. . . . . . . . . . . . :
Number of members . . . . . . . . . . . . .:
0
3
Member size
SIZE
. . . . . . :
Record capacity . . . . . . . . . . . . . .:
Coded character set identifier
. . . . . . : CCSID
. . . . . :
10000
1000
499
509000
273
10000
1000
499
. . . . . . :
Record capacity . . . . . . . . . . . . .:
509000
Member . . . . . . . . . . . . . . . . . . :
MBR
PRINT1
Member level
identifier . . . . . . . . .:
1121019191550
Member creation
date
. . . . . . . . . . :
Text 'description'
10/19/12
. . . . . . . . . . . : TEXT
GENERATED
Expiration date for member
EXPDATE
. . . . . . . :
*NONE
Member
size
SIZE
Initial number of
records . . . . . . .:
10000
Increment number of
records . . . . . .:
1000
Maximum number of
increments
. . . . . :
499
. . . . . . :
Record capacity . . . . . . . . . . . . .:
509000
66
Record Format
List
Record
Format
Level
Format
Fields
QRPGLESRC
Length
112
Identifier
2A4BA13FFF687
Text . . . . . . . . . . . . . . . . . . .
:
Total number of
formats
. . . . . . . . . . :
Total number of
fields . . . . . . . . . . .:
Total record
length
. . . . . . . . . . . . :
112
Member
List
SourceCreation
Change
Deleted
Last
Member
Size
Type Date
Date
Time
ds
ACCOUNT
8192 PF
19:15:50
10/19/12 10/19/12
16384 PRTF
66
10/19/12 10/19/12
8192 RPGLE
15
10/19/12 10/19/12
. . . . . . . . . :
. . :
Total
records
. . . . . . . . . . . . . . :
89
Total deleted
records
. . . . . . . . . . :
Total of member
sizes
. . . . . . . . . . :
32768
*MBR,*ACCPTH,*MBRLIST,*RCDFMT,*MBR.
Records
Recor
Display Spooled
File
File
. . . . . :
QPDSPF
D
Control . .. .
.
Find
. . . . .
.
*...
+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+.
12/31/12
DisplayFile
Description
DSPFDCommand
Input
File
FILE
. . . . . . . . . . . . . .. . . . . :
QRPGLESRC
Library . . . . . . . . . . . . . . . . . :
1
Type ofinformation . . . . . . . . . . . . :
TYPE
*MBRLIST
Fileattributes . . . . . . . . . . . . . . :
FILEATR
*ALL
System
SYSTEM
. . . . . . . . . . . . .. . . . . :
*LCL
FileDescription
Header
File
FILE
. . . . . . . . . . . . . .. . . . . :
QRPGLESRC
IROBO
Library. . . . . . . . . . . . . . . . . . :
IROBO
1
Type
offile
. . . . . . . . . . . . . . .:
Physical
Filetype . . . . . . . . . . . . . . . . . :
FILETYPE
*SRC
Auxiliary storage pool
ID . . . . . . . . . :
00001
MemberList
SourceCreation
Change
Last
Deleted
Member
Size
Type Date
Date
Time
Records
cords
ACCOUNT
19:15:50
8
Text:
8192PF
10/19/12 10/19/12
16384PRTF
10/19/12 10/19/12
ACCOUNT
RELATEDINFORMATION
PRINT1
19:17:53
66
Text:
PRINTER DDS
RLUGENERATED
PRINT1PGM
19:15:50
8192RPGLE
15
Text:
10/19/12 10/19/12
rpgle program
forprint1
Totalnumber of
members
. . . . . . . . .:
. .:
Totalrecords
0
. . . . . . . . . . . . . .:
9
Totaldeleted
records
. . . . . . . . . .:
Re
Total ofmember
sizes
. . . . . . . . . . :
32768
Physical file
RECORD FORMAT
RECORDS
71
Browse
AMIN
SEU==>
ACCOUNT
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++
++++++++
*************** Beginning of data *****************************
0001.00
LEVEL
0002.00
FORMAT LEVEL
UNIQUE
R ACCOUNT
>>>>> FILE
>>>>> RECORD
0003.00
ACLEVELID
2P 0
0004.00
LEVEL
ACORGCOD
3P 0
0005.00
ACCOUNTNUM
12P 0
0006.00
ACCURRENCY
3A
0007.00
ACNAME
0009.00
K ACLEVELID
0010.00
LEVEL
K ACORGCOD
0011.00
K ACCOUNTNUM
>>>>> FIELD
20A
>>>>> KEYFIELD
0012.00
K ACCURRENCY
I.
File level entries (optional): File level entries give the system
information of the entire file. UNIQUE, LIFO, FIFO, FCFO, REF are the keywords
used at file level.
UNIQUE: A record cannot be entered or copied into a file if its key value is
same as the key value of a record already existing in the file.
FIFO: The duplicate key records will retrieved in first in first out order.
LIFO: The duplicate key records will retrieved in last in first out order.
FCFO: The duplicate key records will retrieved in first changed first out
order.
REF: This keyword is used to specify the name of the file from which
the fields are taking definition.
II.
TEXT:
This record level keyword is used to supply a text description of the record
format and it is used for
TEXT (description)
III.
Field level entries: The field names and field lengths are specified along
with and optional text description for each field. (ALIAS, ALWNULL, CCSID, CHECK,
CHKMSGID, CMP, COLHDG, COMP, DATFMT, DATSEP, DFT, EDTCDE, EDTWRD,
REFFLD, REFSHIFT, TEXT, TIMEFMT, TIMESEP, VALUES, VARLEN)
IV.
Key field level entries: The field names used as key fields are
specified. (DESCEND, SIGNED, ABSVAL, UNSIGNED, ZONE, NOALTSEQ, DIGIT)
FIFO: The duplicate key records will retrieved in first in first out order.
LIFO: The duplicate key records will retrieved in last in first out order.
FCFO: The duplicate key records will retrieved in first changed first out order.
When the FIFO, FCFO, or LIFO keyword is not specified, no guaranteed
order is specified for retrieving records with duplicate keys.
No specific order for duplicate key fields allows more access path sharing,
which can improve performance.
LIFO
R REC2
K EMPNO
Assume that a physical file has the FIFO keyword specified (records with duplicate keys are
in FIFO order), and that the following table shows the order in which records were added to
the file.
Order in which records
were added to file
Key value
The sequence of the access path is FIFO, with ascending key values.
Records 3 and 4, which have duplicate key values, are in FIFO order. That is, because record
3 was added to the file before record 4, it is read before record 4.
Key value
access order
If the key value of physical record 1 is changed to C, the sequence of the access path for the
physical file is FIFO, with ascending key values.
Record number
Key value
access order
Finally, changing to descending order, the new sequence of the access path for the logical file
is FIFO, with descending key values.
Record number
Key value
access order
After the change, record 1 does not appear after record 4, even though the contents of the key
field were updated after record 4 was added.
The FCFO order of records with duplicate key values is determined by the sequence of
updates made to the contents of the key fields. In the preceding example, after record 1 is
changed such that the key value is C, the sequence of the access path is FCFO, with
ascending key values only.
Record number
Key value
access order
Columns . . . :
71
Browse
AMINE
M/DDSSRC
SEU==>
REFER
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++
++++++++
*************** Beginning of data
*************************************
0002.00
0003.00
RAC1
2P 0
COLHDG('LEVEL ID')
0004.00
RAC2
3P 0
COLHDG('ORG CODE')
0005.00
RAC3
12P 0
NUM')
R REF
COLHDG('ACCOUNT
0006.00
RAC4
3A
COLHDG('ACCOUNT
RPOSTCODE
2P 0
COLHDG('POST
RCOUNTRY
3P 0
COLHDG('COUNTRY
0009.00
RNAME
0010.00
RDATE
CURRENCY')
0007.00
CODE')
0008.00
CODE')
20A
COLHDG('NAME')
3P 0
COLHDG('DATE')
Now we can refer the file REFER to take the field definition in the new
file.
Columns . . . :
71
Browse
AMINEM/DDSSRC
SEU==>
USEREF
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++++++
+
*************** Beginning of data *************************************
0002.00
0003.00
R USEREF
0004.00
ACCLVL
REFER) >>>>>>
REF(REFER)
REFFLD(RAC1
0005.00
ALIAS(ACC_LVL_ID)
d file name
0007.00
ACCORG
REFFLD(RAC2
REFER)
0008.00
0009.00
0010.00
ALIAS(ACC_ORG_CODE)
A
ACCNUM
REFFLD(RAC3 REFER)
ALIAS(ACC_NUM)
referre
0011.00
ACCCUR
0012.00
0013.00
REFFLD(RAC4 REFER)
ALIAS(ACC_CUR)
ACCNAME
0014.00
REFFLD(RNAME REFER)
ALIAS(ACC_NAME)
Both(COLHDG & ALIAS) are used to identify fields. COLHDG & ALIAS is the
Description of fields. The difference is that in ALIAS we can access data based on
that ALIAS name, while COLHDG is not allowed. Suppose in PF field name as
DES78, give ALIAS as Description78, then user can access data from using
Description78.
Related Command
Create Physical File (CRTPF)
CRTPF FILE(AMITNEM/OBJ) SRCFILE(AMINEM/QDDSSRC) SRCMBR(OBJ_SRC)
The above command is similar to taking option-14 against the source member in member
PDM(WRKMBRPDM).
If there is any data in the physical file and you are using CRTPF/option-14, then all the
data in the physical file will be lost.
If you dont want to lose the data, but you want to compile the source member, then you
can achieve this by CHGPF command.
We generally use CHGPF to change the attribute which are highlighted below.
Physical
file
. . . . . . . . .
Library
Name
. . . . . . . . . . .
*LIBL
Name, *LIBL,
*CURLIB
System . . . . . . . . . . . . .
*LCL
*LCL, *RMT,
*NONE
Name,
*FILETYPE
Source file
. . . . . . . . . .
*NONE
Library
. . . . . . . . . . .
Name, *LIBL,
*CURLIB
Expiration date for member . . .
*SAME
Date, *SAME,
Maximum members
. . . . . . . .
*SAME
Number, *SAME,
*SAME
*SAME, *MAX4GB,
*SAME
*SAME, *IMMED,
*NONE
*NOMAX
*MAX1TB
Access path maintenance
*REBLD, *DLY
. . . .
*SAME
*SAME
*SAME, *NO,
*SAME
1-2147483646,
*SAME
0-32767,
Maximum increments . . . . . .
*SAME
0-32767,
30
Number, *SAME,
60
Number, *SAME,
*SAME
*SAME, *NO,
*NONE
1-100, *NONE,
. . . . .
*YES
*SAME, *YES,
. . . . . . . . .
*HEX
*IPL
. . . .
*YES
Member
size:
Initial number of records
. .
*NOMAX, *SAME
Increment number of records
*SAME
*SAME
*YES
.
*SAME
Reuse deleted records
*NO
Sort sequence
*JOB...
Bottom
F3=Exit
display
F24=More
keys
F4=Prompt
F5=Refresh
F12=Cancel
It depends on the value that we have set for LVLCHK (Record format level check)
attribute.
If its value is *YES then the record format level identifier is checked when the file
is opened and if it doesnt match it throws the error.
If its value is *NO, then the record format level identifier is not checked, hence no
error.
CHGPFM
Physical file
MASTER
. . . . . . . . . >
Name
Library
. . . . . . . . . . . >
AMINEM
Name, *LIBL,
*CURLIB
Member . . . . . . . . . . . . . > *FIRST
Name,
*FIRST
Source type
*NONE
. . . . . . . . . .
*NONE
Name, *SAME,
*NONE
Date, *SAME,
*NO
*SAME, *YES,
Text 'description' . . . . . . .
'ACCOUNT RELATED
*NONE
*NO
INFORMATION
'
Bottom
F3=Exit
F4=Prompt
F5=Refresh
F12=Cancel
display
F24=More
keys
Once we delete the records the relative record number of the records gets changed due
to reorganization of file.
Suppose a file is used in most of the programs based on its key value. If we want to
change the access path of this file from sequential to keyed or from one key value to
another key value, then we can go for RGZPFM.
Example:
Below records are according to arrival sequence.
ACCOUNT
000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013
000014
000015
000016
000017
000018
000019
ORG
190
191
192
192
190
190
192
191
191
195
193
192
190
191
192
192
192
191
190
ACC
A00000000001
A00000000002
A00000000003
A00000000004
A00000000005
A00000000006
A00000000007
A00000000008
A00000000009
A00000000010
A00000000011
A00000000012
A00000000013
P00000000014
A00000000015
A00000000016
A00000000017
A00000000018
P00000000019
CCY
CCY
EUR
USD
TRY
INR
TRY
INR
GBP
USD
EUR
TRY
EUR
EUR
USD
INR
GBP
AZK
EUR
EUR
PARTY
P00000000001
P00000000002
P00000000003
P00000000004
P00000000005
P00000000006
P00000000007
P00000000002
P00000000001
P00000000003
P00000000005
P00000000002
P00000000009
P00000000004
P00000000010
P00000000011
P00000000017
P00000000014
P00000000015
Now we want to arrange the records according to the key value(ORG/ACC/CCY) of file
ACCOUNT. For this we set the KEYFILE = *FILE.
If we want to arrange the records based on some other key value then we can give the logical
file name containing that key value.
Reorganize Physical File Mbr (RGZPFM)
Type choices, press Enter.
Data base file . . . .
Library . . . . . .
Member . . . . . . . .
Key file:
Logical
file
.
*FILE >>>>>>>>>>>
Library . . . . .
Member . . . . . . .
Rebuild access paths .
Allow cancel . . . . .
. . . . . FILE
. . . . .
. . . . . MBR
KEYFILE
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. RBDACCPTH
. ALWCANCEL
> ACCOUNT
>
QGPL
> ACCOUNT
.
*YES
> *NO
Additional Parameters
Source update options
. . . . . SRCOPT
*SAME
>
After reorganizing, the records in ACCOUNT get arranged as per the key value of
ACCOUNT.
000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011
000012
000013
000014
000015
000016
000017
000018
000019
ORG
190
190
190
190
190
191
191
191
191
191
192
192
192
192
192
192
192
193
195
ACC
A00000000001
A00000000005
A00000000006
A00000000013
P00000000019
A00000000002
A00000000008
A00000000009
A00000000018
P00000000014
A00000000003
A00000000004
A00000000007
A00000000012
A00000000015
A00000000016
A00000000017
A00000000011
A00000000010
CCY
CCY
INR
TRY
EUR
EUR
EUR
GBP
USD
EUR
USD
USD
TRY
INR
EUR
INR
GBP
AZK
TRY
EUR
PARTY
P00000000001
P00000000005
P00000000006
P00000000009
P00000000015
P00000000002
P00000000002
P00000000001
P00000000014
P00000000004
P00000000003
P00000000004
P00000000007
P00000000002
P00000000010
P00000000011
P00000000017
P00000000005
P00000000003
We give the source physical file name as the physical file for which we want to see the
member.
Work with Members Using
PDM
SYSTEM09
File
T
to
. . . . . .
ACCOUN
Library . . . .
. . . . .
AMINEM
Member
ACCOUNT
physical file
Bottom
Date
05/21/12
Position
5=Display
7=Rename
8=Display
25=Find
Text
>>>> ACCOUNT member inside ACCOUNT
Parameters or
command
===>
_________________________________________________________________________
_______________________________________________________________________
________
keys
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve
F10=Command entry
F23=More options
F24=More
ACORGCOD
ACCOUNTNUM
ACCURRENCY
ACNAME
000001
190
100,000,000,001
EUR
SURESH
000002
190
100,000,000,002
EUR
SHRI
000003
190
100,000,000,003
EUR
UPI
000004
190
100,000,000,004
EUR
ABHI
000005
190
100,000,000,005
EUR
AMI
000006
190
200,000,000,002
EUR
JAPY
000007
190
200,000,000,003
USD
KAPIL
000008
190
200,000,000,004
USD
TQNGO
PRESS F6
Add Physical File Member
(ADDPFM)
Type choices, press
Enter.
Physical file . . . . . . . . . >
ACCOUNT
Name
Library . . . . . . . . . . . >
*CURLIB
AMINEM
Name, *LIBL,
Member . . . . . . . . . . . . .
Text
'description' . . . . . . .
________
Nam
*BLANK
Bottom
F3=Exit
F4=Prompt
F5=Refresh
parameters
F12=Cancel
F13=How to use this display
keys
F10=Additional
F24=More
SYSTEM09
File
T
to
. . . . . .
ACCOUN
Library . . . .
. . . . .
AMINEM
Member
ACCOUNT
MBR2
file ACCOUNT
Date
Position
5=Display
7=Rename
8=Display
25=Find
Text
05/21/12
07/23/12
Bottom
Parameters or
command
===>
___________________________________________________________________________
_
_______________________________________________________________________
___________
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve
F10=Command entry
F23=More options
F24=More
keys
ACCOUNT/MBR2
000001
000002
000003
000004
ACLEVELID
7
7
7
7
ACORGCOD
190
190
190
190
ACCOUNTNUM
200,000,000,001
200,000,000,002
200,000,000,004
200,000,000,005
ACCURRENCY
EUR
USD
USD
CHF
ACNAME
HIMESH
SUKIN
SANKY
PAINK
SYSTEM09
File
T
to
. . . . . .
Library . . . .
. . . . .
ACCOUN
AMINEM
Position
5=Display
7=Rename
8=Display
25=Find
Opt
Member
Date
Text
ACCOUNT
05/21/12
MBR2
MBR3
07/23/12
07/23/12
ACCOUNT
Bottom
Parameters or
command
===>
F3=Exit
F4=Prompt
F5=Refresh
F6=Create
F9=Retrieve
F10=Command entry
F23=More options
F24=More
keys
Copy member
PDM
1
to
NLAAB441
File
Library
. . . . .
.
.
Work
with
.
.
.
.
.
AMINEM
Type
options,
Enter.
2=Edit
3=Copy 4=Delete
5=Display
6=Print
7=Rename
8=Display description 9=Save 13=Change
module...
Opt
Member
_3_ MASTER
INFORMATION
MENUC
MENU
Members
Type
Text
PF
ACCOUNT
CLP
TO
Using
PRJ
Position
press
text
14=Compile
15=Create
RELATED
CALL
1
2
3
4
MNU0
MNUDDS
MNU0QQ
MNUCMD
OPT1_PGM
RPG
entry
pgm
to
be
called
for
option-
OPT2_PGM
RPG
entry
pgm
to
be
called
for
option-
OPT3_PGM
RPGLE
entry
pgm
to
be
called
for
option-
OPT4_PGM
SQLRPGLE
entry
pgm
to
be
called
for
option-
More...
Parameters
command
===>
keys
or
F3=Exit
F4=Prompt
F5=Refresh
F9=Retrieve
F10=Command
entry
F23=More
F6=Create
options
F24=More
Copy
Members
From
file . . . . . . . :
From
library . . . . :
Type
members.
the
To
list
library
AMINEM
file
file
name
To
. . . . .
To
Enter.
Name
PRJ1
rename
and
library
name
to
receive
PRJ1
the
Name,
copied
F4
for
AMINEM
copied
Member
New
MASTER
MASTER
member,
type
New
Name,
press
Bottom
F3=Exit
F4=Prompt
F5=Refresh
F12=Cancel
F19=Submit
batch
to
Logical file
One or more logical file can be derived from a single physical file.
We can filter the data with criteria by using select and omit command.
A logical file does not contain any data but provides the VIEWS of the
data to satisfy end-users needs.
1)
Columns . . . :
71
Browse
AMINEM/DDSS
RC
SEU==>
MULTIFR
MT
FMT LF .....A..........T.Name++++++.Len++TDpB......Functions++++++++++++++++
++
*************** Beginning of data
*************************************
0002.00
ACCOUNT
0003.00
R
PFILE(AMINEM/ACCOUNT)
K ACCURRENCY
ACCOUNTNUM
0005.00
Multiple record non-join logical files will select records from 2 or more physical files
by referring to only one logical file.
Each record format is always associated with one or more physical file.
Columns . . . :
INEM/DDSSRC
71
Browse
AM
SEU==>
MULTIFRMT
FMT LF .....A..........T.Name++++++.Len++TDpB......Functions++++++++
++++++++++
*************** Beginning of data
*************************************
0002.00
ACCOUNT
R
PFILE(AMINEM/ACCOUNT)
0003.00
K ACCOUNTNUM
0005.00
K ACCURRENCY
0006.00
TRANS
0007.00
K TACCOUNT
0008.00
K TCURRENCY
R
PFILE(AMINEM/TRANS)
71
Browse
AMINEM
SEU==>
FILTER
FMT LF .....A..........T.Name++++++.Len++TDpB....Functions+++++++++++
+++++++
*************** Beginning of data
*************************************
0001.0
DYNSLT
>>>>>>>>>>>>
0002.00
Record Level
R LOG1
FILE(AMINEM/ACCOUNT)>>>
0005.00
ACCOUNTNUM
0006.00
ACCURRENCY
0009.00
K ACCOUNTNUM
0010.00
K ACCURRENCY
S ACCOUNTNUM
CMP(GT
O ACCOUNTNUM
CMP(GT
>>>>>>>>>>>>>>>>>>>
Field Level
0011.00
100000000001)
0017.00
100000000003)
>> Selection/
A
Omission Level
DYNSLT: Use this file-level keyword to indicate that the selection and omission tests
specified in the file (using select/omit specifications) are done at processing time. This
keyword specifies dynamic select/omit rather than access path select/omit.
Only a Physical file contains data. Logical files just contain pointers for
processing the data in a specific sequence and/or subset of data.
When a record is added/changed/deleted in a physical file, the system has
to put a lock on it and then go out to check and update any logical files
before it can release the lock. While the amount of time to do this is hardly
measurable, it can be significant if massive batch updates are done to a
file.
If you are using the Select/Omit option in your DDS and using DYNSLT, the
above process does not need to be done at record update time.
Where this is beneficial is when your selection process includes almost all
the records in the file. Now when you process using DYNSLT, it will read all
the records in the file, but do the selection of which records to process at
that time rather than having done all the maintenance ahead of time.
Columns
71
.
AMINEM/EXAMPLE
Edit
SEU==> SELOMIT
FMT PF.
*************** Beginning of data *******************
0001.00
R RECSEL
0002.00
EMPNO
0003.00
EMPNAME
0004.00
5P 0
20A
K EMPNO
****************** End of data ************************
EMPNO
EMPNAME
000001 1001
SHRI
000002 1002
ABHI
000003 1003
SHRI
000004 1004
UPI
000005 1005
ABHI
000006 1006
SHRI
000007 1007
ABHI
000008 1008
UPI
000009 1009
SHRI
000010 1010
UPI
Columns
********
71
.
AMINEM/EXAMPLE
Edit
SEU==> SELOMILF
FMT LF...
*************** Beginning of data *********************
0001.00
R RECSEL
PFILE (SELOMIT)
0002.00
K EMPNO
0003.00
S EMPNO
0004.00
O EMPNAME
EMPNO
000001 1002
EMPNAME
ABHI
000002 1004
UPI
000003 1005
ABHI
000004 1006
SHRI
000005 1007
ABHI
000006 1008
UPI
000007 1009
SHRI
000008 1010
UPI
Columns
********
71
.
AMINEM/EXAMPLE
Edit
SEU==> SELOMIT
FMT PF.
*************** Beginning of data *******************
0001.00
R RECSEL
0002.00
EMPNO
0003.00
EMPNAME
0004.00
5P 0
20A
K EMPNO
****************** End of data ************************
EMPNO
EMPNAME
000001
20
SHRI
000002
30
RAM
000003
40
JYOTI
000004
50
AMI
000005
60
SHRI
000006
70
SHRI
000007
80
JYOTI
000008
90
JYOTI
000009
100
SHAMNT
Columns
71
.
Edit
SEU==> SELOMILF1
FMT LF
********
.
AMINEM/EXAMPLE
R RECSEL
PFILE (SELOMIT1)
0002.00
K EMPNO
0003.00
S EMPNO
0004.00
S EMPNAME
VALUES ('SHRI')
EMPNO
EMPNAME
000001
20
SHRI
000002
60
SHRI
000003
70
SHRI
000004
80
JYOTI
000005
90
JYOTI
000006
100
SHAMNT
2)
********
A join-logical file is a logical file that combines two or more PF. i.e. master +
transactional record.
Key fields must be fields defined in the join record format and must be
fields from the PRIMARY FILE.
JFILE: It is similar to indicate that this is a join logical field and it must have more than 2
physical files.
JOIN: It is similar that this file level entries to be represent the position of the files .There
must one primary file and can have more than I secondary files.
JDUPSEQ: This joinlevel keyword is used to specify the order in which records with
duplicate join fields are presented when the JLF is read.
The format for this keyword is:
JDUPSEQ (Sequencing field-name [*DESCEND])
This keyword has no effect on the ordering of records with unique keys.
If *DESCEND is not specified then the default is sequencing in ascending
order.
71
.
AMINEM/EXAMPLE
Edit
SEU==>
1
SEQ
1
FMT PF.
*************** Beginning of data ***********************
0001.00
R SEQREC1
0002.00
EMPNO
0003.00
EMPNAME1
20A
0004.00
ADDRESS
20A
0005.00
5P 0
K EMPNO
****************** End of data **************************
EMPNO
EMPNAME1
ADDRESS
000001 10,001
BOB
23,OLD MADIWALA
000002 10,002
DANNY
50,LONG ISLAND
000003 10,003
PRINC
90,ATTUR
Columns
71
.
Edit
SEU==>
2
FMT PF
********
.
AMINEM/EXAMPLE
1
SEQ
R SEQREC2
0002.00
EMPNO
0003.00
EMPNAME
20A
0004.00
TEL
10P 0
5P 0
EMPNO
EMPNAME
TEL
000001 10,001
BOB
825,777
000002 10,001
BOB
825,999
000003 10,001
BOB
825,888
000004 10,002
DANNY
4,222,600
Columns
71
********
.
AMINEM/EXAMPLE
Edit
SEU==>
JDFTSEQ
FMT LF
*************** Beginning of data ******************
0001.00
SEQ2)
0002.00
RECSEQ
JFILE
(SEQ1
JOIN (1 2)
0003.00
EMPNAME)
JFLD
0004.00
(EMPNAME1
JDUPSEQ (TEL)
0005.00
EMPNO
0006.00
EMPNAME1
0007.00
ADDRESS
0008.00
TEL
JREF (2)
EMPNO
EMPNAME1
ADDRESS
TE
L
000001
MADIWALA
10,001
BOB
23,OLD
10,001
BOB
23,OLD
10,001
BOB
23,OLD
825,777
000002
MADIWALA
825,888
000003
MADIWALA
825,999
000004
10,002
DANNY
50,LONG ISLAND
4,222,600
********
Join DESCEND
Columns
71
.
AMINEM/EXAMPLE
Edit
SEU==>
JDFTSE
Q
FMT LF
*************** Beginning of data ***********************
0001.00
SEQ2)
0002.00
RECSEQ
JFILE
(SEQ1
JOIN (1 2)
0003.00
EMPNAME)
JFLD
0004.00
*DESCEND)
JDUPSEQ
0005.00
EMPNO
0006.00
EMPNAME1
0007.00
ADDRESS
0008.00
TEL
(EMPNAME1
JREF (2)
(TEL
EMPNO
EMPNAME1
ADDRESS
000001
MADIWALA
TEL
10,001
BOB
23,OLD
10,001
BOB
23,OLD
10,001
BOB
23,OLD
825,999
000002
MADIWALA
825,888
000003
MADIWALA
825,777
000004
10,002
DANNY
50,LONG ISLAND
4,222,600
********
JDFTVAL
When this file-level keyword is used the system provides default values
for all for fields when a join to a secondary file does not produce any
records.
If this keyword is not specified a record in the primary file for which there
is no corresponding record in the secondary file is skipped.
Columns . . . :
M/QDDSSRC
SEU==>
LOGICAL
FMT
71
Browse
AMINE
A*
0004.00
DYNSLT
0005.00
JDFTVAL
0006.00
0007.00
FILE2)
R LOG1
JFILE(FILE1
0008.00
FILE2)
JOIN(FILE1
0009.00
LVLIDN2)
JFLD(LVLIDN1
0010.00
ORGCOD2)
JFLD(ORGCOD1
0011.00
ACNTNO2)
JFLD(ACNTNO1
0012.00
RECSTS2)
JFLD(RECSTS1
0013.00
LVLIDN
JREF(1)
0014.00
ORGCOD
JREF(1)
0015.00
ACNTNO
JREF(1)
0016.00
SUBCOD
JREF(1)
0017.00
MKTCOD
JREF(1)
0018.00
RECSTS
JREF(1)
0019.00
ORGCODP
0020.00
PRTYNO
0021.00
LVLIDN1
0022.00
ORGCOD1
0023.00
ACNTNO1
0024.00
K SUBCOD1
Columns . . . :
MINEM/PRJ1
71
Edit
SEU==>
LOGIC1
FMT LF .....A..........T.Name++++++.Len++TDpB......Functions+++++++
+++++++++++
***************
Beginning
*************************************
of
data
0001.00
0002.00
PARTYD TRANSA
LOG1
0003.00
PARTYD)
0004.00
0005.00
TRANSACT)
0006.00
ACCOUNT_NO)
0007.00
ORG
0008.00
ACC
0009.00
CCY
0010.00
PNUM
0011.00
PNAME
JFILE(
JOIN(
MASTER
MASTER
JFLD( PARTY
PNU
M)
J
JOIN(
MASTER
JFLD(
ACC
0012.00
PADDR
0013.00
TRAN_NO
0014.00
TRAN_TYPE
0015.00
TRAN_AMT
0016.00
TRAN_YEAR
0017.00
TRAN_MONTH
0018.00
TRAN_DAY
0019.00
0020.00
0021.00
ORG
ACC
CCY
******************
****************************************
End
of
data
.
.
AMINEM/EXAMPLE
Edit
SEU==>
1
JPF
01
FMT PF
***************
****************************
Beginning
0001.00
R JP1REC
0002.00
EMPNO
0003.00
EMPNAME
0004.00
K EMPNO
5S 0
20A
of
data
EMPNO
EMPNAME
000001 1001
SHRI
000002 1002
UPI
000003 1003
AMI
Columns
71
********
.
.
AMINEM/EXAMPLE
Edit
SEU==>
1
JPF
02
FMT PF.
***************
***************************
Beginning
0001.00
R JP2REC
0002.00
EMPNO
5S 0
0003.00
EMPSAL
10P 2
0004.00
of
data
K EMPNO
******************
********************************
End
of
data
Display Report
EMPNO
EMPSAL
000001 1001
100.00
000002 1002
20.00
000003 1004
300.00
Columns
71
.
Edit
********
.
AMINEM/EXAMPLE
SEU==>
JOF
ILE
FMT LF.
*************** Beginning of data ************************
0001.00
JPF02)
0002.00
JREC1
JFILE
JOIN (1 2)
0003.00
EMPNO)
JFLD
0004.00
EMPNO
0005.00
EMPNAME
0006.00
EMPSAL
0007.00
(JPF01
(EMPNO
JREF (JPF01)
K EMPNO
****************** End of data*********************
EMPNO
EMPNAME
EMPSAL
000001 1001
SHRI
100.00
000002 1002
UPI
20.00
********
.
Edit
.
.
AMINEM/EXAMPLE
SEU==>
UT
FMT LF.
*************** Beginning of data*********************
1
JOO
0001.00
JDFTVAL
0002.00
JPF02)
0003.00
JREC1
JFILE
JOIN (1 2)
0004.00
EMPNO)
JFLD
0005.00
EMPNO
0006.00
EMPNAME
0007.00
EMPSAL
0008.00
(JPF01
(EMPNO
JREF (JPF01)
K EMPNO
****************** End of data********************
EMPNO
EMPNAME
EMPSAL
000001 1001
SHRI
100.00
000002 1002
UPI
20.00
000003 1003
AMI
.00
*******************
Self-join
A physical file can be joined to itself to read records that are formed by
combining two or more records from the PF itself.
Columns
71
.
AMINEM/EXAMPLE
Edit
SEU==>
1
SEJOIN
FMT PF
*************** Beginning of data ********************
0001.00
R EMP
0002.00
EMPID
0003.00
EMPNAME
5P 0
20A
0004.00
MGRID
0005.00
K EMPID
5P 0
EMPID
EMPNAME
MGRID
000001 10,001
SEBI JOSEPH C.
000002 10,002
PURUSHOTTAM
000003 10,003
SAMEER DIGHE
50,003
000004 10,004
SHARATA
50,004
000005 10,005
PAUL
000006 50,001
SHIVARAM
000007 50,002
GAURAV
000008 50,003
KING
90,003
000009 50,004
SAM
90,004
000010 50,005
ANIL
90,005
50,002
50,005
90,001
90,002
Columns
71
50,001
********
.
AMINEM/EXAMPLE
Edit
SEU==> SELJOIN
FMT LF
*************** Beginning of data **************************
0001.00
SEJOIN)
0002.00
EMP
JFILE
(SEJOIN
JOIN (1 2)
0003.00
EMPID)
JFLD
(MGRID
0004.00
EMPID
JREF (1)
0005.00
EMPNAME
JREF (1)
0006.00
MANAGER
(2)
0007.00
COLHDG ('MANAGER')
EMPID
EMPNAME
MANAGER
000001 10,001
SEBI JOSEPH C.
SHIVARAM
000002 10,002
PURUSHOTTAM
GAURAV
000003 10,003
SAMEER DIGHE
KING
000004 10,004
SHARATA
SAM
000005 10,005
PAUL
ANIL
********
file.
logical files.
Commitment
used.
Related Command
control
cannot
be
I.
II.
III.
IV.
Physical file
Logical file
containing data.
format
formats.
deleted
deleted
such object
type object