DDS Lab Exercises - Creation of Non Join Logical File, Multi Format Logical File
DDS Lab Exercises - Creation of Non Join Logical File, Multi Format Logical File
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF1 in your
library that includes all the fields of EMPMST and define empid
as the key.
_____2. Create a DDS for the EMPLF1 with the following record formats
specifications . Define employee id as the key field.Specify
UNIQUE keyword for getting employee records with unique id .
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF2 in your library that
includes the following fields of EMPMST – empcode, name, DOB,
dept define dept as the key.
_____2. Create a DDS for the EMPLF2 with the following record formats
specifications .
Employee id
Employee name
Employee date of birth
Employee department
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF3 in your
library that has same format of EMPLF2 using FORMAT
keyword - define empcode and name as the key.
_____2. Create a DDS for the EMPLF3 with similar format of EMPLF2.
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF4 in your
library with FORMAT keyword and REFACCPTH keyword.
_____2. Create a DDS for the EMPLF4 with the following record formats
specifications with similar format of EMPLF2 .
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF5 in your library
based on EMPMST & EMPMST1 with all fields in both fields & have
keys is employee code.
_____2. Create a DDS for the EMPLF5 with the following record formats
specifications of EMPMST & EMPMST1 .
Exercise instructions
_____1. In this exercise you are going to write a LF EMPLF6 in your library
based on EMPMST & EMPMST1 with FORMAT keyword.
_____2. Create a DDS for the EMPLF6 with the following record formats
specifications with similar format of EMPLF2.
Exercise instructions
_____1. Create CUSMST file in your library with the following fields.
_____2. In this exercise you are going to write a multi format LF EMPLF7 in
your library based on EMPMST with empcode as key and CUSMST
with customer code as key.
_____3. Create a DDS for the EMPLF7 with the following record formats
specifications .
_____4. Define emp code and customer code as the key field in appropriate
places.
EMPCDE 5 Zoned
EMPNAM 30 Alphanumeric
EMPDOB L Date
EMPDEP 2 Alphanumeric
EMPAD1 25 Alphanumeric
CUSID 5 Zoned
CUSNM 30 Alphanumeric
CUSAD 25 Alphanumeric
CUSPHN 14 Zoned
CUSDOB L Date
CUCSCM 10 Zoned
Exercise instructions
_____1. In this exercise you are going to include file level keywords
UNIQUE,FIFO,LIFO,FCFO
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 EMPLF41 with file level keywords UNIQUE
FIFO,LIFO,FCFO in 4 different logical files same as you code for
physical file EMPMST.
Exercise instructions
_____1. In this exercise you are going to include key field keywords ABSVAL,
DESCEND.
_____2. Create a DDS for the file EMPLF10 which is based on EMPMST3 with
the following record formats specifications . In EMPMST3, define
employee id as the key field.
_____3. In EMPLF10,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 logical file. 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.
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,RANGE, VALUES,
VARLEN,DATFMT,DATSEP,TIMFMT,TIMSEP .
_____2. Create a DDS for the file LF EMPLF11 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’.
_____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 ‘:’.
_____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 .
_____11. Give EDTWRD for amount field (‘ - - ‘). Give edtwrd for phone
number field (Country_code-Area_code-Phone_number).
_____12. Give CHKMSGID for VALUES & RANGE keyword and see whether
the error message is coming.
_____13. When you give REFFLD for a particular field ,refers the field from field
reference file and source of the existing file.
Exercise instructions
_____1. In this exercise you are going to include field level keywords SST,
CONCAT, ENAME in EMPLF12.
_____2. Create a DDS for the file EMPLF12 with the following record formats
specifications . Specify the following keywords.
Exercise instructions
_____1. In this exercise you are going to include select/omit keywords in the
logical file.
_____2. Create a DDS for the file EMPLF13 with the following record formats
specifications . Specify the following keywords.
EMPNAM 30 Alphanumeric
DEPNM 12 Alphanumeric
EMPAD1 25 Alphanumeric
EMPAD2 25 Alphanumeric
EMPAD3 25 Alphanumeric
EMTUSR 10 Alphanumeric
DEPTMST7
Field name Length Data type
DEPNM 12 Alphanumeric
MGRNM 12 Alphanumeric
SALARY
Field name Length Data type
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF14 of
department and employee table.
_____2. Create a DDS for the join logical file with the following record formats
specifications . Include JFILE,JOIN,JFLD,JREF keywords.
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF15 for
inner join of department and employee file. Join field is department id.
_____2. Create a DDS for the join logical file with the following record formats
specifications . Include JFILE,JOIN,JFLD,JREF keywords.
_____3. For inner join, join dept & emp file with depid as key – only rows
which are matched are joined .Use DYNSLT keyword.
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF16 for
left outer join of DEPARTMENT and EMPLOYEE file. Join field is
department id.
_____2. Create a DDS for the join logical file with the following record formats
specifications . Include JDFTVAL keyword.Specify the following
keywords.
_____4. For left outer join of dept & emp table – contains all rows from
department table ie left table .Use JDFTVAL keyword.
_____5. JDFTVAL – Indicates that the system will provide default values
for fields when a join operation to the secondary file produces no
records.
_____6. Include JDFTVAL for natural join – missing secondaries when records
are there in DEPARTMENT file and no corresponding record in
EMPLOYEE file,JDUPSEQ keywords – more than 1 match in
secondary file ie in employee file. Specifies the field use to arrange
duplicate records on a join. Specify the following keywords.
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF17 for
self join. For self join, join field is manager id which is the employee id
in the employee file.
_____2. Create a DDS for the join logical file with the following record formats
specifications .Specify the following keywords.
_____4. For SELF join ,join employee table to employee table with key
manager id and employee id.
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF18 for
joining 3 files – department,employee,salary.
_____2. Create a DDS for the join logical file with the following record formats
specifications .Specify the following keywords.
Exercise instructions
_____1. In this exercise you are going to create join logical file EMPLF19 for
joining 2 files department ,employee with join field not in logical file.
_____2. Create a DDS for the join logical file with the following record formats
specifications .Specify the following keywords.
_____4. For joining 2 files joining field is not there in the logical
file.Specify a ‘N’ in 38th column ie in usage of field is neither
input/output.