Sie sind auf Seite 1von 22

DDS LAB LF EXERCISE

INDEX
Exercise Number 1 2 3 4 Description Create a LF EMPLF1 single PF all fields. Create a LF EMPLF2 single PF selected fields Create a LF EMPLF3 using FORMAT keywords Create a LF EMPLF4 using FORMAT and REFACCPTH keywords Create a LF EMPLF5 using UNION (Vertical Join) Create a LF EMPLF6 using FORMAT, PFILE, REFACCPTH keywords Create a LF INVLF (Multiple Format Logical File) Create a LF EMPLF8 with file level keywords Create a LF EMPLF9 with keyfield level keywords Create a LF EMPLF10 with field level keywords Create a LF EMPLF11 with field level keywords Create a LF EMPLF12 with Select/Omit level keywords Create a JLF STULF
2

Page Number 4 5 6 7

5 6

8 9

7 8 9 10 11 12 13

10 11 12 13 15 16 17

14 15 16 17

Create a JLF STULF1 Inner Join Create a JLF STULF2 Outer Join Create a JLF STULF3 Self Join Create a JLF STULF4 Using N keyword

18 19 20 21

1. Create a LF EMPLF1 based on single PF - EMPMST and having all the fields in EMPMST. Key is Employee is Unique.

_____1. _____2.

Exercise instructions 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. 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. Compile EMPLF1.Check for no compilation errors.

_____3.

2.

Create a LF EMPLF2 based on EMPMST with the selected fields: Employee code, Name, DOB, Dept, Key is Dept.

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. _____3. Create a DDS for the EMPLF2 with the following record formats specifications. Define dept id as the key field. Employee id Employee name Employee date of birth Employee department

_____4.

Compile EMPLF2.Check for no compilation errors.

3. Create a LF EMPLF3 with the similar format of EMPLF2 and key is Empcode and Name.

_____1.

Exercise instructions 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. Create a DDS for the EMPLF3 with similar format of EMPLF2. Define emp code and name as the key field.

_____2. _____3.

_____4.

Compile EMPLF3.Check for no compilation errors.

4. Create a LF EMPLF4 with similar format of EMPLF2 and have the keys are in EMPLF3.

_____1. _____2. _____3.

Exercise instructions In this exercise you are going to write a LF EMPLF4 in your library with FORMAT keyword and REFACCPTH keyword. Create a DDS for the EMPLF4 with the following record formats specifications with similar format of EMPLF2. Define keys that are in EMPLF3.

_____4.

Compile EMPLF4.Check for no compilation errors.

5.

Create a LF EMPLF5 based on EMPMST and EMPMST1 with all the fields in both fields, key is Employee code.

Exercise instructions _____1. In this exercise you are going to write a LF EMPLF5 in your library based on EMPMST & EMPMST1 Record name is not same in empmst1 with all fields in both fields & have keys is employee code. _____2. _____3. Create a DDS for the EMPLF5 with the following record formats specifications of EMPMST & EMPMST1. Define emp code as the key field.

_____4.

Compile EMPLF5.Check for no compilation errors.

6. Create a LF EMPLF6 based on EMPMST and EMPMST1 with similar format of EMPLF2, key are as similar as EMPLF3. 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. _____3. Create a DDS for the EMPLF6 with the following record formats specifications with similar format of EMPLF2. Define key similar as EMPLF3.

_____4.

Compile EMPLF6.Check for no compilation errors.

7. Create a multiple format logical file INVLF First format based on INVHDR key is Customer code and Second format based on INVDTL key is Invoice Number.

_____1. _____2. _____3. _____4.

In this exercise you are going to write a multi format LF INVLF in your library based on INVHDR with CUSCDE as key and INVDTL with INVNO as key. Create a DDS for the INVLF with the following record formats specifications Define CUSCDE and INVNO as the key field in appropriate places. Compile INVLF.Check for no compilation errors.

10

8. Create a LF 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 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 Test level is not work properly. See whether records are arranged in first changed first out order when duplicate key values are given. _____2. Create a DDS for the file EMPLF8 with file level keywords UNIQUE FIFO,LIFO,FCFO in 4 different logical files same as you code for physical file EMPMST. Compile EMPLF8.Check for no compilation errors.

_____3.

11

9. Create a logical file EMPLF9 with key field employee id and include the key field keywords ABSVAL, DESCEND

Exercise instructions _____1. In this exercise you are going to include key field keywords ABSVAL, DESCEND. _____2. _____3. _____4. Create a DDS for the file EMPLF9 which is based on EMPMST3 with the following record formats specifications. In EMPMST3, define employee id as the key field. In EMPLF9, give descend for empid key field. When you give DESCEND keyword check whether employee records are listed in descending order. 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. Compile EMPLF9. Check for no compilation errors.

_____5.

12

10. Create a PF EMPLF10 with field level keywords ALIAS, ALWNULL, CHECK(MF), CHECK(ME), COLHDG, EDTCDE, EDTWRD, RANGE, VALUES,DFT,DATFMT,DATSEP,TIMFMT,TIMSEP

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. _____3. Create a DDS for the file LF EMPLF10 based on EMPMST4 with the following record formats specifications. Specify the following keywords. Give ALIAS name ie alternate name to field EMPNAM. Set ALWNULL for AMOUNT FIELD. Give range of values (2000 5000) depends on the empsal with datatype it will work accur to EMPSAL and select EMPSAL for range of values. Give values keyword for DEPID field as IT,PR,SA,TR. When you give ALWNULL, allows null value in the field. When you give COLHDG, specfies column heading for fields. Give DFT values for DEPID as IT & EMPSAL fields as 1234 inzpfm command through only exact output we will get otherwise we will not get exact ouput in test level. Give DATFMT as *DMY and DATSEP as / and TIMFMT as *HMS and TIMSEP as :. Check (AB) Allow blanks.with values (xxx) to see the allow blanks value in field. Check for salary field for Check ME Field must be entered mandatorily, CHECK MF Mandatory fill of that value.

_____4. _____5. _____6.

_____7. _____8. _____9.

_____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

_____13. When you give REFFLD for a particular field, refers the field from field reference file and source of the existing file. _____14. Compile EMPLF10.Check for no compilation errors.

14

11. Create a EMPLF11 with field level keywords SST, CONCAT, RENAME.

Exercise instructions _____1. In this exercise you are going to include field level keywords SST, CONCAT, ENAME in EMPLF11. _____2. _____3. _____4. _____5. Create a DDS for the file EMPLF11 with the following record formats specifications. Specify the following keywords. Include a field Charge in EMPMST4/EMPMST3 and Rename CHARGE to PRICE in EMPLF11. Concatenate EMPYR EMPMO EMPDA to SEQDAT field. Concatenates 2 or more physical file fields into a single field in logical file. Substring address SST (ADDRESS 1 18) and move it to CITY. Address is the field in EMPMST3/EMPMST4. Defines a field in a logical file that is a subset of character or zoned in physical file. Compile EMPLF11.Check for no compilation errors.

_____6.

15

12.Create a LF EMPLF12 with Select/Omit Keywords.

Exercise instructions _____1. In this exercise you are going to include select/omit keywords in the logical file. _____2. _____3. _____4. _____5. _____6. _____7. Create a DDS for the file EMPLF12 with the following record formats specifications . Specify the following keywords. Create fields EMPSTS, EMPABS, EMPGRD, EMPDUR, EMPPRC in EMPMST3/EMPMST4 ie status, absolute, grade, duration, percentage values. Select EMPABS comp GT 0 & EMPGRD values (UNS, INC). Select EMPDUR within RANGE (1 4) OR EMPPRC comp (LT 300). Omit EMPSTS values (P C). Compile EMPLF12.Check for no compilation errors.

16

13.Create a JLF STULF join logical file

1) Create STUDENT physical file with following field (key field STUCDE) 2) Create CLASS physical file with following field (key field CLACDE )

STUDENT Field name STUCDE STUNAM STUDEP STUDOB STUADR Length 5 15 2 30 Data type Zoned Alphanumeric Alphanumeric Date(L) Alphanumeric

CLASS Field name CLACDE CLADEPT Length 5 2 Data type Zoned Alphanumeric

Exercise instructions _____1. In this exercise you are going to create join logical file STULF14 of department and employee table. _____2. _____3. Create a DDS for the join logical file with the following record formats specifications . Include JFILE,JOIN,JFLD,JREF keywords. Join file (JFILE) STUDENT and CLASS file and join (JOIN) STUDENT and CLASS with join field (JFLD) STUCDE and CLACDE.Use JREF with STUDENT table. Compile join logical file STULF.Check for no compilation errors.
17

_____4.

18

14. Create a JLF STULF1 inner join

Exercise instructions _____1. In this exercise you are going to create join logical file EMPLF15 for inner join of STUDENT and CLASS file. Join field is STUCDE. _____2. _____3. _____4. Create a DDS for the join logical file with the following record formats specifications . Include JFILE, JOIN, JFLD, JREF keywords. For inner join, join STUDENT & CLASS file with STUCDE as key only rows which are matched are joined .Use DYNSLT keyword. Compile join logical file STULF1.Check for no compilation errors.

19

15. Create a JLF STULF2 -left outer join

Exercise instructions _____1. In this exercise you are going to create join logical file STULF2 for left outer join of STUDENT and CLASS file. Join field is STUCDE. _____2. _____3. _____4. _____5. _____6. Create a DDS for the join logical file with the following record formats specifications. Include JDFTVAL keyword. Specify the following keywords. Include JFILE, JOIN, JFLD, JREF keywords. For left outer join of STUDENT & CLASS table contains all rows from STUDENT table ie left table .Use JDFTVAL keyword. JDFTVAL Indicates that the system will provide default values for fields when a join operation to the secondary file produces no records. Include JDFTVAL for natural join missing secondaries when records are there in STUDENT file and no corresponding record in CLASS file,JDUPSEQ keywords more than 1 match in secondary file ie in CLASS file. Specifies the field use to arrange duplicate records on a join. Specify the following keywords. Compile join logical file STULF2.Check for no compilation errors.

_____7.

20

16. Create a JLF STULF3 Self join.

Exercise instructions _____1. In this exercise you are going to create join logical file STULF3 for self join. For self join, join field is STUCDE in the STUDENT file. _____2. _____3. _____4. _____5. Create a DDS for the join logical file with the following record formats specifications .Specify the following keywords. Include JFILE,JOIN,JFLD,JREF keywords. For SELF join ,join STUDENT table to STUDENT table with key STUCDE. Compile join logical file STULF3.Check for no compilation errors.

21

17. Joining 2 files with Join field not in the logical file

Exercise instructions _____1. In this exercise you are going to create join logical file STULF4 for joining 2 files STUDENT, CLASS with join field not in logical file. _____2. _____3. _____4. _____5. Create a DDS for the join logical file with the following record formats specifications .Specify the following keywords. Include JFILE, JOIN, JFLD, JREF keywords. 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. Compile join logical file STULF4.Check for no compilation errors.

22

Das könnte Ihnen auch gefallen