Professional Documents
Culture Documents
4. If there is a logical file for a PF, the 4. If there is a logical file for a PF, the LF
PF cant be deleted until and unless we can be deleted without deleting the PF.
delete the LF.
Sourcephysical file
Source physical file is a filewhich contains the sources of different types of objects.
To see all thesource members of a source physical file, the command used is WRKMBRPDM.
Work with MembersUsing PDM PUB1
File .. . . . . QRPGLESRC
Library . . . . IROBO1 Position to . . . . .
Bottom
Parameters or command
===>
_________________________________________________________________________
______________________________________________________________________________
_
To add source ofany type of object in a source physical file we use the command
WRKMBRPDMand then F6.
Other than WRKMBRPDM, we can get the detail of Source physical fileby command DSPFD.
Related commands
DSPFD IROBO1/QRPGLESRC
ofsource file.
Member Level Identifier: It is actually the timestamp that relate to creation date/time
ofMembers.
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.
and in a file will result in a "levelcheck" exception when the program attempts to open
the file.
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 capacity: Hence, on the basis of above three, themaximum no. of record could
No. of format=01
Physical file
RECORD FORMAT
RECORDS
KEYED ACCESS PATH: An area within a physical file obj where key field data is stored
in the order along with their RRN
Columns . . . : 1 71 Browse
AMINEM/DDSSRC
SEU==>
ACCOUNT
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++
+++++
*************** Beginning of data *****************************
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. Record format level entries: For a PF the record format name is
specified along with an optional text description. The record level entries can be FORMAT,
TEXT.
FORMAT:
This record-level keyword specifies that the record format being define is to
share the field specifications of a previously defined record format. The name
of the record format being defined must be the name of the previously
defined record format.
The format of this keyword is:
This record level keyword is used to supply a text description of the record
format and it is used for documentation purposes only.
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.
Arranging duplicate keys:
If you do not specify the Unique (UNIQUE) keyword in data description specifications
(DDS), you can specify how the system stores records with duplicate key values.
You specify that records with duplicate key values are stored in the access path in one of the
following ways:
Last-in-first-out (LIFO): When the LIFO keyword is specified, records with duplicate key
values are retrieved in LIFO order by the physical sequence of the records. Here is an example of
DDS using the LIFO keyword.
A LIFO
A R REC2
A .
A .
A .
A 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.
1 A
2 B
3 C
4 C
5 D
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.
The sequence of the access path is FIFO, with descending key values.
5 D
3 C
4 C
2 B
1 A
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
2 B
1 C
3 C
4 C
5 D
Finally, changing to descending order, the new sequence of the access path for the logical file is
FIFO, with descending key values.
5 D
1 C
3 C
4 C
2 B
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.
2 B
3 C
4 C
1 C
Record number Key value
access order
5 D
USE OF REFERENCE
Columns . . . : 1 71 Browse
AMINEM/DDSSRC
SEU==>
REFER
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++
+++++
0002.00 A R REF
SEU==> USEREF
FMT PF .....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
0002.00 A REF(REFER)
0003.00 A R USEREF
0008.00 ALIAS(ACC_ORG_CODE)
0010.00 ALIAS(ACC_NUM)
0012.00 ALIAS(ACC_CUR)
0014.00 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
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.
Member size:
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this
display
F24=More keys
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
'
Bottom
F24=More keys