You are on page 1of 8

Skip to main content

CATP Mainframe Lab2 Assessment


You are logged in as Arif Shaik (Logout)

o Site Home

Time Left

1 LAB2 ASSESSMENT

Modules: COBOL, DB2 and JCL Duration: 4 Hr

LAB2 – Question ID: 2E

Login Note:

o Connect to IP Address 10.237.206.10 and Port 23.


o Logon using the MF ID provided, for the Lab Assessment
o Use password same as your User ID.
o Enter the new password – (8 characters combination of alphabetic and
numeric).
o Follow the guidelines under each step and proceed with INSTRUCTIONS
section to create the final deliverables.

NOTE

o For the MF ID provided for the Lab Assessment, use the below specified
details.
o DATABASE: DBLAB01
o TABLESPACE: Use the below details for Table space name
based on the provided MF ID.
o PLAN:LABPL<yyy>, PACKAGE: LABPK<yyy>.
<yyy> – Denotes last 3 digits of your Lab Assessment MF ID.

The KK online Shopping Company maintains its discount, coupon and order
information in database DISCOUNT_DETAIL, COUPON_DETAIL and
ORDER_DETAIL tables for ease of access and maintenance. To make the team to
calculate final price for each item based on the discounts and coupon codes
develop the below modules:

DB2:

1. SPUFI Member Naming Convention: SB12E<yyy>, where <yyy> denotes the


last 3 digits of your TLAB user ID. Member should not contain any commented
queries.

o Using SPUFI, create table DISCOUNT_DETAIL with the below


columns, to store discount detail.

2. SPUFI Member Naming Convention: SB22E<yyy>, where <yyy> denotes the


last 3 digits of your TLAB user ID. Member should not contain any commented
queries.

o Using SPUFI, create table COUPON_DETAIL with the below


columns, to store coupon information.

3. SPUFI Member Naming Convention: SB32E<yyy>, where <yyy> denotes the


last 3 digits of your TLAB user ID. Member should not contain any commented
queries.
o Using SPUFI, create table ORDER_DETAIL with the below
columns, to store order information.

4. SPUFI Member Naming Convention: SB42E<yyy>, where <yyy> denotes the


last 3 digits of your TLAB user ID. Member should not contain any commented
queries.

o Using SPUFI, insert the below sample values into


DISCOUNT_DETAIL table:

Note: All Char field data to be inserted in CAPITAL letters.

Sample Values:

5. SPUFI Member Naming Convention: SB52E<yyy>, where <yyy> denotes the


last 3 digits of your TLAB user ID. Member should not contain any commented
queries.

o Using SPUFI, insert the below sample values into


COUPON_DETAIL table:

Note: All Char field data to be inserted in CAPITAL letters.

Sample Values:
6. SPUFI Member Naming Convention: SB62E<yyy>, where <yyy> denotes the
last 3 digits of your TLAB user ID. Member should not contain any commented
queries.

o Using SPUFI, insert the below sample values into ORDER_DETAIL


table:

Note: All Char field data to be inserted in CAPITAL letters. NULL denotes null
value to be inserted.

Sample Values:

COBOL:

Input : Data to be fetched from tables - DISCOUNT_DETAIL, COUPON_DETAIL


& ORDER_DETAIL

Output Table : ORDER_DETAIL

Output file : <TLABID>.L2E.ORDER.DET

DD name to be used : OUTORDPS

Note: Please use only the above mentioned DD names. Do not use
COPYBOOKs for declaring output file layout in COBOL program.

o Using a COBOL program,

1. Using a cursor, extract all order records from table Order_Detail


table order by ORDER_NO.
2. Using null value handling technique, verify whether the field
Item_Name field holds any null value. If any null values are
present, then do not process that record and continue processing
the next record. For records without null values in Item_Name field,
continue processing the next step.
3. Calculate Total_Price using following formula. Total_Price =
No_Of_Prices * Price
4. The main purpose is to calculate final price for each ordered item if
any discounts & coupons available for those items. If item has
Discount as well as coupon, both percentages have to be applied
to the Total_Price to get Final_Price. If no discounts or coupons
available in Discount_Detail or Coupon_Detail tables for the
ordered item, then Final_Price will be Total_Price.

o Discount:

a) Check whether any matching record available in Discount_Detail


table for the ordered Item_Code.

b) If any match found, calculate Disc_Price as follows. Disc_Price will be an


intermediate calculated value which will be used only for calculation purpose. It will
not be used in table update or output file.

Disc_Price = Total_Price – (Total_Price * Disc_Per / 100)

o Coupon:

c) Check whether any matching record available in Coupon_Detail table for ordered
Item_Code.

d) If any match found, calculate Final_Price as follows.

o Extract coupon
percentage
(Coup_Per) from
coupon_code.
Coupon
percentage will be
from 6th to 7th
position of
coupon_code.
o If Disc_Price is
calculated in
previous step, the
use following
formula.
Final_Price =
Disc_Price –
(Disc_Price *
Coup_Per / 100)
o If no discount
available in
Discount_Detail
and no Disc_Price
is calculated, then
use following
formula for
calculating
Final_Price.
Final_Price =
Total_Price –
(Total_Price *
Coup_Per / 100)

5. If Final_Price < 10000 then Free_Home_Del is ‘N’. If Final_Price >= 10000 then
Free_Home_Del is ‘Y’.

6. Update the calculated Total_Price, Final_Price and Free_Home_Del in


Order_Detail for the respective order.

7. Write the updated information into output file as per below format

NOTE: One space filler to be inserted between each field.

JCL:

a) Compile and execute the above COBOL program. RUNJCL has to be stored in
member with the naming convention "JB12E<YYY>".

Note: Sample compile and run JCL is available in


“TLABADM.LAB.SYS.COMPRUN”.

SPUFI:

1. SPUFI Member Naming Convention: SB72E<yyy>, where <yyy> denotes


the last 3 digits of your TLAB user ID. Member should not contain any
commented queries.

o Using JOIN operation join ORDER_DETAIL, DISCOUNT_DETAIL


and COUPON_DETAIL tables and extract the order detail of items
having both Discount and Coupon. Expected fields from Query are
ORDER_NO, ITEM_CODE, ITEM_NAME, NO_OF_PIECES,
DISC_PER, COUPON_CODE, TOTAL_PRICE and FINAL_PRICE.

INSTRUCTIONS:

o Follow the coding standard and error handling as applicable.


o Copy checklist member L2E from library TLABADM.LAB.SYS.CHECKLST
and complete the same. Place the completed checklist into final deliverable
PDS with naming convention L2E<yyy>.
o Copy the final modules in the PDS ‘<TLABID>.<X>.<Y>.PDS’.
Where X -> L2/L2AT1/L2AT2 (L2 for Actuals, L2AT1 for first attempt, L2AT2
for second attempt) and Y denotes 8 digit Batch name. Example: Y-
CHNMJ001

[Example for L2 PDS - TLAB001.L2.CHNMJ001.PDS


L2 AT1 PDS - TLAB001.L2AT1.CHNMJ001.PDS

L2 AT2 PDS - TLAB001.L2AT2.CHNMJ001.PDS].

o Follow the below naming convention for the members, where the JCL’s,
SPUFI input’s need to be placed:

o For JCL’s, the member name should be “JB<x>2E<yyy>”

o Note: Where <x> denotes the member number and <yyy>


denotes the last 3 digits of your user ID.
o Ex: If there are 2 members for JCL created by ID
TLAB001, the member name should be “JB12E001”
and”JB22E001”

o For SPUFI, the member name should be “SB<x>2E<yyy>”

o Note: Where <x> denotes the member number and <yyy>


denotes the last 3 digits of your user ID.
o Ex: If there are 2 members for SPUFI created by ID
TLAB001, the member name should be “SB12E001”
and”SB22E001”

o For COBOL, the member name should be “CB<x>2E<yyy>”

o Note: Where <x> denotes the member number and <yyy>


denotes the last 3 digits of your user ID.
o Ex: If there are 2 members for COBOL created by ID
TLAB001, the member name should be “CB12E001”
and”CB22E001”

o For DCLGEN, the member name should be “DB<x>2E<yyy>”


o Note: Where <x> denotes the member number and <yyy>
denotes the last 3 digits of your user ID.
o Ex: If there are 2 members for DCLGEN created by ID
TLAB001, the member name should be “DB12E001”
and”DB22E001”.

EXPECTED DELIVERABLES in Mainframe PDS:

o COBOL program in member name as suggested in instructions.


o SPUFI Queries in member names as suggested in DB2 and SPUFI
sections.
o RUNJCL for the COBOL program.
o DCLGEN in member name as suggested in instructions.
o Completed checklist

Available from: Thursday, 14 August 2014, 10:00 AM


Due date: Thursday, 14 August 2014, 02:00 PM

Submission draft
Final submission for assignment marking

You are logged in as Arif Shaik (Logout)


ATKMF026

You might also like