You are on page 1of 5


1)The are 2 input files .Given below the format of the input files

File format of the first input file:

Employee no: numeric (7 bytes)

Name : characters (30 bytes)
Dept code : alphanumeric (3 bytes)
Salary : Numeric (9(5) V99)
Designation: characters (10 bytes)

File format of the second input file will be same as first one.

Take around 30 records in both the files. In the second take some records as it is in
1st files and some different records that of 1st file. Write a COBOL program to create
2 output file, one for matched records and other for unmatched records by
comparing both the input files.

2)There is one input file. The file format of the input file is same as assignment no 1.
Take around 30 records in the input file having duplicate records and Write a COBOL
program to compare the records of the input file and create 2 output file, one for
matched records and other for unmatched records.

3)Read the emp-mast-file which is given below and create a pay slip in the following
Format of the emp-mast-file
Emp-code PIC 99999
Emp-name PIC X (20)
Emp-Dept PIC X (3)
Emp-Basic PIC 9(4) V99
Emp-tel-phone-no PIC 9(7)

DA = 40% of Basic
HRA= 50% of Basic up to 9000, 60% for Basic > 9000
PF to be deducted at 12% of Basic + DA
Income Tax at 15% Basic+DA+HRA-PF for above 5000, nil for 5000 and below
Deduction= Basic+DA+HRA-PF-TAX
Net salary should be rounded to next higher 5 rupees.
Write a COBOL program to create a report in the below format.

Mphasis An HP company

Pay Slip for the month of XXXXX, YYYY


Basic: xxxxx DA: xxxx HRA:
PF: xxxxx Tax: xxxx Ded:

Total Earn: xxxxxxxxxx

Net: xxxxxxxxxxx
4. XYZ company has 5 warehouses for keeping its stock. Each of, these warehouses
stores 20 products and any of these products can be supplied by 5 suppliers. Write
the data division entry for this multidimensional table. Write the procedure division
entries for finding the number of products in the Warehouse-3 that have been
supplied by "ABC Company".

5. Read 2 input ps file, emp-mast-file (file layout in question-3) and emp-personal-

info file which file format layout has been given below

File format of emp-personal-info file:

DOB Pic X (8) like ccyymmdd

Sex Pic X(2)
Emp-first-name PIC X (20)
Emp-last-name PIC X (10)
Permanent Address Pic X (50)

And write to emp-file having file layout

Emp-code PIC 99999

Emp-Dept PIC X (3)
Emp-name PIC X (30).
Emp-Basic PIC 9(4) .99
Emp-tel-phone-no PIC 9(7)
DOB Pic X (8) like yy-mm-dd
Sex Pic X (1)
Permanent Address Pic X (50)

Emp-name will be first 5 digits of the Emp-first-name + last 4 digits of Emp-last-

name (e.g. if Emp-first-name is Alexander and Emp-last-name is Caboor
Then Emp-name should be Alexaboor.

6. Write a program in COBOL to merge two files having the following format:
The format for both the files is:
item_code 10 characters
item_name 25 characters
item_quantity 10 numeric digits

Please note the files may have an item whose item_code exists in both the files. In
such case the item_quantity for that item should be added.

7. From a main Program pass a date field to a validation subprogram

and get the result and display it. Use the dynamic call.

8. Write a program in COBOL which will take a four-digit number from the keyboard
and display the number in words on the screen.

9. XYZ university has 10 students in its ABC programme. To clear this programme
each student has to pass five courses. Write a program in COBOL to store the data in
memory as an array and declare the results as FAILED or PASSED. (Minimum
passing marks are 40%.)
10. Record of the marks obtained in 20 different subjects of a class of 50
Students is kept table as per the following structure:

Registration Number : 10 Decimal digits

Name : 20 Alphabets
Subject Name (for each of the 20 subjects): 20 Alphabet
Marks in a subject : 3 Decimal digits
Write the Data Division and Procedure Division of COBOL program for:

(a) Finding the marks of a particular student (let us say: NME = 'RAMESH') in a
particular subject (let us say: Subject Name = 'COBOL').

(b) Finding the total marks obtained by a particular student.

(Hint: The name and subject name are to be read from the keyboard in both the
above cases)

11. The human resource (HR) department of a business process organization (BPO)
maintains a list of the resumes of applicants. Write a program to sort the resumes in
descending order of qualification. Assume the categories of qualification are
doctorate, post graduate, graduate, diploma and others.

12. Write a program in COBOL to create an indexed sequential file from a disk file.
The format of the disk file is:
emp_no 5 numeric digits
emp_name 25 characters
date_of_birth 8 characters
basic salary 8 numeric digits
Select the key of the file as emp_no. How will you list all the employee details who
share a common date of birth?

13.Select any of the above program & compile it using XP-editor


1) We have a 10 steps in a job.Write a JCL to execute the job from step4 to step6..

2) In one job 3 procs are there

proc1 contain 10 steps
proc2 contain 5 steps
proc3 contain 5 steps

i) The job was abeneded in proc1 9th step. Write a job to restart the job from
proc1's 9th step.
ii) The step5 of proc2 is using the GDG version which is being created in step 2 of
proc2.Please write a job for that.
iii) In the step2 of proc2 is using same GDG version which is being created in
proc1's 8th step. If the job abends in Proc1 9th step what precautions you are going
to take if you want to restart the job from proc1 9th step.
3) What is SOC4 ?& how to resolve it?
4) What is SOC7 ?& how to resolve it?

5) In step3 of proc2 is concatenating 5 datasets like

//DDname DD DSN=a.xx
// DD DSN=b.xx
// DD DSN=c.xx
// DD DSN=d.xx
// DD DSN=e.xx
I want to override the b.xx with Dsn=f.xx how can you write in job.

6) Write a jcl to copy a VSAM file from DASD to foreign tape. Depending upon the RC
and CC job will execute the next step. IF RC=1050 it will send an email to Business
users stating Empty file in subject line of the email.IF the cc for the first step will less
than equal to 4 then in the second step sort the datas of the DASD eliminating the

7) Write a JCL to define an ALTINDX for KSDS.

8) How to copy the GDG from another GDG.

1. Read the ksds file in random mode and display the record of a given empcode
from sysin or psfile.

2. Read the KSDS file in dynamic mode and display the records of dept “MKT” only.

3. Write a program to delete a record from VSAM file. The VSAM file may be r KSDS
or RRDS.
4.Create the VSAM files using FILE AID & use the command Copy,search,delete using
File Aid.

1. Create a database with a name db1.

2. Create a table named 'Student' with the following column

Stud_Name 30 Char
Stud_Number 9 digits (Primary Key)
Stud_Class 3 digits

3. Create another table named 'StudSub' with the following column

Stud_Number 9 digits
Stud_Subject 1000 Char (This will be populated by the subjects separated
by commas. Like Math, Hindi, English)

4. Create another table named 'Teacher' with the following column

Teacher_Name 30 Char
Teacher_Number 3 digits
Teacher_Subject 400 Char ((This will be populated by the subjects separated
by commas. Like Math, Physics, Chemistry)
5. Write a COBOL program to generate a report of possibilities that a student can
attend a class of a particular teacher.

6. Write a COBOL program to fetch the data from Student’s table using cursor and
write into PS file which should be tab delimited when we import that file to excel.
7.Negative dependence jobs should not run concurrently as those jobs are using
same recourses at same time its causes the dead lock What are the steps we need to
take care to avoid the dead locks situations?

8) Sync jobs updates the data base to keep in accurate position other wise its
causing the duplicate rows in data base …. How we should make sure our jobs with
out extracting duplicates?
9. If the job get abended with RI constraint (SQL code -530) then how you will solve
the problem.

10. If the job get abended with sql code -805 then how you will solve that.

11. What is the difference between sqlcode -904 and -911.

12. Write an SQL query to fetch 5th max without duplicates and with duplicates.

13. Write an SQL query to get the current date and timestamp.

14. Write a COBOL program to insert the data into StudSub table by reading the
data from a KSDS VSAM file which has the below file format and fetch Stud_Name
and Stud_Class from Student table for those Stud_Number which are present in
StudSub table.

File format:
Stud-Number Pic 9(9)
Stud-Subject Pic X(10)