100% found this document useful (1 vote)
258 views

MF Interview Questions

This document contains interview questions and answers related to COBOL, JCL, and DB2. Some of the COBOL questions cover topics like the difference between INCLUDE and COPY, rewriting and deleting records from an ESDS file, displaying compound data items, and validating email addresses. The JCL questions discuss restarting jobs with GDG files, overriding concatenated DD statements, and troubleshooting abended jobs. The DB2 questions were not fully answered in the document.

Uploaded by

TJ
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
100% found this document useful (1 vote)
258 views

MF Interview Questions

This document contains interview questions and answers related to COBOL, JCL, and DB2. Some of the COBOL questions cover topics like the difference between INCLUDE and COPY, rewriting and deleting records from an ESDS file, displaying compound data items, and validating email addresses. The JCL questions discuss restarting jobs with GDG files, overriding concatenated DD statements, and troubleshooting abended jobs. The DB2 questions were not fully answered in the document.

Uploaded by

TJ
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/ 13

COBOL Interview questions:

1. What is the distinction amongst INCLUDE and COPY?


A minimal distinction is there in the way they work. They both help to extend design in a program.  The central
contrast is INCLUDE gets extended at PRE-COMPILATION organize itself and is the motivation behind why all
DCLGEN individuals are extended utilizing INCLUDE.

2. Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
We can rewrite the recordof same length at the position of previous record. Record
cannot be deleted.

3. 01 GROSS-PAY
05 BASIC-PAY PIC 9(5)
05 ALLOWENCES PIC 9(3)
if BASIC-PAY has a value 1000 and ALLOWENCES has a value
of 250,what will be 
displayed by the statement 
DISPLAY GROSS-PAY
a.1250
b.01000250
c.01250
d.1.250

4. Can JUSTIFIED be used for all the data types?


No it can be used only for alphabetic and alpha numeric

5. What is file status 39 ?


one of the reasons of file status 39 is file attribute mismatch. LRECL mentioned in
JCL is different than the one mentioned in COBOL.

6. I have file with customer details and I need to process only those records who is having valid email id, so
how we can validated these records using COBOL?
MOVE @ TO WS-CHAR
you can use INSPECT EMAILID TALLYING WS-COUNT-1 FOR ALL INITIAL WS-CHAR
IF WS-COUNT > 0 (means there is @)
proceed
ELSE
ERROR OUT
Step1: Inspect the "@" symbol in mail-id field
Step2 : @ counter should be 1 then only the maid-id is valid one.

7. What happens if you add a copybook to linkage section instead of adding it to a working-storage section in a
sub-program?
In that case u have to pass copybook throgh main progarm suppose your copybook name is pdtlseg then u
need to pass it through ur main pgm to subpgm name sub1

CALL 'SUB1' USING PDTLSEG, other variable


8.

9.

10.
11.

JCL Interview questions:

1.

2. My JCL have five steps & I created new versions of GDG in 
first step through fourth step & fifth step I was refered 
Step one GDG version. My JCL got abend at 4th step and how 
I can restart my JCL Please let me know the answers.

//STEP1 EXEC GDG1(+1) DISP=(NEW)


//STEP2 EXEC GDG1(+2) DISP=(NEW)
//STEP3 EXEC GDG1(+3) DISP=(NEW)
//STEP4 EXEC GDG1(+4) DISP=(NEW)
//STEP5 EXEC GDG1(+1) DISP=(OLD)
Here 2 scenario's are possible:

1) When dataset gets created in step 4 in case of


(DISP=NEW,CATLG,CATLG)

You need to restart from step 5:


In STEP5 use GDG1(-3).

2) When dataset doesn't get created in step 4 in case of


(DISP=NEW,CATLG,DELETE)
You need to restart from STEP4 
In STEP4 use GDG1(+1), 
In STEP5 use GDG1(-2).

3.

4.

5.

6.
7.

8.

9.
10.

11.
12.

DB2 Interview questions:


1.

2.
3.

4.

5.

6.
7.

8.

9.
10.

11.
12.
13.

14.

15. If you insert restart card inbetween any keyword paramater in Job card
then what will happen?
-> Where the RESTART is placed in the JOB statement will not change how the job executes.
RESTART is not a "positional keyword" for JCL. In Job-card, you can code it wherever you wish to,
of-course without distrubing the other positional-parameters.

16.
Lets assume that you have a PROC with the following step which has 5 concatenated steps.

//STEP010 EXEC PGM=PROGRAM1

//INPUTF DD DSN=INPUT.FILE1,DISP=SHR

//            DD DSN=INPUT.FILE2,DISP=SHR

//            DD DSN=INPUT.FILE3,DISP=SHR
//            DD DSN=INPUT.FILE4,DISP=SHR

//            DD DSN=INPUT.FILE5,DISP=SHR

In the JCL which calls the above mentioned PROC, you want to override only one of the 5 concatenated
files from PROC. For example, you want to override the 3rd concatenated file with another file called
INPUT.NEWFILE in the JCL.

This can be accomplished by using the below code in your JCL where you want to override the file.

//STEP010.INPUTF DD

// DD

// DD DSN=INPUT.NEWFILE,DISP=SHR

// DD

// DD

Please not that you can not use DUMMY statement, as the usage of DUMMY signifies END OF FILE
statement and will ignore the next coming files.

17. Assume, in case of GDG we have created (+1) version in STEP1 and (+2) in
STEP2 and we have to use STEP1 created GDG in STEP3 how will you use?
Also If job abend at step2 how do use the GDG created in STEP1 and 2?

Use (+1) only in step3 as the version number in the catalogue gets update only after finishing the
job or step(if job abends after the step).
Eg: if you have gdg no 25 before executing the program then
Case 1: job not abended then 26 will get created in step1 and 27 will be created in step2 and we
use (+1) in step 3 to refer the version created in step1.
Case 2: Job abended at after step2, then two versions will be created one in step1 and one in
step2 . After restarting we need to refer (-1) in step3 if we need to refer the version created in
step1.

18. If any job abended in production support what are the steps you will take to
resolve?
Assume if any job abened in payment cycle at particular record. How will you identity the record
on with the job has abened?

19. What are the purpose of steplib, joblib, jcllib?


Steplib – load module for the step- s806
Joblib – load module if not found from streplib this will be considered – s806
Jcllib – load module for cataloged procs are looked for this pds – ‘proc not found’

20. Using Sort how to find a string from Input record if the exact position of the
string is not known
SORT FIELDS=COPY
INCLUDE COND= (startpos,length, SS, EQ, C’STRING to be searched’)

21. How can we execute (RESTART from) only one particular step in a job?
Use restart and cond parameter at job card .i.e restart=stapname,cond(00,LE).
22. Without sorting how to copy records from one file to another file using
jcl.Mean I have one input file in which the record are like 1,6,5,4,2,3(for
example) and i want to copy to output file from top to bottom(without
sorting) like 3,2,4,5,6,1.so I want the JCL for this.cna any one can 
answers?
//SYSIN DD * 
INREC FIELDS=(1:1,10,11:SEQNUM,8,ZD)
SORT FIELDS=(11,8,ZD,D) 
OUTREC FIELDS=(1:1,10) 
/* 

Here we have data from 1 to 10 columns , i am generating seqence number from


column 11 in descending order , which is not part of record layout. After generating
Seqence number digits will get reversed .

You might also like