DDS Lab Exercises - Creation of Physical File, Field Reference File

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

DDS Lab Exercises – Creation of Physical

File, Field Reference File

1. Create a physical file EMPMST with the following fields and key
field empid.
Exercise instructions
_____1. In this exercise you are going to write a PF EMPMST in your library
that includes all the fields given below.

Field name Length Data type

EMPCDE 5 Zoned

EMPNAM 30 Alphanumeric

EMPDOB L Date

EMPDEP 2 Alphanumeric

EMPSAL 9,0 Packed

EMPAD1 25 Alphanumeric

EMPAD2 25 Alphanumeric

EMPAD3 25 Alphanumeric

EMPHN 14 Zoned

EMTRDT L Date

EMTRTM T Zoned

EMTUSR 10 Alphanumeric

_____2. Add key field empid in EMPMST.

_____3. Create a DDS for the EMPMST with the following record formats
specifications .

© PMS Information Systems 2008 1


_____4. Define employee id as the key field.

_____5. Compile EMPMST. Check for no compilation errors.

© PMS Information Systems 2008 2


2. Create a field reference file FLDREF in your library and include all
the fields which one defined in EMPMST.

Exercise instructions
_____1. In this exercise you are going to write a PF FLDREF in your library that
includes all the fields which one defined in EMPMST.

_____2. Create a DDS for the FLDREF with the following fields.

Field name Length Data type

EMPCDE 5 Zoned

EMPNAM 30 Alphanumeric

EMPDOB L Date

EMPDEP 2 Alphanumeric

EMPSAL 9,0 Packed

EMPAD1 25 Alphanumeric

EMPAD2 25 Alphanumeric

EMPAD3 25 Alphanumeric

EMPHN 14 Zoned

EMTRDT L Date

EMTRTM T Zoned

EMTUSR 10 Alphanumeric

_____3. Compile FLDREF. Check for no compilation errors.

© PMS Information Systems 2008 3


3. Create a PF EMPMST1 by referring all the fields from fields reference
file FLDREF.

Exercise instructions
_____1. In this exercise you are going to write a PF EMPMST1 in your library
by referring all fields from FLDREF.

_____2. Create a DDS for the PF EMPMST1 with the following record format
specification .Refer all fields in the field reference file.

_____3. Define employee id as the key field.

_____4. Compile the PF EMPMST1.Check for no compilation errors.

© PMS Information Systems 2008 4


4. Create a PF EMPMST1.A by referring all the fields from fields
reference file FLDREF.

Exercise instructions
_____1. In this exercise you are going to write a PF EMPMST1.A in your library
by referring all fields from FLDREF.

_____2. Create a DDS for the PF EMPMST1.A with the following record format
specification .Refer all fields in the field reference file.

_____3. Define employee id as the key field.

_____4. Give COLHDG for all fields in EMPMST1.After you had given REFFLD
and referring from file REF(File level keyword)

_____5. Compile the PF EMPMST1.Check for no compilation errors.

© PMS Information Systems 2008 5


5. To create a PF EMPMST2 with the similar format of EMPMST and
define empnam as the key.

Exercise instructions
_____1. In this exercise you are going to write a PF EMPMST2 in your
library that includes all the fields of EMPMST and define empnam as the key.

_____2. Create a DDS for the EMPMST2 with the following record formats
specifications . Define employee name as the key field.

Field name Length Data type

EMPCDE 5 Zoned

EMPNAM 30 Alphanumeric

EMPDOB L Date

EMPDEP 2 Alphanumeric

EMPSAL 9,0 Packed

EMPAD1 25 Alphanumeric

EMPAD2 25 Alphanumeric

EMPAD3 25 Alphanumeric

EMPHN 14 Zoned

EMTRDT L Date

EMTRTM T Zoned

EMTUSR 10 Alphanumeric

_____3. Compile EMPMST2.Check for no compilation errors.

© PMS Information Systems 2008 6


Exercise – File level keywords ,Record
level keywords,Field Level Keywords,Key
field level keywords
1.Create a PF with file level keywords UNIQUE,FIFO,LIFO,FCFO.

Exercise instructions
_____1. In this exercise you are going to include file level keywords UNIQUE,
FIFO,LIFO,FCFO

UNIQUE – Select records of unique key value.

FIFO – See whether records are arranged in first in first out order when duplicate
key values are given.

LIFO – See whether records are arranged in last in first out order when duplicate
key values are given.

FCFO – See whether records are arranged in first changed first out order when
duplicate key values are given.

_____2. Create a DDS for the file EMPMST11,EMPMST11.X,EMPMST11.Y,


EMPMST11.Z with file level keywords UNIQUE FIFO,LIFO,FCFO with
similar format of EMPMST.

_____3. Compile EMPMST11,EMPMST11.X,EMPMST11.Y, EMPMST11.Z .


Check for no compilation errors.

© PMS Information Systems 2008 7


2.Create a PF EMPMST3 include key field keywords ABSVAL, DESCEND,

Exercise instructions
_____1. In this exercise you are going to include key field keywords ABSVAL,
DESCEND.

_____2. Create a DDS for the file EMPMST3 which is based on EMPMST3 with
the following record formats specifications . In EMPMST3, define
employee id as the key field.

_____3. In EMPMST3,give descend for empid key field. When you give
DESCEND keyword check whether employee records are listed in
descending order.

_____4. Give ABSVAL for the empid field in PF. When you give ABSVAL,
check whether absolute value is obtained.Give descend and absval
and see whether records are arranged with absval and descending
order.

_____5. Compile EMPMST3. Check for no compilation errors.

© PMS Information Systems 2008 8


3.Create a PF EMPMST4 with field level keywords
ALIAS, ALWNULL,
CHECK(MF), CHECK(ME),CHECK(AB), COLHDG, TEXT,EDTCDE, EDTWRD,
RANGE,VALUES,DFT,COMP DATFMT , DATSEP, TIMFMT, TIMSEP,
REFFLD,VARLEN .

Exercise instructions
_____1. In this exercise you are going to include field level keywords ALIAS,
ALWNULL, CHECK(AB),CHECK(MF) , CHECK(ME), COLHDG,
EDTCDE, EDTWRD, RANGE, REFFLD ,COMP,VALUES,CHKMSGID,
VARLEN.

_____2. Create a DDS for the file EMPMST4 based on EMPMST4 with the
following record formats specifications . Specify the following
keywords.

_____3. Give ALIAS name ie alternate name to field EMPNAM. Set ALWNULL
for AMOUNT FIELD.Give range of values ( 2000 5000) to EMPSAL
and select EMPSAL for range of values.Give values keyword for
DEPID field as ’IT’,’PR’,’SA’,’TR’.

_____4. When you give ALWNULL,allows null value in the field.

_____5. When you give COLHDG ,specfies column heading for fields.

_____6. Give DFT values for DEPID as ‘IT’ & EMPSAL fields as 1234.

_____7. Give DATFMT as *DMY and DATSEP as ‘/’ and TIMFMT as *HMS and
TIMSEP as ‘:’.

_____8. Check(AB) – Allow blanks.

_____9. Check for salary field for Check ME – Field must be entered
mandatorily ,CHECK MF – Mandatory fill of that value.

_____10. Give EDTCDE for transaction date field (or) DOB field.Give the
EDTCDE keyword ‘ Y’ for date edit for DOB field . Give edit code Z for
suppressing zeros.

_____11. Give EDTWRD for amount field (‘ - - ‘). Give edtwrd for phone
number field (Country_code-Area_code-Phone_number).

_____12. Give CHKMSGID for COMP,VALUES & RANGE keyword and see
whether the error message is coming.

© PMS Information Systems 2008 9


_____13. When you give REFFLD for a particular field ,refers the field from field
reference file and source of the existing file.

_____14. Give VARLEN for empname field.

_____15. Compile EMPMST4 .Check for no compilation errors.

© PMS Information Systems 2008 10

You might also like