Assignment
Assignment
1)The are 2 input files .Given below the format of the input files
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.
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)
Calculation:
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
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.
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:
(a) Finding the marks of a particular student (let us say: NME = 'RAMESH') in a
particular subject (let us say: Subject Name = 'COBOL').
(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?
JCL
1) We have a 10 steps in a job.Write a JCL to execute the job from step4 to step6..
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?
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
duplicates.
VSAM
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.
DB2
1. Create a database with a name db1.
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.
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)