0% found this document useful (0 votes)
252 views

Input Table - Master Database: Employee Transaction File: USERID - COBCASE.PS - TRANS Output Report File: Userid - Cobcase.Ps - Report

This document provides guidelines and specifications for a case study involving COBOL programming with DB2 databases. The case study involves: 1) Entering sample employee records into a DB2 table from a COBOL program, 2) Reading an input file to insert, update, delete records in the DB2 table or update status messages, and 3) Generating a report of employee data grouped by department from the DB2 table. Standards for COBOL programming are also provided.

Uploaded by

Haritha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views

Input Table - Master Database: Employee Transaction File: USERID - COBCASE.PS - TRANS Output Report File: Userid - Cobcase.Ps - Report

This document provides guidelines and specifications for a case study involving COBOL programming with DB2 databases. The case study involves: 1) Entering sample employee records into a DB2 table from a COBOL program, 2) Reading an input file to insert, update, delete records in the DB2 table or update status messages, and 3) Generating a report of employee data grouped by department from the DB2 table. Standards for COBOL programming are also provided.

Uploaded by

Haritha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CASE STUDY (COBOL DB2 )

GUIDELINES FOR THE CASE STUDY:

1. All your programs related to case study should be available in the PDS named
USERID.NAME.COBCASE.PROGRAMS

2. The JCL for compilation of your program will be available in the PDS named
USERID.NAME.JCL.COMPILERS

3. Use of COPY book is mandatory in this case study.

4. Use of 88 condition names are mandatory.

5. Use of Redefine Clause is must.

6. Use of Table (occurs) is advisable.

7. The program should follow the standards provided at the end of this document.

FILES / TABLE USED:

Input TABLE - Master DATABASE: EMPLOYEE

Transaction file: USERID.COBCASE.PS.TRANS

Output REPORT file: USERID.COBCASE.PS.REPORT

SPECIFICATIONS

Implement the case study with COBOL PS dataset & DB2 DATABASE.

1. Assume the following EMPLOYEE records are stored in DB2 Database.

COLUMN NAME DATA TYPE DOMAIN CONSTRAINS


EMPID NUMERIC(5) NOT NULL
ENAME VARCHAR(15) NOT NULL
DEPT CHAR(4) NOT NULL
SALARY DEC(5,0) NOT NULL
PH-NO INTEGER NOT NULL

CASE STUDY – I
The following are the record entries for the above table. The record entries must be entered
through the COBOL program ( Not thru SPUFI or QMF).

EMPID ENAME DEPT SALARY PH-NO

10023 ABC ACCT 50000 044-111111

10012 PQR FINS 50000 044-222222

10024 AAA NULL 85000 044-333333

10019 PQR FINS 30000 044-444444

10028 ABC ACCT 44000 044-555555

10033 PQR FINS 22000 044-666666

2. Use the PS file as Input file which is given with the following details.

EMPID ENAME DEPT SALARY PH-NO STATUS Remarks

10001 XYZ SALE 50000 044-123456 I

10023 ABC ACCT 60000 044-123456 U

10012 PQR FINS 60000 044-123456 D

10001 AAA SALE 70000 044-123456 I

10024 BBB ACCT 80000 NULL U

10019 PQR FINS 30000 044-123456 D

10022 XYZ SALE 55000 044-123456 I

10028 ABC ACCT 65000 044-123456 U

10033 PQR FINS 22000 044-123456 D

CASE STUDY – II

LOGIC :

Write a COBOL to read records from the above given PS dataset and verify the status,

If STATUS is given with ‘I’, insert that records as a new record into the database
and change the remarks as INSERTED Successfully in PS file, else if status is
with ‘I’ and record already exist, then change the remarks with DUPLICATE
record exist in PS file.

If STATUS is given with ‘U’, update the given details into the existing record and
change the remarks as UPDATED in PS file, else if the status is with ‘U’, and
record not exist, change the remarks as Record not found.
If STATUS is given with ‘D’, delete the record from database and change the
Remarks as DELETED successful, else if the status is with ‘D’ and record does not
exist , insert the record and change the remarks as INSERTED in PS file,

CASE STUDY – III

LOGIC

Write a COBOL to read records from the DB2 database based on the DEPT column and
generate a report as following:

Note :

A) Report will be printed for all DEPT-NAME, Ascending order.


B) Page wise print ( For each 5 records the header and footer will be printed).

*****************************************************************************************

MPHASIS TECHNOLOGIES

DEPT NAME : -----------------

DATE : DD/MM/YYYY

*****************************************************************************************

EMPID ENAME SALARY PH-NO

*****************************************************************************************

---------- --------------------- ------------- ----------------

---------- --------------------- ------------- ----------------

---------- --------------------- ------------- ----------------

---------- --------------------- ------------- ----------------

---------- --------------------- ------------- ----------------

******************************************************************************************

TOTAL ------------------- PAGE NO: __

COBOL STANDARDS TO BE FOLLOWED

1. Code should be always indented.


2. Prologue is always written in the program.
3. Synopsis on functionality is mentioned for each section / paragraph.
4. Variable declarations are always properly commented.
5. Commented lines are converted into smaller case.
6. All divisions should be preceded and followed by a line of asterisks.
7. All paragraph names should be preceded and followed by a single line.
8. Code has to be written in capital letters.
9. All SELECT statements are preceded by a blank line and they have to start from column 12.
10. ORGANIZATION is specified for files (for PS file ,OPTIONAL and for VSAM file mandatory).
11. All working storage variable names should start with WS- and are meaningful i.e. name of the
variable suggests the value stored in it.
12. Usage clause of fields are correctly aligned.
13. PICTURE clause for all fields should be defined with parentheses for the field length with
minimum 2 digits in brackets. e.g. X(02).
14. All 01 levels should be preceded by a blank line.
15. All level 01 fields should start in column 8. Two spaces should be left between the level
number and the field name.
16. All PICTURE clause should be abbreviated to PIC & could start from SINGLE column.
17. For group level variables, the level numbers should be incremented by 05 for better
readability
18. All 88 level names should have the same prefix as the field they are associated with.
19. For files - file names, record names, field names are as per the standards. All file names
should be meaningful and should end with word FILE.
20. The order of files in the FILE SECTION could be the same as in FILE-CONTROL paragraph.
21. All variables in LINKAGE SECTION should be prefixed with LK.
22. No processing should happen in main section A000-MAIN-CONTROL.
23. Paragraph/section names should be prefixed with a 4 character number.
24. Paragraphs are placed in ascending order of paragraph numbers within the program.
25. WHEN OTHER clause is always coded when Evaluate statement is used.
26. Error handling routine should be called for all error handling and exceptions.
27. Copybooks are used for file declarations
28. EVALUATE is used instead of multiple IF/ELSE statements.
29. FILE STATUS check to be done for all file operations - read, write, update, delete, open,
close
30. All IF, PERFORMs should have corresponding scope terminators
31. Use of negative conditions like IF NOT should be avoided
32. Use only SPACES, ZEROES instead of ‘ ‘, and , 0
33. Separate paragraphs are coded for READ/WRITE for each file.
34. Avoid using hard-coded values in the program
35. Ensure that the 30-character limit is adhered to for data names
36. File names should be declared in the same order - Input , Output and I/O.
37. Use DISPLAY statements in the program, only when necessary in production program.
38. COMPUTE verb could be used for Complex Calculations
39. All IF-ELSE-END-IF statement should be well aligned. All subordinate IF statements should
be indented from preceding IF statement properly.
40. All “TO” indent should be in the same column as Move statements
41. STOP RUN should be coded only once in the program.
42. For subprograms, GO BACK should be coded only once in the program.
43. All PERFORMs should be coded along with the appropriate EXIT paragraphs.
44. Explicit scope terminators are used even for single line statements.
45. Avoid using GO TO statements in order to transfer control to other paragraph / section.
46. All loops have valid end conditions
47. Be sure that the following file characteristics in the program same as against the JCL
a) Record Length
b) Recording Mode
c) Organization and Access
d) DD Name.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy