0% found this document useful (0 votes)
57 views3 pages

Primary Input File: USERID - NAME.COBCASE - PS.INPUT Indexed File: Userid - Yourname.Vsam - Ksds Transaction File: USERID - NAME.COBCASE - PS.TRANS

The document describes a case study involving a COBOL program that reads records from a transaction file, verifies the status code, and performs operations on a VSAM KSDS database. If the status is 'I', the program inserts the record as new or displays that it is a duplicate. If 'U', it updates the existing record or displays it was not found. If 'D', it deletes the record or displays it was not found. The output in the spool will indicate the results of these operations.

Uploaded by

mohan
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)
57 views3 pages

Primary Input File: USERID - NAME.COBCASE - PS.INPUT Indexed File: Userid - Yourname.Vsam - Ksds Transaction File: USERID - NAME.COBCASE - PS.TRANS

The document describes a case study involving a COBOL program that reads records from a transaction file, verifies the status code, and performs operations on a VSAM KSDS database. If the status is 'I', the program inserts the record as new or displays that it is a duplicate. If 'U', it updates the existing record or displays it was not found. If 'D', it deletes the record or displays it was not found. The output in the spool will indicate the results of these operations.

Uploaded by

mohan
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/ 3

CASE STUDY ON COBOL - PS – VSAM DATABASE

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. Use of COPY book is mandatory in this case study.

3. Use of 88 condition names are mandatory.

4. Checking FILE STATUS is must for all I/O operation.

FILES / VSAM KSDS USED:

Implement this case study with COBOL PS dataset & VSAM KSDS DATABASE.

Primary Input File : USERID.NAME.COBCASE.PS.INPUT

Indexed File: USERID.YOURNAME.VSAM.KSDS

Transaction file: USERID.NAME.COBCASE.PS.TRANS

SPECIFICATIONS

Following are the STRUCTURE for Input File : USERID.NAME.COBCASE.PS.INPUT

IN-EMPID PIC 9(5)


IN-ENAME PIC X(15)
IN-DEPT PIC X(4)
IN-SALARY PIC 9(5)
IN-PHNO PIC 9(10)

Following are the sample record entries

10001 ABC ACCT 50000 1234567890

10004 PQR FINS 50000 2345678901

10006 AAA TRAN 85000 3456789012

10008 PQR FINS 30000 4567890123

10010 ABC ACCT 44000 5678901234

10012 PQR FINS 22000 6789012345


Assume following is the structure of EMPLOYEE (VSAM KSDS) Database.

EMPID PIC 9(5)

ENAME PIC X(15)

DEPT PIC X(4)

SALARY PIC 9(5)

PH-NO PIC 9(10)

CASE STUDY – I

The following are the record entries for the above VSAM KSDS . The record entries from input
file must be entered through the COBOL PGM.

10001 ABC ACCT 50000 1234567890

10004 PQR FINS 50000 2345678901

10006 AAA TRAN 85000 3456789012

10008 PQR FINS 30000 4567890123

10010 ABC ACCT 44000 5678901234

10012 PQR FINS 22000 6789012345

Following are the records of Transaction file: USERID.NAME.COBCASE.PS.TRANS

FILE STRUCTURE FOR TRANS FILE

TRN-EMPID PIC 9(5)


TRN-ENAME PIC X(15)
TRN-DEPT PIC X(4)
TRN-SALARY PIC 9(5)
TRN-PHNO PIC 9(10)
TRN-STATUS PIC X(1)

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

EMPID ENAME DEPTSALARY PH-NO STATUS

10001 XYZ SALE 50000 1234567890 I

10001 ABC ACCT 60000 2345678901 U

10012 PQR FINS 60000 3456789012 D

10002 AAA SALE 70000 4567890123 I

10003 BBB ACCT 80000 5678901234 U

10008 PQR FINS 30000 6789012345 D


10003 XYZ SALE 55000 7890123456 I

10010 ABC ACCT 65000 0448123456 U

10033 PQR FINS 22000 0448123456 D

CASE STUDY– II

LOGIC :

Write a COBOL program to READ records from the above given PS transaction dataset
and verify the status,

If STATUS is given with ‘I’, insert that records as a new record into the KSDS
database and display with INSERTED SUCCESSFULLY in SPOOL, else if status is
with ‘I’ and record already exist in KSDS, then display with DUPLICATE
RECORD EXIST in SPOOL.

If STATUS is given with ‘U’, update the given details into the existing KSDS
record and display RECORD UPDATED in SPOOL, else if the status is with ‘U’,
and record not exist, display RECORD NOT FOUND in SPOOL.

If STATUS is given with ‘D’, delete the record from KSDS database and display
DELETED SUCCESSFUL in SPOOL , else if the status is with ‘D’, and record not
exist, display RECORD NOT FOUND in SPOOL.

OUTPUT IN SPOOL WOULD BE…

DUPLICATE

UPDATED

DELETED

INSERTED

RECORD NOT FOUND

DELETED

INSERTED

UPDATED

RECORD NOT FOUND

You might also like