The document contains a series of questions and answers related to Job Control Language (JCL), COBOL programming, and database interactions, covering topics such as file handling, error codes, procedures, and utilities. It addresses specific functionalities like sorting files, handling GDG files, and using various JCL parameters. Additionally, it discusses COBOL programming constructs, SQL queries, and error handling in a database context.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views11 pages
Mainframe Questions
The document contains a series of questions and answers related to Job Control Language (JCL), COBOL programming, and database interactions, covering topics such as file handling, error codes, procedures, and utilities. It addresses specific functionalities like sorting files, handling GDG files, and using various JCL parameters. Additionally, it discusses COBOL programming constructs, SQL queries, and error handling in a database context.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
What is JCL? Ht
How to sort a 80 byte file - based on fitst 10/byte?,
What do we do with IEFBR14 utility?)
eee
Whatis the difference between a PS tehvsil sequential) file and a PDS (partitioned
data set) file?
Whatis the use of procedures (proc) in JCLs?
Whatis the difference between instream proc and cataloged proc?
What version controlling tool do you use?
How do you move your codes to production?
What scheduler did you use in your project?
0. Whats instream and cataloged proc? Can we use PEND statement in catalogued
proc?
11. If you want to bypass a step in a job, what condition coding will you use?
12. Use of time parameter, priority parameter.
13. If you code COND=(0,LE) in one of the steps in a jel, will that step get executed or get
bypassed? What will happen if you code it in the first step of the JCL?
14. COND=EVEN and COND-ONLY > when do we use these?
15. if you want to bypass the first step of a production JCL, how can you do that? If you
want to bypass the last step, then how can you handle that?
geeneen‘want to bypass the last step, then how cafiyou handle that?
16, What is meant by DISP=(NEW,CATLG, DELETE) in a DD statement? Explain each one.
17. Whatis the difference between DISP=OLD and DISP=SHR ?
18. GDG question -Why do we use GDG files instead of a regular PS file?
19. Ifa job is supposed to create 3 generations of the same GDG file in the same job,
then how can we do that? If the job fails for some reason, then what do we need to
consider related to these GDG files before restarting the job?
20. What is the use of JOBLIB, STEPLIB and JCLLIB?
[Link] time parameter - whatis the use. Does it limit the CPU utilization time or the job
run time.
22. Can we use instream data (DD *) in both cataloged and instream proc?
Ans: Yes for instream proc, no for cataloged proc. WA
[Link] dowe encounter S0C4 error? |
Ans: $004 Abend is a protection exception when a virtual address cannot be
mapped with a physical address. S0C4 Abend occurs when an Invalid address
referenced due to subscript error.
[Link] do we endaned aS0C7 abend?
‘Ans: Numeric variables/data items have non-numeric data,
[Link] utility can be used to copy data from a flatfile to a VSAM file?
‘Ans: IDCAMS -REPRO, |
26. How can you do an empty file check in jel?Ans: IDCAMS - Repro infile(filein) count(1) --> will return 4 if itis empty, 0 ifitis not.
27.1n a flatfile - position 1 to 8 is the transaction status (say accepted/rejected). You
28.
want to know the count of all accepted and all rejected transactions. How do you do
that using SORT utility? Write down the sort card,
i/p file: 80 byte sequential file , first 8 bytes is transaction status (accepted/rejected)
ofp file: file 1 -> only accepted transactions
file 2 --> only rejected transactions
Using sort utility, can we count the number of repeating records in a file? Like below.
Output file:
AMIT: 2 WN
RAJA:29, How to remove duplicate records from a file using sort utility?
30. | have below 2 files:
file1: pos 1-10 employee id, pos 11-20 employee name |
file2: pos 1-10 employee id, pos 11-20 employee department | i
Now, Lwant a report containing employee id, employee name Ljedenesea In i ii
department. Can you do that using sort? Tell the approach. Wit i Al H ail
i
i
ii
‘Ans: Using SORT-JOIN, joinkey will be pos 1-10 employee id.Topiehieokot |
How do you send data from el to cobol program?
JCL DDname --> SELECT X ASSIGN 10 Y. Which one is the DD name? ¥
Usage of string and unstring.
‘Suppose a string has low valus/high values. How can you replace it with spaces?
PIC $9(10)V99 COMP-3 --> How many memory bytes will it take?
Static and dynamic call
Difference of continue and next sentence. hy
Different file opening mode - input/outputii-o/extend, |,
9. Difference between search and search all. } i
[Link] is the use of ACCEPT verb in cobot?) |)! 1.) |)
11. Difference of COMP and COMP-3 variable. Ni"
12. 'COGNIZANT,TECHNOLOGY,SOLN' --> want to make it ‘coeNizaNT TECHNOLOGY
OLN! How can you do it in cabal, |
13, Different file organizations - indexed, sequential. HN
14, Different file access mode ~ sequential, random, dynamic. H
[Link]. | -> Ais alphanumeric, Bis numeric comp:3 variable. Willthis move
statement cause an abend? ne
Ans: No. Movement won't abend.
ON OTR ENS16, COMPUTE B=B+1 --> Continuation from above move statement. Will this cause
an abend? What abend?
Ans: Yes - SOC 7 abend.
17. What are the different divisions of a COBOL program? What ate the purposes of
those divisions?
Ans: Identification, environment, data, procedure.
18, Suppose your program abended with an unhandled abend in production. How do
you debug to get the line where it abended?
Ans: System message gives the memory location (hex location) of the program line
where it abended, In compile listing of the cobol we can find the hex location of each
verb of the cobol program. From there we can pin point the exact verb where it
abended.
19. SELECT X ASSIGN TOY --> which one is the JCL DDname here? X or ¥?
20. How do you pass data to a program from a job? Whatis instream data? Give an
example.
21. PIC $9(10)V99 COMP-3 - how much memory bytes willit take?
Ans: 7 bytes
22. Suppose one variable has low values and high values in it. You want to replace the
low values/high values. How do you do that?Ans: Inspect VAR1 replacing all low-values with SPACES.
[Link] static call and what is dynamic call? Which one is better and why?
24. Whatis the difference between CONTINUE and NEXT SENTENCE?
25. What will be the value of A and Batter execution of below piece of code?
|
MOVE 1TOA. I
MOVE 2 TO B.
IF A=B
CONTINUE
ELSEeh NN ANTS Ne allierence between CONTINUE and NEXT SENTENCE?
25. What will be the value of A and B after execution of below piece of code?
MOVE 1TOA.
MOVE 270 B.
IFA=B
CONTINUE
ELSE
COMPUTE A=A+1
NEXT SENTENCE
END-IF
COMPUTE B= A+B.
DISPLAY A.
DISPLAY B.
ANSWER : A=2 AND B=2,
(Not A=2AND B=4)
26. How do you do binary search in a cobol program?
[Link] difference between comp and comp3?
28. Index and subscript difference.
[Link] the difference of file organization indexed and sequential in cobol? Can you29. Whatis the difference of file organization indexed and sequential in cobol? Can you
open a VSAM file in sequential mode?
30. File access mode - sequential, dynamic, random - what are the differences?
31. Will below variable declaration throw any kind of error? If not then what will be the
initial values of VAR-A?
01 VAR-A PIC X(10) VALUE SPACE.
01 VAR-B REDEFINES VAR-A PIC 9(10) VALUE 109.. What are the steps to get an executabile load for a cobol-db2 module.
Ans: Precompile - compile - bind
Got timestamp mismatch error -805. What does that mean? What do you need to
check to resolve this issue?
PLAN and LOAD supplied is not in syne.
3. Use of cursor - declare/open/fetchiclose
4. Dynamic SQL. - how do you code? |
5. -811 error- multiple rows returned in a query but not handled.
6. Uncommitted read - whatis that? |
7. Where do we use PREPARE keyword in COBOL-DB2 program?
Ans: in dynamic SQL where the argumentis supplied with a working storage
variable - during preparing the sql statement.
8. Commit/ roll back - what is the use?
9. Table name : EMPLOYEE OTL
Columns: EMP_ID, EMP_NAME, EMP_ CATEGORY, EMP_SALARY
Write a query to extract all the employee details - where employee category =
‘CONTRACTOR’ and salary is greater than 40,00071, How many types of VSAM there?
2. Whatis alternate index in KSDS vsam?
‘Suppose your system is having a specific cut timing of 9. am. There is an SLA of
mins for that cut o/p to send to some external system. Your job abends at
0. What will your next course of action be?
2. In COBOL, call by value and call by reference - how to code and what are the use
of them?
3. What is HYPERSPACE? What is the use of it?