MF Interview Questions
MF Interview Questions
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
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
9.
10.
11.
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.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
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.
//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?
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)
/*