You are on page 1of 40

Company name: BOA

COBOL
1. Static call VS Dynamic call
2. How can you tell a CALL is static or dynamic just by looking at the code?
3. If a COBBAT program is calling COBBATDB program, how many plans would be there?
4. What are the ways you can pass values to other programs?
5. What are the ways you can get vales to a program?
6. What is the use of REPLACING clause in COBOL program against copybooks?
DB2
1. Catalog tables?
2. PLAN_TABLE - what are the values you will look in the table for optimization?
3. DEAD-LOCK?
4. If a program is running for a long time which ran very minimal time yesterday, what are all
could be the reason?
5. SQL codes: 904, 903, 904, 811, 803, 530
6. Why cursor?
7. I know my query will return more than one row but I don't want cursor what should I do? -provide FETCH FIRST ROW ONLY
8. What is 305? NULL indicator not handled properly.
9. What are the ways to handle NULL indicator?
10. DB2 utilities REORG, RUNSTAT
11. There is a student table where a student can have more subjects and marks secured in that
subject. Now want the complete details of student who appeared for more than 3 subjects.
12. UNION, UNION ALL which will give a distinct result? --- UNION
13. What is the difference between GROUP BY and ORDER BY?
14. COMMIT and ROLLBACK --- how will you secure opened cursor from COMMIT? Will ROLLBACK
close all the opened cursor?
15. SYSIBM tables?
16. How can you get the number of rows impacted by the last executed query? - SQLERRD (3)
17. Isolation levels? CS, RR, UR
18. I am compiling my DB2 with CS will it lock the table though I use simple select on a table?
19. What are cluster and index?
Company name : HCL
1. How will you build an internal array in COBOL program --- OCCURS clause
2. How will you create a dynamic internal table? --- using DEPENDING ON clause.
3. Do we need to declare the depending on clause variable in WS? -- NO
4. Dynamic and Static calls? How will you identify just by looking at the program?
5. How will you pass values to the other programs? Via Linkage section, MQ, Files, TDQ, TSQ,
Channels & Containers
6. Why we should use TSQ, we can use TDQ instead right?
7. What is Binary search? What is the default ordering of Binary search -- ASC.
8. What is executable PLAN or Package?
9. What is Subscript and Index?
Company Name - CTS
1.
2.
3.
4.

Static VS Dynamic calls


Subscript VS INDEX -- which is better? Why it is better?
Search VS Search all?
What is COMP and COMP3? How much space will 9(4) COMP occupy?

5. What are isolation levels? What each will do?


6. What are cursors? Why we need cursors?
7. Explain a simple program which involves DB2 like how will you declare cursor, fetch, close etc.
8. Explain DB2 program compilation process.
9. Explain CICS-DB2 program compilation process.
10. Questions on Redefine like can WS-A X(100) can be redefined by WS-B X(200) wise versa?
11. Different file open MODES and their purpose? - INPUT, OUTPUT, I-O, EXTEND.
12. Few DB2 SQLCODEs 811, 530, 803 like most frequent.
13. Later I was asked to write few queries by given few sample tables -- which involved JOINS,
SUM (*), Group by etc.,
14. What does BLOCK SIZE IS ZERO means while defining the file in COBOL: program?
Company name - CSC
DB2
SQL codes -501 to -504, -904, -911, -803, -180, -181, -305, -205, -922 etc
Null indicator - how will you handle it? What are the possible values returned to null-indicator-var?
-2, -1, 0
DB2 Load and unload utilities.
About Explain? How will you determine cost of an query.? Where it will be available?
About COBBATDB program compilation process.
Bind options?
Isolation levels - CS RR UR RS.. about each.
Which is executable pkg or plan?
How will you copy a entire table in one region to another table which is having two more additional
columns.?
Portioned tables?

COBOL
Internal table
Search and search all
What are the changes need to be done while you changing a SERCH clause by SEARCH ALL clause
PERFORM types
String unstring inspect
How will you get the system date in COBOL pgm? and how will you get the date of 10 days after
today in COBOL (not using DB2)?
Evaluate and If end-if - some situation and answers
File organizations and access modes for VSAM files
JCL
VSAM utility - IDCAMS
Diff between Repro and SORT-copy?
What are the parameters used while creating GDG, KSDS, RRDS, ESDS
GDG - questions like - file created in step one and how it will be referred in next step. This job
abends after step1, then what are the changes need to be done while re-running/ changes
needed?
Understandings on JCLLIB, JOBLIB and STEPLIB
How will you check a file is empty and stop processing the next steps.
What is COND=EVEN, COND=ONLY
How many DD statement in a step?
How many steps in a PROC?
About JES3, JES2
CICS

What is DFHCOMMAREA
What is the return code when a file open error occurs in CICS
What are the CICS abends that you are aware of?
_________________
Guru:-)
You're never fully dressed without a smile

Real time Mainframe interview Questions and Answers :


1.What is DRDA ?
DRDA stands for Distributed Relational Database Architecture. DRDA is a connection
protocol for relational database processing which IBM and vendor databases use. It consists
of rules for communication between a remote relational DBMS and the application.
2. Explain the use of the WHERE?
The WHERE clause isolates an element or row whenever it is used with a
relational statement.
3. How can a LIKE table be created?
It can be made by the use of the LIKE parameter in the statement CREATE. These tables are
generally required for testing the production environment.

4. What is the need of running runstats in the test environment?


It is for clearing the default values from the catalog columns. Because if the columns have
default values then the result might not be an expected one.
5. What is the need of a secondary index in IMS?
It is a substitute path into any IMS database. It can be used as a file to acquire required data.
6. Explain foreign keys?
Foreign keys are properties of a particular table having matching entries to a primary key in
some another table. This results in the formation of a relation between the two tables.
7. Write about the selfreferencing constraint?
It limits the changes that can be made to the primary key from a foreign key. For this
purpose, the foreign key has to define a DELETE CASCADE rule.
8. What does a deadlock mean in DB2?
When two independent processes contend for the same resource or the resources reserved by
one another, it is called a deadlock. 911 and 913
are the SQLcode for a deadlock.
9. What is the function of DBCTL?
It is used to access IMS files for CICS Transactions and it is an address space. PSBs, DBDs,
IMS files and ACBs are fixed into DBCTL for file access. Now if an IMS call is generated by a
CICS program the processing gets transferred to DBCTL to be carried, and the result is sent
as reply.
10. How are TYPE 1 and TYPE 2 indexes different?
TYPE 2 index is available for DB2V4. In this type, the data pages get locked, but the index
pages are not locked. Therefore, TYPE 2 index are faster.
11. What are the different types of Table spaces?

There are three table spaces, namely:


Simple
Segmented
Partitioned
12. Write the difference between HIDAM and HDAM databases?
HIDAM has a separate index file which is based on the root segment. This file has
information regarding the pointer that marks the position of the data. On the other hand,
HDAM file does not have separate index file, but the key field of every record is passed
through a randomizer which places the record to a particular position in the database.
13. Explain referential integrity?
It is the rule that states that consistency needs to be conserved between the
foreign and primary keys. This means that each foreign key entry needs to have a fitting
primary key entry.
14. How are composite and multiple indexes different?
Multiple index are two indexes, one each for a column of the same table.
Composite index is only one index, which consists of combined values of 2
columns of a table.
15. What is the advantage in Denormalizing tables in DB2?
It lowers the requirement for executing intensive relational joins. It also cuts the number of
required foreign keys.
16. Explain Database Descriptor in brief?
DBD, short for Database Descriptor, restricts access to the database when objects get altered,
created or dropped.
17. State the maximum value up to which volumes can be inserted to
an STOGROUP?
Volumes can be inserted up to 133. Practically though, only 34
volumes, when added to an STOGROUP, becomes hard to manage and monitor.
18. Explain deleteconnected tables?
Tables, which are related through a foreign key, are known as deleteconnected tables. This is
because whenever any entry in the primary key is deleted, it affects the values in the foreign
key table too.
19. Explain lock contention?
The DBD only allows entry to one object at a particular time. Lock contention is said to
happen when more than one object seeks permission for execution simultaneously.
20. What is SPUFI?
SPUFI is the abbreviated form of SQL Processing Using File Input. It is a menudriven tool
which the developers use to make objects in the database.
21. What is an alias?
It is a substitute to a synonym. Aliases are developed for distributed environments so as to
avoid the use of location qualifier of a view or table. It is not dropped when the table gets
deleted.
22. What is the place for VSAM KSDS?
It is the BSDS.

23. Name and explain the type of locks?


There are three types of lock, namely:
Shared This type of lock permits two or more programs to read from the locked space but
does not allow them to change it.
Update This lock is more lenient. It permits the program to read and change the locked
space.
Exclusive This lock restricts all users from accessing the locked space.
24. Explain isolation level?
Isolation level is the degree to which the activation group in focus is isolated from the
activation groups executing at the same time.
25. What is NOTCAT2?
It is an MVS message that indicates the presence of a duplicate catalogue in the database.
This problem can be fixed by removing one of the entries and then adding a new one.
26. What will happen if both STEPLIB and JOBLIB are specified?
JOBLIB is a Data Definition statement. It determines the location of the program,which
called the EXEC statement. JOBLIB applies to all steps present in that whole job. It is not
possible to use it for catalogued procedures. STEPLIB is very similar JOBLIB. It determines
the dataset in which the program exists. It applies only to one step and not the entire job.
STEPLIB can be used at any position in the job step and can also be used for catalogued
procedures. In a situation when both STEPLIB and JOBLIB are specified, JOBLIB will be
ignored by the system.
27. State the difference between JES2 and JES3?
In JES3, the allocation of data sets for the steps takes place even before the job is scheduled
for execution. While in JES2, this allocation takes place just before the execution of each
step.
28. State all the File OPEN modes?
The four File Open methods are:
INPUT
OUTPUT
EXTEND
IO
29. Is the order of the WHEN clause significant in an EVALUATE
statement?
Yes, the order is significant as the evaluation takes place in the top to bottom manner and,
therefore, the order has a large impact in the determination of results.
30. When are scope terminators compulsory?
They are compulsory for EVALUATE statements and inline
PERFORMS. Scope terminators are always declared explicitly to improve readability.
31. What is linkage section?
It is a part of a program that is being called and maps to data items in the
programs (calling) working storage. Linkage Sections is where shared items are declared
and defined.
32. How is NEXT SENTENCE and CONTINUE different?
The NEXT SENTENCE hands the flow of control to the statement that follows the next
period. On the other hand, CONTINUE hands the flow of control to the next statement after
the scope terminator.

33. What is the need to code COMMITS in batch programs?


COMMIT statements are used to release locks which are required for that unit of work, and
then permit a new unit of work. In other words, if COMMITS are not coded in the program
and the program has been sent for execution, then while processing, in place of just going
back to a few inserts since the nearest commit, the program has to go back to the inserts
which were made during the entire run of the program. This extra process takes around
twice or thrice the time taken normally.
34. How is data retrieved from multiple tables using a single SQL
statement?
Data can be retrieved from multiple tables by using joins, nested selects and
unions.
35. Write about a view in brief?
It is a virtual table that is made using data from base tables and other views. This table is not
stored separately.
36. What parameters are used to control the free space in DB2?
Free space permits the addition of new rows.There are two parameters, which are used to
control the free space in DB2, they are:
PCTFREE It defines the free space percentage that will be present in each page.
FREEPAGE It specifies the number of pages to be loaded before leaving a page empty.
37. What is the function of CURRENTDATA option in bind?
It allows block fetch when selecting rows in a table. It is set to NO by default from
DB2V4. So it is important to change CURRENTDATA (YES), in the bind cards, to
NO in DB2V3 & earlier, as YES is the default value for them.
38. How can record locking be achieved in those DB2 versions which
do not support it?
It can be done by setting the record lengths size to more than half of the pages size.
39. State the maximum number of tables that can be joined?
The maximum numbers of tables that can be joined are fifteen.
40. Explain index cardinality?
Index cardinality is the number of discrete entries in a column. In DB2, a utility RUNSTATS
examines the column value redundancy to find if an index scan or tablespace is required for
searching of data.
41. Define clustered index?
A clustered index is the one in which columns are maintained in the same
sequence as the rows until there is still free space in the memory. DB2 then
processes the table in the given order expeditiously.
42. Name the lockable units in DB2?
DB2 implements locking on four types of units:
Pages
Indexes sub page
Tables
Table space
43. What is the function of the verb INITIALIZE?
This verb sets Alphanumeric, alphabetic and alphanumeric field items to

(Space) and Numeric and Numeric edited field items to 0 (Zero). The
INITIALIZE verb leaves FILLER items unchanged.
44. What is the importance of COMMON Attribute?
Its functions are utilized in nested COBOL programs. If COMMON attribute will not be
specified, the nested programs will find it impossible to access the program. An example of
COMMON program is Pgmname.
45. What will be the result if ON SIZE ERROR phrase is declared?
When the condition is true, the code written in the ON SIZE ERROR phrase is performed.
During this process, the content of the destination field does not change. If this phrase is not
mentioned, then the statement is executed with truncation. MOVE statement does not
support the ON SIZE ERROR phrase.
46. Can records be accessed randomly in ESDS?
Yes, records can be accessed randomly. It can be done by reference of Relative Byte Address
(RBA). However, it is not possible to delete records.
47. Why is free space left in KSDS Dataset?
While allocating KSDS Datasets, free space is declared at regular intervals at the time of
initial loading. This is done because this free space is utilized for keeping the data arranged
in sequence physically, even though inserted randomly.

48. Write in brief about clusters?


It is a combination consisting of the sequence set, index and data portions in the Data set.
The cluster has the program access given to it by the Operating System, and this allows
access to be granted to all parts of the Dataset at the same time.
49. Explain path?
It is a file that makes accessing a file by alternate index possible. The path defines a relation
between the base cluster and the AIX.
(http://interviewquestionsanswerspdf.com/2014/03/jmsinterviewquestionsandanswers/)
50 REAL TIME CICS Interview Questions and Answers
(http://interviewquestionsanswerspdf.com/2014/03/cicsinterviewquestionsandanswers/)
50. What is the function of IEBGENER?
IEBGENER helps in copying one SAM File to some other Source. It is also used to perform
simple data reformatting through the supply of control cards via SYSIN.

MAINFRAME INTERVIEW QUESTIONS.....


(Prepared by : Mr. Karthikeyan Aiyyamuthu, US Software, Trivandrum)
COBOL
What is renames and redefines
01 A
02 A1
01 B

02 B1
02 B2
can rename from A1 thru B2
Differences between CONTNUE and NEXT SENTENCE, give practical examples
Can you use a GO BACK in a stand alone program? what will happen if you use it?
Can you use COPY statement in a procedure division?
What is the difference between static and dynamic program? which is more efficient why?
have a main program P1 and two subprograms P2 and P3, is it possible that P2 can be
linked
statically and P3 be linked dynamically with the main program P1, if so how?

JCL
How to skip a PROC step without altering it.
How to change a dataset name in the PROC without altering the PROC
How will you copy a sequential file to a VSAM DATASET?
How do you pass a parameter from JCL to a COBOL program apart from PARM and SYSN
What is the maximum amount of characters that can pass from JCL to COBOL using SYSN
DD
*
How do accept the data passed from the JCL in a COBOL program
f there are 5 lines in SYSN DD * and if use 6 accept statements in my COBOL program
what
will happen
have mentioned the COPYLB in the JCL but the copybook is not expanded in the program
what would be the possible error you get
DB2
What is a cursor?
Can use a cursor for NSERT, UPDATE and DELETE?
MS
Any one abend in MS
What is LL parameter in MFS?
How do you invoke a MS DC screen
Where do you mention the transaction D in MS (which all components)
How do you insert a segment occurrence in an MS DB?
How is MS DB data stored?
How do you view the contents of MS DB DATABASE?
REXX
What all you can do in REXX?
How do you store records of a file in an array?
How do you find the position of a string in a stem variable?
How do you get the members in a PDS into an array?

General
What are the possible ways you can allocate a dataset?
While creating load libraries what all parameters will you give?
General
What is MVS?
How is MVS different from other OS?
What is the latest version of MVS?
What is 3.3 option?
COBOL
What is actual and formal parameter?
How do you pass parameter from main program to sub program and viceversa?
How do you make the changes made in the subprogram reflect in the main program?
Differences between CONTNUE and NEXT SENTENCE with practical examples
What is REDEFNES with example
What are the details that you provide while using an EXPECTOR
What is FLEAD and what is it used for
Using FLEAD what all datasets can you view?
What are the parameters that you give in FLEAD to view a dataset
What are the various organizations and access modes in COBOL FLES?
What is PSB?
What are the PROC options in PSB?
What is the dummy utility used in JCL?
01 WS-NAME.
02 WS-A.
04 WS-A1 PC X(04)
04 WS-A2 PC 99.
02 WS-B REDEFNES WS-A.
02 WS-C PC X(2) OCCURS 5 TMES.
What is the size of WS-NAME?
1)Diff b/w correlated subquery & Join
2)What is SQL
3)What is SPUF
4)What is PLA
5)How are they (above 3 ) different?
7)Two files have the same key, give logic on how would write all matching records to one file
&
non-matching records to another?
8)How will u create a GDG base, GDG version, read that version & create the next GDG
version
in same job?
9)Write an optimized query to fetch customer name belonging to a particular branch in the
following table?
Branch (col 1-3)

Account-no(col 4-10), unique key & 1st 3 digits are branch no) customer name(col 11-25)
10)How will u define a KSDS of avg length-100, max length-150, key length of 10.
11)How will u load data from flat file to KSDS?
12)How will u load data to a table?
13)Removing duplicates from file.
14)Common ABends
15)What are the parameters you would take into account while designing a pgm( a simple
pgm
which loads data to table)
16)Restart logic- f we are loading around 10 million records, when do we make a check point
entry?
17)How do change the dataset name in a proc without chging the proc?
Processes General
1) Whts CMM
2)How many KPA'S in CMM
3)Whts PCMM
4)About projects, ur roles
5) Explain the role of DPC
6) How will you rectify a bug if it happens
7) How will you set limits for bugs in your project
8) How will you make sure that the project is following the processes to prevent defects
01 WS-COUNT PC 9 VALUE 5
PERFORM XX-PARA WS-COUNT TMES
XX-PARA.
MOVE 10 TO WS-COUNT.
How many times will the XX-PARA get executed?
What is the maximum lenght of string that you can pass from JCL to COBOL?
What is the maximum levels possible in an MS database
What is the maximum number of segments poddible in an MS DB
How many modes you can open a file in COBOL
How do you refer back a dataset in a JCL step?
Good Luck Friends.
To recieve daily Job alerts in your email send a email to
iohnsonx-subscribe(yahoogroups.com or
click this link to visit the home page.... http://groups.yahoo.com/group/iohnsonx/
good collection oI ebooks in a cd visit http://users.cib.net/vics/

DB2
Precompile
Bind Process
Different types of columns / fields in DB2 tables
How to convert those fields into readable format
Cobol equivalent of Integer / Decimal (9,2) / Varchar
Group by / order by usage and scenarios
How to get unique values from a column of a table which has duplicate
values
Aggregate Functions of DB2 Sum Avg Max Min
How to retrieve max/min value from a table without using aggregate
functions
If a column is of 1000 bytes but the first 10 bytes has the name so how
can i re

trieve only first 10 bytes


What is Union and Union All
Cursor (What are the steps of using cursor in cobol and why do we use
cursors)
What is the use of withhold option in cursor
Different SQL Codes in cobol
Duplicate Keys
Cobol
Replacing in COBOL
Redefine and rename clause (Practical Usage)
Different usage of Inspect verb in cobol
Linkage Section Scenario
Have a group variable with occurs 9 times when i pass this value into
a host var
iable of a table of integer
It gives me an error so what should i do
Example - If there is a field of 100 bytes (First 20 bytes have last
name and th
en 50 to 70 have first name but it can have spaces so
how do i print first name one space and then last name)
Types of performs
Simple Perform
Inline Perform
Perform varying
PErform a section
Perform Until
Evaluate syntax and how and when to use it
Move Corresponding
Goto and Go back.
Stop Run
Set the return code in cobol to abend the program
Call another program
Call by value and reference
What is Set Initial
How to pass data from jcl to cobol PARM / SYSIN
how to internal sort in cobol
How to execute a cobol db2 program (What are the essential things
required for i
t)
Flags in cobol (88 level conditions)
Search Function in cobol for arrays - how to use it
Arrays (Static and Dynamic Arrays)
Dynamic Allocation of files
Restart logic in cobol
JCL
Job Card (Class / MSGCLASS / TIME / COND Parameter / Restart /
Region)
Symbolic Parameters
How to set the values of symbolic parametes and why are they used
Temporary files (Disposition Parameters)
Sort (Different Types of sort)
Outrec and Inrec Difference
MAtching records or non matching records from file 1 /2
Include and Omit Conditions
Sortof01 and of02 and of03 examples (Old and new record)
Idcams (Different Functions performed by it)

How to copy members from one pds to another (Selected or all)


Work datasets for sort (How to allocate them dynamically)
Joblib / jcllib / steplib
File override / Cond parameter override
VSAM Files
Types of VSAM Files
Primary Keys / Alternate Keys
How and where to define in a cobol program
Keys are defined where
Types of access modes and organizations in cobol program
How to do a random read of vsam file
How to do dynamic read of a vsam file
JCL INTERVIEW QUESTIONS
JCL QUESTIONS SET 1
1. What is primary allocation for a Data Set?
The space allocated when the Data Set is first created
2. What is the difference between primary and secondary allocations for
a Data Set?
Secondary allocation is done when more space is required than what has already
been allocated
3. How many extents are possible for a Sequential File ? For a VSAM
File ?
16 extents on a volume for a Sequential File and 123 for a VSAM File
4. What does a disposition of (NEW,CATLG,DELETE) mean?
- That this is a new Data Set and needs to be allocated, to CATLG the Data Set if
the step is successful and to delete the Data Set if the step abends.
5. What does a disposition of (NEW,CATLG,KEEP) mean?
- That this is a new Data Set and needs to be allocated, to CATLG the Data Set if
the step is successful and to KEEP but not CATLG the Data Set if the step abends
Thus if the step abends, the Data Set would not be catalogued and we would
need to supply the Vol ser the next time we refer to it
6. How do you access a File that had a disposition of KEEP?
- Need to supply volume serial no VOL=SER=xxxx MOD,DELETE
7. What does a disposition of (,DELETE) mean ?

The MOD will cause the Data Set to be created (if it does not exist), and then the
two DELETE will cause the Data Set to be deleted whether the step abends or not
This disposition is used to clear out a Data Set at the beginning of a job
8. What is the DD statement for a output File?
Unless allocated earlier, will have the following parameters:
DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB
9. What do you do if you do not want to keep all the space allocated to
a Data Set?
Specify the parameter RLSE ( release ) in the SPACE. Eg: SPACE=(CYL,
(50,50),RLSE)
10. What is DISP=(NEW,PASS,DELETE)?
This is a new File and create it, if the step terminates normally, pass it to the
subsequent steps and if step abends, delete it This Data Set will not exist beyond
the JCL

11. How do you create a temporary Data Set? Where will you use them?
Temporary Data Sets can be created either by not specifying any DSNAME or by
specifying the temporary File indicator as in DSN=&&TEMP We use them to carry
the output of one step to another step in the same job The Data Set will not be
retained once the job completes
12. How do you restart a proc from a particular step?
In job card, specify RESTART=proc step step name where procstep = name of the
jcl step that invoked the proc and stepname = name of the proc step where you
want execution to start
13. How do you skip a particular step in a proc/JOB?
Can use either condition codes or use the jcl control statement IF (only in ESA
JCL)
14. A PROC has five steps Step 3 has a condition code How can you
override/nullify this condition code?
Provide the override on the EXEC stmt in the JCL as follows: //STEP001 EXEC
procname,CONDstepname=value All parameters on an EXEC stmt in the proc
such as COND, PARM have to be overridden like this

15. How do you override a specific DDNAME/SYSIN in PROC from a JCL?


// DSN=

16. What is NOTCAT 2?


This is an MVS message indicating that a duplicate catalog entry exists Eg, if you
already have a Data Set with dsn = 'xxxxyyyy' and u try to create one with disp
new,catlg, you would get this error the program open and write would go through
and at the end of the step the system would try to put it in the system catalog at
this point since an entry already exists the catlg would fail and give this message
you can fix the problem by deleting/uncataloging the first data set and going to
the volume where the new Data Set exists(this info is in the msglog of the job)
and cataloging it
17. What is 'S0C7' abend?
Caused by invalid data in a numeric field
18. What is a S0C4 error ?
Storage violation error - can be due to various reasons eg: READING a File that is
not open, invalid address referenced due to subscript error
19. What are SD37, SB37, SE37 abends?
All indicate Data Set out of space. SD37 - no secondary allocation was specified.
SB37 - end of vol and no further volumes specified. SE37 - Max of 16 extents
already allocated
20. What is S322 abend ?
Indicates a time out abend Your program has taken more CPU time than the
default limit for the job class Could indicate an infinite loop
21. Why do you want to specify the REGION parameter in a JCL step?
To override the REGION defined at the JOB card level REGION specifies the max
region size REGION=0K or 0M or omitting REGION means no limit will be applied
22. What does the TIME parameter signify ? What does TIME=1440
mean ?
TIME parameter can be used to overcome S322 abends for programs that
genuinely need more CPU time TIME=1440 means no CPU time limit is to be
applied to this step

23. What is COND=EVEN ?


Means execute this step even if any of the previous steps, terminated abnormally
24. What is COND=ONLY ?
Means execute this step only if any of the previous steps, terminated abnormally
25. How do you check the syntax of a JCL without running it?
TYPERUN=SCAN on the JOB card or use JSCAN
26. What does IEBGENER do?
Used to copy one SAM File to another Source Data Set should be described using
SYSUT1 ddname Destination Data Set should be decribed using SYSUT2 IEBGENR
can also do some reformatting of data by supplying control cards via SYSIN
27. How do you send the output of a COBOL program to a member of a
PDS?
Code the DSN as pds(member) with a DISP of SHR The DISP applies to the pds
and not to a specific member
28. I have multiple jobs ( JCLs with several JOB cards ) in a member
What happens if I submit it?
Multiple jobs are submitted (as many jobs as the number of JOB cards)
29. I have a COBOL program that ACCEPT some input data How do you
code the JCL statement for this? ( How do you code instream data in a
JCL?
) //SYSIN DD* input data input data /*
30. Can you code instream data in a PROC ?
No
31. How do you overcome this limitation ?
One way is to code SYSIN DD DUMMY in the PROC, and then override this from
the JCL with instream data
32. How do you run a COBOL batch program from a JCL? How do you run
a COBOL/DB2 program?

To run a non DB2 program, //STEP001 EXEC PGM=MYPROG To run a DB2


program, //STEP001 EXEC PGM=IKJEFT01 //SYSTSIN DD * DSN SYSTEM() RUN
PROGRAM(MYPROG) PLAN() LIB() PARMS() /*

33. What is STEPLIB, JOBLIB? What is it used for?


Specifies that the private library (or libraries) specified should be searched
before the default system libraries in order to locate a program to be executed
STEPLIB applies only to the particular step, JOBLIB to all steps in the job
34. What is order of searching of the libraries in a JCL?
First any private libraries as specified in the STEPLIB or JOBLIB, then the system
libraries such as SYS1LINKLIB The system libraries are specified in the linklist
35. What happens if both JOBLIB & STEPLIB is specified ?
JOBLIB is ignored
36. When you specify multiple Data Sets in a JOBLIB or STEPLIB, what
factor determines the order?
The library with the largest block size should be the first one 37. How to
change default proclib ?
//ABCD JCLLIB ORDER=(MEMYPROCLIB,SYS1PROCLIB)
38. The DISP in the JCL is MOD and the program opens the File in
OUTPUT mode What happens ?
The DISP in the JCL is SHR and the pgm opens the File in EXTEND mode What
happens ?
Records will be written to end of File (append) when a WRITE is done in both
cases
39. What are the valid DSORG values ?
PS - SAM, PO - Partitioned, IS - ISAM
40. What are the differences between JES2 & JES3 ?
JES3 allocates Data Sets for all the steps before the job is scheduled. In JES2,
allocation of Data Sets Required by a step are done only just before the step

executes. JOB /EXEC/DD ALL PARAMETERS JOBLIB/STEPLIB PROCEDURES,


PARAMETERS PASSING CONDITION VARIABLES ABEND CODES.
41. What are the kinds of job control statements?
The JOB, EXEC and DD statement
42. What is the meaning of keyword in JCL?What is its opposite?
A keyword in a JCL statement may appear in different places and is recognized
by its name, eg MSGCLASS in the JOB statement The opposite is positional
words, where their meaning is based on their position in the statement, eg in the
DISP keyword the =(NEW,CATLG,DELETE) meaning are based on first, second and
third position.
43. Describe the JOB statement, its meaning, syntax and significant
keywords.?
The JOB statement is the first in a JCL stream Its format is // jobname, keyword
JOB, accounting information in brackets and keywords, MSGCLASS, MSGLEVEL,
NOTIFIY, CLASS, etc .
44. Describe the EXEC statement, its meaning, syntax and keywords.?
The EXEC statement identifies the program to be executed via a PGM=program
name keyword Its format is //jobname EXEC PGM=program name The PARM=
keyword can be used to pass external values to the executing program.
45. Describe the DD statement, its meaning, syntax and keywords.?
The DD statement links the external Data Set name (DSN) to the DDNAME coded
within the executing program It links the File names within the program code to
the File names know to the MVS operating system The syntax is // ddname DD
DSN=Data Set name Other keywords after DSN are DISP, DCB, SPACE, etc .
46. What is a PROC?What is the difference between an instream and a
catalogued PROC?
PROC stands for procedure It is 'canned' JCL invoked by a PROC statement An
instream PROC is presented within the JCL; a catalogued PROC is referenced from
a proclib partitioned Data Set.
47. What is the difference between a symbolic and an override in
executing a PROC?
A symbolic is a PROC placeholder; the value for the symbolic is supplied when
the PROC is invoked, eg &symbol=value An override replaces the PROC's
statement with another one; it substitutes for the entire statement

48. What is RESTART? How is it invoked?


A RESTART is a JOB statement keyword It is used to restart the job at a specified
s step rather than at the beginning

49A. What is a GDG? How is it referenced?How is it defined? What is a


MODELDSCB?
GDG stands for generation data group It is a Data Set with versions that can be
referenced absolutely or relatively It is defined by an IDCAMS define generation
datagroup execution
49B. Explain concatenating Data Sets ?
Data Sets can be grouped in a DD statement one after another, eg in a JOBLIB
statement where the load module can exist in one of many Data Sets.
49C. What is the difference between specifying DISP=OLD and
DISP=SHR for a Data Set?
A DISP=OLD denotes exclusive control of the Data Set; DISP=SHR means there is
no exclusivity .
50. What is MOD and when would you use it?
DISP=MOD is used when the Data Set can be extended, ie, you can add records
at the end of an existing Data Set
51. What are the keywords associated with DCB? How can you specify
DCB information? What is the OS precedence for obtaining that DCB
information, ie where does the system look for it first?
The keywords associated with the DCB parameter are LRECL, RECFM, BLKSIZE
and DSORG The DCB information can be supplied in the DD statement The
system looks for DCB information in the program code first
52. How do you designate a comment in JCL?
The comment statement is //* followed by the comments.
53. What is the meaning of the EXEC statement keyword, COND? What
is its syntax?
COND specifies the conditions for executing the subsequent job step The value
after the COND= is compared to the return codes of the preceding steps and if

the comparison is true, the step is bypassed (If this answer confuses you,
welcome to the club - memorize it and don't ask questions!).
54. What is the improvement to COND= in the latest version of MVS?
MVS now allows for an IF bracketed by an END IF around any job step to replace
the COND= syntax Again, if the IF statement is true, the step is bypassed.
55. What is the purpose of the PARM keyword in the EXEC statement?
The value after the PARM= specifies control information to be passed to the
executing program of the job step
56. What is the purpose and meaning of the REGION keyword and what
JCL statement is it associated with?
REGION specifies the maximum CPU memory allocated for a particular job or job
step If REGION is in the JOB card, it relates to the entire job; if in the EXEC
statement, it relates to the job step .
57. What is the purpose and meaning of the TIME keyword and what JCL
statement is it associated with?
TIME specifies the maximum CPU time allocated for a particular job or job step If
TIME is in the JOB card, it relates to the entire job; if in the EXEC statement, it
relates to the job step.
58. What is the meaning of data definition name (DD name) and Data
Set name (DSN name) in the DD statement?
Data definition name is the eight character designation after the // of the DD
statement It matches the internal name specified in the steps executing program
In COBOL that's the name specified after the ASSIGN in the SELECT ASSIGN
statement Data Set name is the operating system (MVS) name for the File
59. How is the keyword DUMMY used in JCL?
For an output File DUMMY specifies that the output is to be discarded For input it
specifies that the File is empty.
60. What does the keyword DCB mean and what are some of the
keywords ?
associated IT DCB stands for data control block; it is a keyword for the DD
statement used to describe Data Sets Keywords associated with it are BLKSIZE,
DEN, LRECL and RECFM.
61. What is the difference between BLKSIZE and LRECL?

BLKSIZE specifies the number of bytes


62. What are all the JCL statements used in JCL? & What are the JCL
statements you have coded so far?
//JOB marks the beginning of a job, contains job information //EXEC marks the
beginning of a job step, identifies program, cataloged procedure to be
executed //DD (data definition), identifies a data set and its attributes //OUTPUT
(specifies processing options for system output(sysout) data sets) //(null) (end of
job) /* (end of data placed in input stream) //PROC (procedure) //PEND (procedure
end) //* (comment)
63. What is the difference between the positional parameters &
keyword parameters, give examples where they are used?
Positional Parameters are:- a).Sequence predetermined b) Parameters separated
by commas c) Omitted parameters must be indicated by two consecutive
commas. d) Installation dependent EX: //JOBNAME JOB (DIS,
TRG.TRGGLO.NL.BATCH), PGM1) //SETP01 EXEC PGM=MYPROG Keyword
parameters are Predetermined words are referred to as key word Parameters.
Any sequence is permitted, separated by commas. Follow positional parameters.
Format is = EX: //JOBNAME JOB (DIS, TRG, N1, BATCH), MSGLEVEL=(1,1), //
MSGCLASS=X, NOTIFY=QZ6P03T, TYPRUN=SCAN
64. What are the operands coded in a JOB statement?
All the Positional and Key word parameters in the JOB statement. Accounting
Information, MSGCLASS, CLASS, MSGLEVEL, NOTIFY, USERID, PASSWD, COND,
REGION, RESTART.
65. How many characters can be coded for a job name? What were you
coding as a job name?
8 Characters, Usually JOBNAME will be like User-id + 1 Char
66. What is the difference between the Comment statement and the
Comments?How they were coded in a JCL?
//* is the comment statement and it starts from column number 1 Anything that
is written after 71st column is taken as a comment.
67. How will you check the syntax of the JOB without executing it?
Can use JSCAN.Code TYPRUN=SCAN and submit the JCL for syntactical errors.
68. What are all the parameters needed in a DD statement to create a
data set thru JCL? How a Partitioned data set is created thru JCL?

DISP (Disposition): The DISP parameter describes the status of a data set to the
system, what is to be done with the data set at the end of the job step, and what
to do with the data set if the step terminates abnormally DCB (Data control
black) : DCB=(LRECL=NN, BLKZIZE=YY,RECFM=Z,DSORG=MM) Z can be F, FB,
V, VB MM Can be PS (physical sequence) PO (partitioned) DSN (Data set name) :
UNIT : Identifies device of data set Space :
69. How is the Catalog procedure called from a JCL, if it is lying in your
own data sets ?
STEP1 EXEC PROC=PROC1 The library in which PROC1 is present should be
mentioned in PROCLIB.
70. What is the difference between the In-stream Procedure & Catalog
Procedure?
In-stream Procedures begin with a PROC stmt and must be terminated by a PEND
stmt. (PEND can also be coded for a cataloged Procedure, but it isnt required)
The PENC stmt coded as : //Option-name PEND comments The In-stream
Procedure is placed following the JOB statement of the JOB. Up to 15 In-stream
Procedures can be included in a single job. Each In-stream Procedure may be
invoked several times with in the job. //QZ5P13TD JOB (18636), HARISH,
CLASS=A //RUN PROC In-stream procedure starts from here //GO EXEC PGM=ONE
//SYSOUT DD SYSOUT=A //PEND //STEP1 EXEC RUN procedure is used like .. A set
of JCL stmts consisting of a PROC stmt and one or more EXEC and DD stmt
(steps), which is placed in a procedure library. It executed by an EXEC
(procedure) stmt in another data set (called the execution JCL). Advantages :
Saves time, prevents errors.
71. What is the Symbolic parameter?
What for it is needed? Where it is most commonly used?
Any parameter that can vary with each execution is a good candidate for
definition of a symbolic parameter. Use of symbolic parameter make the
procedure more flexible. This prevents the procedure to be modified each and
every time a small and recurring change is needed at a place. //DD1 DD
DSNAME=&SYSUID..PROFILE,DISP=(NEW,KEEP),
72. Can you explain the DISP Parameter in detail? What are the default
DISP Parameters?
a. Current Status NEW Default OLD exclusive SHR Simultaneously MOD b.
Normal Disposition KEEP Default if DISP = SHR, OLD, MOD DELETE Default if
DISP = NEW CATLG c. Abnormal Termination same as Normal Disposition
73. What is the difference between the Refer-back & Overriding
parameters?How are they coded in a JCL?

Refer back option is a reference to an earlier DD statement in the job or in


cataloged or in in-stream procedure called by a job step. KEYWORD =
reference. //JOB1 JOB .. //STEPA EXEC .. //DD1 DD DSN=REPORT ... // DD4 DD
DSN=*.DD1 //JOB2 JOB .. //SETP1 EXEC .. //DDA DD DSN=D578.POL.PUBS01 ..
//STEP2 EXEC .. //DDB DD DSN=*.STEP1.DDA Over riding parameters. In an Instream or Cataloged procedures, the DD names mentioned in the JCL will
override the ones in the procedures. //JOB1 JOB .. //STEPA EXEC PROC1 //PS1.DD1
DD DSN=SAMPLE.PUB,DISP=SHR //PS2.DD2 DD DSN=SAMPLE.PUB1,DISP=SHR
Proc PROC1 contains... //PS1 EXEC PGM=ABC //* //DD1 DD DSN=DUMMY
//SYSOUT DD SYSOUT=* // //PS2 EXEC PGM=DEF //* //DD1 DD
DSN=SAMP.PROG.DATA,DISP=SHR //DD2 DD
DSN=SAMP.PROG.DATA1,DISP=SHR // SYSOUT DD SYSOUT=*
74. How do you pass parameters to a program coded in an EXEC
statement?
Through PARM Clause coded on the EXEC statement. The parameters have to be
defined in the Linkage Section of COBOL program.
75. What is a GDG?< How will you create a GDG? Can a GDG be used for
Partitioned Data sets ?
A GDG is Generation Data Group. GDGS allow users to create multiple data sets
with the same base name distinguished by a logical number. History files can be
referenced by using a negative generation number. GDG base can be created
using a utility (IEBPROGM or IDCAMS) With (+1) we will be creating. EX: //OUTDD
DD DSN=QZ6P03T.ARUN.MASTER(+1) (Create new data set) //INDD DD
DSN=QZ6P03T.ARUN.MASTER(+0) (Reference most current data set). Yes - GDG
can be sequential, direct, or partitioned Organization and can be reside on tape
or direct-access volumes GDG must always be cataloged
76. What are the parameters used in creating a GDG? Explain in detail?
Can you alter the parameters for the existing GDG?If yes, How?
Creating a Model Data Set Label (or control block, DSCB) This label is a data set
which contains DCB attributes and is usually referred to in the DCB parameter
when creating new GDG data sets. Most shops create the model DSCB with no
DCB attributes.
77. What for the Model data set used for a GDG? How much space will
you give to the Model Data set ?
The system needs an existing data set to serve as a model supplying the DCB
parameters for the GDG to you want to create. The system uses the data set
label to obtain the DCB sub-parameters, and the model is called the DSCB for
reasons lost to history. Need not specify any space while creating a model data
set.

78. How many Maximum generations can be created for a GDG?> How
will you create a Generation data set ?
The maximum number of GDG versions that can be created is 255. A GDG data
set is created with (+1) appended to the name of the GDG base.
79. What is the E37 error?How will you resolve it with out losing a
single byte of data?
(Hint: This Error comes when you save the data set after editing it) Insufficient
Space.
80. What is SOC7 abend ?How do you resolve it?
Data Exception. Eliminate the bad data by debugging the program.
JCL QUESTIONS SET 2
Q: What are S0C1, S0C4, S0C5, S0C7 ABENDs??
A: S0C1 (Operation Exception Error) - May be due to
Missing or misspelled DD name
Read/Write to unopened dataset
Reading a dataset opened output mode
Writing into a dataset opened input mode
Called subprogram not found
S0C4 may be due to
Missing Select statement (during compile)
Bad Subscript/index
Protection Exception
Missing parameters on called subprogram
Read/Write to unopened file
Move data from/to unopened file;
S0C5 May be due to

Bad Subscript/index
Close an unopened dataset
Bad exit from a perform
Access to I/O area (FD) before read;
S0C7 may be due to
Numeric operation on non-numeric data
Un-initialized working storage
Coding past the maximum allowed subscript
S0CB might be due to 1.Division by Zero
Q: Why do you use a CONTROL CARD?
A: A CONTROL CARD can be a member of a PDS or a sequential dataset and is
used for storing the date fields, definitions of VSAM files etc., We use CONTROL
CARD because we cannot use an in-stream procedure in a procedure. Generally
you will be calling a PROC from your JCL and you cannot code instream
procedure in the PROC and so you will point to the dataset, which is called
controlcard.
Q: How do you submit JCL via a Cobol program?
A: In your JCL define as: //JOBA JOB 1111,JOB1 //STEP01 EXEC PGM=PROG1
//ddname DD SYSOUT=(*,INTRDR)....and your COBOL (PROG1) should look like
this: SELECT JCL-FILE ASSIGN TO ddname. Open this file and write the JCL
statements into this file. Example: MOVE '//TESTJOB JOB 1111,VISVEISH' TO JCLREC.MOVE '//STEP01 EXEC PGM=IEFBR14' TO JCL-REC.and close this file. Then
TESTJOB will be submitted.
Q: How do you submit a JCL under CICS environment?
A: Pass all the JCL codes to a COBOL variable (should be declared using OCCURS
clause) and then write the line one by one to the spool using CICS commands like
SPOOLClose, SPOOLOpen and SPOOLWrite. For more help refer CECI of CICS or
CICS manual.
Q: What is the parameter to be passed in the job card for the unlimited
time, irrespective of the job class
A: TIME=1440

Q: Define COND parameter in JCL?


A: COND is a condition parameter, consists of 2 subparameters, 1st - return code
from the previous step, 2nd - condition. If COND is true, the step on which COND
is coded will be BYPASSED. It is compared with system return code of previous
step //STEP1 EXEC PGM=ABCD //STEP2 EXEC PGM=XYZ, cond=(4,lt) STEP 2 will
be executed when system return code of step1 is less than 4.
Q: What is meant by S0C-07 system ABEND codes
A: S0C7 - Data exception error - you will get it whenever you are trying to move
the low values or spaces into the numeric field, or compare the numeric fields
with low values, or try to do some arithmetic operations on the low values. To
avoid this you have to always initialize the numeric fields otherwise they will
contain the low values.
Q: How to pass the temp dataset form one JOB step to another?
A: By specifying the DISP as PASS for the temp dataset
Q: Write a JCL to execute a Job by 7:00 AM on Jan 20,1986?
A: The code is: //*MAIN DEADLINE=(0700,B,012086)
Q: How many types of libraries are there in JCL?
A: Libraries are of three types: System Libraries:- such as SYS1.LINKLIB Private
Libraries:- Specified in a JOBLIB or STEPLIB DD STATEMENTS. Temporary
Libraries:- Created in a previous step of the Job.
Q: What do you mean by INCLUDE statement in JCL?
A: An INCLUDE statement identifies a member of a PDS that contains this set of
JCL statements is called an INCLUDE group. The system replaces the INCLUDE
statement with the statements in the INCLUDE group.
Q: What are the Maximum number of In-stream procedures you can
code in any JCL?
A: 15.
Q: What you mean by skeleton JCL?
A: JCL, which changes during run time,that is the values for the JCL such as
program name, dd name will change. The same JCL can be used for various jobs,
equivalent to dynamic SQL;
Q: What is JCL

A: It is an interface between operating system (MVS) & the application program.


When two related programs are combined together on control statements, it is
called job control language
Q: What is the maximum blocksize for a Tape file?
A: It is 32,760. Based on that we can calculate efficient number of Records in a
Block
Q: What are the basic JCL Statements for a Job?
A: The basic JCL statements for any job are: JOB : Identifies a job and supplies
accounting info EXEC : Identifies a job step by indicating the name of the
program to be executed. DD : Identifies a data set to be allocated for the job step
Delimiter (/*) : Marks the end of an in-stream dataset Null (//) : Marks the end of
a job Comments (//*) : Provides Comments PROC : Marks the beginning of a
procedure PEND : Marks the end of a procedure OUTPUT : Supplies options for
SYSOUT processing.
Q: What does the statements: TYPRUN=SCAN and TYPRUN=HOLD do in
a JCL statement?
A TYPRUN= SCAN checks the JCL for errors, TYPRUN= HOLD holds the job until
further notice.
Q: What is QSAM error usually when it occurs?
A: Usually it occurs at the time of job submission.
Q: What is the purpose of INCLUDE statement in a JCL?
A: It is used as an alternative for STEPLIB. When we specify the dataset name in
INCLUDE , it will search in all the datasets specified in the INCLUDE dataset.
Q: Is it possible to know the remaining free space in a Control
Interval/Control Area once an insertion has been made
A: No. It is not possible.
Q: What does SOC-04 error mean?
A: This error is faced when we execute the Cobol program. The main reason for
this error is that a variable is defined with fewer characters and we are trying to
move data, which is larger than the actual storage space.
Q: In which table PLAN is registered in?
A: RCT

Q: What is a GDG?
A: GDG - group of dataset that are logically or chronologically related, referred by
name and a relative generation number - an integer which identifies the
generation of a dataset and is coded in parentheses after dataset name.
Absolute GDG name - GxxxxVyy, where xxxx-absolute generation number, yyversion number. GDGs can be sequential, direct, partitioned. (VSAM - no). They
must always be cataloged. Advantages - all datasets have the same name and
system keeps track of adding new and retaining previous generations and
deleting oldest successive generation. To create a GDG we create a GDG index in
the system catalog with IDCAMS utility and then a model (prototype, DSCB) on
the same volume to supply DCB information. Empty - when limit is reached all
members are removed from the index, otherwise only oldest. Scratch-removed
members are uncataloged & deleted, otherwise - removed & uncataloged, but
remain in the system (not members of GDG any more). GDG number is updated
at the end of the job. If number is not specified all generations will be processed
from the beginning
Q: What do you mean by spooling?
A: This is managed by JES. This is used for Queuing the Outputs that are intended
for Printing and are first stored in SPOOLDASD.
Q: How many Instream-Procedures (PROCs) can be coded in a single
Job?
A: 15
Q: For how long a Job can be executed continuously on a Mainframe?
A: 248 DAYS
Q: How may divisions are there in JCL-COBOL?
A: SIX
Q: What is the Maximum number of DD Statements to be coded in a
single JCL
A: 3273
Q: How much space OS allocates when you create a PS or PDS?
A: 56 KB
Q: What is the minimum number of Dataset names (PDS) in one
Directory Block?

A: SIX
Q: What is the maximum number of steps in a Job?
A: 255
Q: How much is memory space involved, when we code BLOCKSIZE, TRK
& CYL
A: One block constitutes 32KB of formatted memory/ 42KB of Unformatted
memory; 6 blocks makes one Track & 15 Tracks makes one cylinder.
Q: What is DSNDB06?
A: This is the Place where DB2 Catalog resides;
Q: What is the use of DSNDB07?
A: This is the area where sorting takes place in DB2
Q: What is DATACOM DB?
A: It is a Database used with VSE.
Q: What is a Dummy Utility and what it does?
A: IEFBR14 is a Dummy utility and it is used for the sakeof EXEC PGM= ....
statement in JCL [when used it wouldnt perform any task]. e.g. While Allocating
a dataset you don't have to run any utility [this could be done by giving
disp=new in DD statment]. But for a PGM name must be given in EXEC statment,
it is used.
Q: What 3 guidelines do we have to follow when concatenating DD
statements?
A: The three guidelines for concatenating DD Statements are:- Datasets must be
of the same type (disk or tape) All datasets must have the same logical record
length (LRECL) The dataset with the largest blocksize must be listed first.
Q: On a DD statement, what is the main difference between creating a
new sequential flat file and a partitioned dataset?
A: SPACE= (n,m) for a sequential file, SPACE= (n,m,p) for a PDS where n, m, and
p are numbers. The p designates how many directory blocks to allocate.
Q: What is the difference between IEBGENER, IEBCOPY and REPRO in
IDCAMS utility?

A: They are the utility programs used in JCLs: IEBGENER : This utility is used for
copying sequential datasets which produces a PDS or a member from a
sequential dataset. IEBCOPY : This utility is used for copying one PDS to another
or to merge PDSs. REPRO : This is for copying sequential datasets. More or less
same as the IEBGENER
Q: What is the difference between STATIC CALL & DYNAMIC CALL
A: In the case of STATIC CALL, the called program is stand-alone and an
executable. During run time we can call it in our called program. In a DYNAMIC
CALL, the called program is not an executable program and it can executed
through the called program
Q: What is the difference between CATALOGED PROCEDURE and INSTREAM PROCEDURE?
A: INSTREAM PROCEDURES are set of JCL statements written between JOB and
EXEC statements, start with PROC and end with PEND statement. Mainly used to
test cataloged procedures. CATALOGED PROCEDURES are cataloged on the
procedure library (PROCLIB) and is called by specifying the procedure name on
the EXEC statement.
Q: Can we browse or edit the GDG dataset if it is a tape entry?
A: No
Q: What are the maximum and minimum sizes of any CONTROL AREA
(VSAM datasets)?
A: Minimum Size : 1 track; Maximum size : 1 cylinder
Q: How many parameters are there to a DISP statement and what are
their uses. ?
A: There are three (3) parameters: Parameter 1: Current data set disposition
(NEW, SHR,OLD,MOD) Parameter 2: Normal close action for data set (CATLG,
KEEP, DELETE) Parameter 3: Abend action for data set (CATLG, KEEP, DELETE)
Q: What is COMP?
A: COMP - HALF WORD BINARY
Q: What is a PROCEDURE?
A: A set of precoded JCL that can be modified through the use of parameters or
override cards. Note: Procedures can be catalogued or instream.

Q: What is the difference between specifying DISP=OLD and DISP=SHR


for a dataset?
A: OLD specifies exclusive use of a dataset, SHR allows multiple jobs to
concurrently access the dataset. [Note: When updating a dataset, you would
normally use OLD]
Q: What are the three basic types of statements in a jobstream?
A: The three basic types of statements in a jobstream are: JOB : We can code one
per jobstream EXEC : It can be one or more per job DD : one or more per
jobstep); JOB It indicates start of jobstream to the operating system and
through parms coded on it, it contains certain details about the job (like time,
region, message level, job accounting data). EXEC It indicates the start of
execution of a particular job step, be that step a program or a proc. DD It is a
data definition statement, which is used to describe the attributes of a dataset
(like name, unit, type, space, disposition etc.,).

Q: What does SYSIN * indicate?


A: Instream data follows this card and is terminated when followed by a card
containing // or /* in columns 1 and 2.

COBOL

Q:
A:

What are the three categories of data defined in the DATA division?
The file section (FD) information
Working storage information
Linkage section data definition

Q:
A:

What is the EVALUATE statement?


EVALUATE is the alternative to the nested IF statements and is used to
select from a list of processing actions. WHEN is used instead of IF to
determine if the action is to be taken. Like the IF statement, the WHEN
statement should be coded from the most likely to the least likely
occurrence. Like the nested IF, once the condition is true, control passes
from the evaluate statement to the next statement in the program.

Q:
A:

What are two of the more common forms of the EVALUATE statement?
The two most common forms of the EVALUATE statement are:
EVALUATE TRUE, which allows multiple variables to be checked for a true
condition. The list of options being tested must be prioritized as the
EVALUATE statement selects only the first TRUE condition per statement.
EVALUATE VARIABLE-NAME checks multiple options for the TRUE condition
of a variable.

Q: What does the INITIALIZE statements do?


A:
The INITIALIZE statement initializes data areas to zeros and spaces.
Q:
A:

How can you use INITIALIZE for specifying specific values?


INITIALIZE GROUP-ITEM REPLACING ALPHANUMERIC DATA BY HIGHVALUES. When the ERPLACING option is used, only the specified type will
be initialized.

Q:
A:

What is reference modification?


Reference modification is the name for sub string manipulations. The Y
allows part of a data item to be used without defining the data item in the
data division.

Q:
A:

Give two examples of how you would use reference modification?


In a list of ZIP codes, the first three digits define a geographic area:
IF ZIP (1 : 3) = 100
AREA = MANMALLAN
END IF
MOVE MEXICO TO STATE (5:6) could change NEW JERSEY to NEW MEXICO.

Q:
A:

Can there be a problem using ROUNDED in a compute statement?


Yes. The compute rounds each intermediate result in a compute statement
and not just the final result.

Q:
A:

What is COBTEST?
COBTEST is a debugging tool for examining, monitoring and controlling VS
COBOL II programs in a test environment. Programs can be debugged
using a full-screen interactive mode, as well as a line interactive or batch
mode. DATA may be altered, logic may be changed and results can be
viewed online.

Q:
A:

what are the techniques for achieving top-down programming?


Top-down is an effort to avoid spaghetti code and is sometimes referred to as go to less
programming. Processing is performed from the beginning to the end of paragraphs. Performs
rather than go tos are used to move through code. The PERFORMTHRU structure
should be used only when the THRU is to an EXIT paragraph.

Q:
A:

What is file organization clause?


The file organization clause identifies the logical structure of a file.

Q:
A:

Can the logical structure of a file be changed once it has been created?
NO.

Q:
A:

What is file organization indexed?


The file organization indexed is where the position of each logical record
within a file is determined by the indexes created with the file and
embedded in a key in each record.

Q:
A:

What is file organization sequential?


The file organization sequential indicates that records are loaded into a file
based on a record-to-record relationship of the data sequence. Sequential
is the default file organization.

Q:
What is file organization relative?
A:
The position of each logical record in the file is determined by its relative
record number.
Q:
A:

What is the dynamic access mode?


The dynamic access mode permits reading and writing file records by a
specific read or write statement, which can be sequential and / or random.
The dynamic access mode assumes that a file is indexed.

Q:
A:

What access modes are permitted with sequential organization?


The sequential access mode only.

Q:
A:

What access modes are permitted with Indexed organization?


All three access modes Sequential, Random and Dynamic are permitted.
In dynamic access mode, the file can be accessed sequentially and / or
randomly.

Q:
A:

what access modes are permitted with relative organization?


All three access modes Sequential, Random and Dynamic are permitted.

Q:
A:

What is an index for tables?


An index references data in a table, but does it differently than a subscript.
The index is defined with the table and represents a displacement into the
table.

Q:
A:

What are the advantages of Indexes?


Indexes are more efficient when used with the SEARCH verb because the
computer does not have to generate the displacement from the beginning
of the table.

Q:
A:

What are two SEARCH techniques?


The sequential or serial search moves through a table one record at a time
until a match has been made. For example, in a table of 10 numbers (1 to
10) to find the number 8 the search must check and eliminate 1 to 7. the
process is initiated by the verb SEARCH.
The binary search is a dichotomizing search and must have a key that is in
ascending or descending order. At each step of the search, half of the
records in the table are eliminated. For example, in the SEARCH for the
number 8, the first division would locate the number 5 and eliminate
records 1 to 5. the second division would locate the number 8. the process
is initiated by the very SEARCH ALL.

Q:
A:

Is a binary search efficient when compared to a sequential search?


The binary search is more efficient because it finds the answer with fewer
data checks. However, the process for each data check is less efficient
because of the machine code generated. If the list / table of variables has
fewer than 100 entries, a sequential search would be a better choice.

Q.
A.

What is a bubble sort?


A bubble sort is an efficient way of resequencing a small table that already
resides in memory. The sorting algorithm that can be used is referred to
as a bubble sort. The bubble sort compares the key of the first item in a

Q.
A:

table with the keys of all other items in the table, each time moving the
item with the lowest key to the first items position. The process is
continued, starting with the second item, comparing it to the third item,
swapping pairs of items until the entire table is in order.
What is an inline perform?
COBOL II allows a performed procedure to be coded in-line .The perform
statement is coded without a paragraph name, followed directly by the
coded to be performed .An END-PERFORM statement is required and
coded at the end of an in-line perform.
PERFORM
- --

--- ---

END-PERFORM
Q.
How could 88 levels be used for validation of data for valid values and
valid ranges?
A:
The 88 level is used to specify the valid values and /or ranges of values,
and then the 88 data name is used in used in an if statement to test the
data.
Q.
Give an example of how you would code an 88 level?
A:
02 Input Location Picture 9(3).
88 Valid-Locations Values are 100,200 thru 299
Q.
How could 88levels be used to determine the next step in navigating
through a program?
A.
The 88-level data name can be used to specify a condition in both if and
evaluate statements.
IF Valid-Locations
Perform Para-A
End-if

Q.
A:

Evaluate true
When Valid Locations
Perform Para-A
When other
Perform Para-B
End Evaluate
What does the COBOL CANCEL statement do/?
The CANCEL statement ensures that the next time the referenced subprogram is called it will be entered in its original state.

Q.
A:

What is the LINKAGE SECTION in COBOL?


The LINKAGE SECTION of a called program defines the data that is
available (from a calling program) to a called program.

Q.
A.

What is packed decimal?


It is a method of storing numbers in less space .The zone is eliminated
from each of the digits except for the last digit, which contains the sign for
the number. Packed decimals are always stored in an even number of
bytes and the last byte is always the sign .The number of bytes used is

determined by adding 1 to the total bytes requested and dividing by 2.


The answer is always is an even number.
Q.
How would the number +1234 be stored if a PIC clause of PIC S9 (4)
COMP-3 were used?

A.
The answer will use 3 bytes (4+1)/(5/2)=2.5 or 30, so a leading 0 will pad the answer :
01234F.
Q.
What are binary numbers?
A. Binary numbers are strings of 0s and 1s, which are stored in half word, full
word, or double word, depending on the size of the number.
Up to 4 digits are stored in 2 bytes or a half word.
5-9 digits are stored in 4bytes or a word.
10-18 digits are stored in 8 bytes or a double word
Q.
A.

What will be the result of executing a VS COBOL II program when a


subscript exceeds the table limit?
The table data overwrites the program code and will continue to do so
until there is an abend. The abend message will reference gibberish code
rather than a subscript out of range.

Q.

What will be the result of executing a VS COBOL II program that was


compiled with the SSRANGE option when a subscript exceeds the table
limit?

A.

The program will terminate.

14. What happens when you open an empty VSAM file in a COBOL program for
input?
A VSAM file that has never contained a record is treated as unavailable. Attempting to
open for input will fail. An empty file can be opened for output only. When you open for
output, COBOL will write a dummy record to the file & then delete it out.
15. How do you initialize a VSAM file before any operation? a VSAM with
alternate index?
Can write a dummy program that just opens the file for output & then closes it.
16. What does a file status of 02 on a VSAM indicate?
Duplicate alternate key . Happens on both input and output operation
17. How do you calculate record size of an alternate cluster? Give your values
for both unique and non-unique.
Unique Case: 5 + ( alt-key-length + primary-key )
Nonunique Case: 5 + ( alt-key-length + n * primary-key )
where n = # of duplicate records for the alternate key

????Any one who knows - can you explain ?


18. What is the difference between sequential files and ESDS files?
Sequential(QSAM) files can be created on tape while ESDS files cannot.
Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.
19. How do you load a VSAM data set with records ?
Using the REPRO command.
20. How do you define a GDG ?
Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another
dataset must be defined whose DCB parameters are used when new generations of the
GDG are created. This dataset is known as the model dataset. The ds name of this model
dataset must be the same as that of the GDG, so use a disp of keep rather than catlg
and also specify space=(trk,0)
21. Do all versions of the GDG have to be of the same record length ?
No, the DCB of the model dataset can be overridden when you allocate new versions.
22. How are different versions of GDG named ?
base-file-name.GnnnnnV00 where nnnn= generation number (upto 255).
nnnn will be 0000 for the 1st generation.
23. Suppose 3 generations of a GDG exist. How would you reference the 1 st
generation in the JCL?
Use GDG name(-2).
24. Suppose a generation of GDG gets created in a particular step of a proc.
How would you refer the current generation in a subsequent step? What would
be the disposition of this generation now?
Relative generation numbers are updated only at the end of the job, not at the end of a
step. To allocate a new generation, we would be using (+1) with a DISP of
(NEW,CATLG,DELETE). To refer to this in a subsequent step in the same job, we would
again use (+1) but with a DISP of SHR or OLD.
25. What more info you should give in the DD statement while defining the next
generation of a GDG?
Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can
give the dcb parameter if you want to override the dcb of the model dataset.

26. Assuming that the DEFINE jcl is not available, how do you get info about a
VSAM files organisation ?
Use the LISTCAT command.
27. During processing of a VSAM file, some system error occurs and it is
subsequently unusable . What do you do ?
Run VERIFY.

NOTES
Compare JCL:
//SUPERC EXEC PGM=ISRSUPC,
//
PARM=(DELTAL,LINECMP,
//
'',
//
'')
//NEWDD DD DSN=BST.TEST.SOURCE(BSTS010),DISP=SHR
//OLDDD DD DSN=BST.PROD.SOURCE(BSTS010),DISP=SHR
//OUTDD DD DSN=BST.TEST.COMPARE(BSTS010),
//
DISP=(NEW,CATLG),UNIT=SYSDA,
//
SPACE=(13566,(50,100,5)),
//
DCB=(BLKSIZE=13566)
//SYSIN DD *
CMPCOLM 7:72
/*

Searching Multiple Strings in Batch:


//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=BST.PROD.SOURCES,DISP=SHR
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'VERIZON'
SRCHFOR 'EDS'
/*

To copy the content of all the members in a PDS to a PS File


//WAY1 EXEC PGM=IEBPTPCH
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=BST.PROD.UTILS
//SYSIN DD *
PUNCH TYPORG=PO,MAXFLDS=1
RECORD FIELD=(80)
//SYSUT2 DD DSN=BST.PROD.UTILS.PS,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,20))
//*
//WAY2 EXEC SAS
//PDSIN DD DISP=SHR,DSN=BST.PROD.SOURCE
//PDSFLAT DD DSN=BST.PROD.SOURCE.PS,
// DISP=(,CATLG),SPACE=(CYL,(1,10),RLSE),
// DCB=(LRECL=80,RECFM=FB)
//SYSIN DD *
PROC SOURCE INDD=PDSIN OUTDD=PDSFLAT PAGE;
BEFORE ' START MEMBER=XXXXXXXX' 15;
AFTER ' END OF MEMBER';
RUN;
/*

To find out how many initiators are available and what are the classes they can handle?

Type DI (Display Initiator) in SDSF listing panel.


Type SORT CLASSES
How to execute the job at remote node?
Code the JES2 control statement /*ROUTE XEQ remote-node or /*XEQ remote-node
Simple Program
CBL LIST
IDENTIFICATION DIVISION.
PROGRAM-ID.SANSOFT.
*
ENVIRONMENT DIVISION.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-VARIABLES.
05 WS-EMP-NAME
PIC X(10).
05 WS-EMP-AGE
PIC 9(02).
05 WS-EMP-CITY
PIC X(10).
05 WS-EMP-SAL
PIC S9(08).
05 WS-EMP-BONUS
PIC S9(08).
05 WS-EMP-CTC
PIC S9(08).
*
PROCEDURE DIVISION.
*
MOVE 'MUTHU'
TO WS-EMP-NAME
MOVE 29
TO WS-EMP-AGE
MOVE 'TRICHY'
TO WS-EMP-CITY
MOVE 60000
TO WS-EMP-SAL
COMPUTE WS-EMP-CTC = (WS-EMP-SAL * 12)
DISPLAY 'SANSOFT COMPLETED'
DISPLAY 'EMPLOYEE DETAIL:' WS-EMP-NAME
WS-EMP-AGE
WS-EMP-CITY
WS-EMP-SAL
WS-EMP-CTC
STOP RUN.

+ WS-EMP-BONUS
','
','
','
','

The program is compiled with LIST option to get assembler listing.


On successful compilation, the program is submitted with the JCL.
The program is abended and the sysout says:
CEE3207S The system detected a data exception (System Completion Code=0C7).
From compile unit SANSOFT at entry point SANSOFT at compile unit offset
+0000036A at entry offset +0000036A
at address 2790117A.

The instruction at the Offset 36A is failed. So look into the compilation listing for the
statement that is in the offset 36A.

000021 MOVE
000358 D207 2016 A0BD
000022 COMPUTE
00035E F247 D0F8 201E

MVC

22(8,2),189(10)

(BLW=0)+22

PGMLIT AT +185

PACK

248(5,13),30(8,2)

TS2=0

WS-EMP-BONUS

000364 D20F
00036A FA54
000370 940F
000374 F844
00037A F374
000023 DISPLAY

D0E8
D0F2
D0F3
D0F3
2026

A08D
D0F8
D0F3
D0F3

MVC
AP
NI
ZAP
UNPK

232(16,13),141(10)
242(6,13),248(5,13)
243(13),X'0F'
243(5,13),243(5,13)
38(8,2),243(5,13)

TS1=0
TS1=10
TS1=11
TS1=11
WS-EMP-CTC

PGMLIT AT +137
TS2=0
TS1=11
TS1=11

35E-37F belongs to the COMPUTE statement that is in line 000022.


Now look for line 00022 in compilation listing.
000021

000022
BONUS
000023

MOVE

60000

TO WS-EMP-SAL

COMPUTE WS-EMP-CTC = (WS-EMP-SAL * 12) + WS-EMPDISPLAY 'SANSOFT COMPLETED'

So one of this field referred in this statement has junk in it. Just before compute we
populated WS-EMP-SAL and so there is a problem with WS-EMP-BONUS. If you go thru
the code, you will find the developer missed to populate/initialize WS-EMP-BONUS and
that has caused data exception.
If these fields are from file, we cannot easily confirm like above. So we have to give
display for these two fields in the program and rerun the program or look for junks in the
source file for these two fields using FILE AID/ INSYNC.
If you know how to read dump, then you get the values of these fields from dump. How?
Look into the data division map in the compilation list for these two fileds.
0Source
Hierarchy and
Base
Hex-Displacement Asmblr
Data
Data Def
LineID
Data Name
Locator
Blk
Structure
Definition
Data Type
Attributes
2 PROGRAM-ID SANSOFT---------------------------------------------------------*
8
1 WS-VARIABLES. . . . . . BLW=00000 000
DS 0CL46
Group
9
2 WS-EMP-NAME . . . . . BLW=00000 000
0 000 000
DS 10C
Display
10
2 WS-EMP-AGE. . . . . . BLW=00000 00A
0 000 00A
DS 2C
Disp-Num
11
2 WS-EMP-CITY . . . . . BLW=00000 00C
0 000 00C
DS 10C
Display
12
2 WS-EMP-SAL. . . . . . BLW=00000 016
0 000 016
DS 8C
Disp-Num
13
2 WS-EMP-BONUS. . . . . BLW=00000 01E
0 000 01E
DS 8C
Disp-Num
14
2 WS-EMP-CTC. . . . . . BLW=00000 026
0 000 026
DS 8C
Disp-Num

WS-EMP-SAL is in BLW-0 offset 16 whereas WS-EMP-BONUS in offset 01E.


In the dump, look for working-storage dump. BLW-0 maps to 279890B8 address.
WS-EMP-NAME is hex value of D4E4E3C8E44040404040 which is nothing but
MUTHU
. Similarly WS-EMP-AGE is 29 , WS-EMP-CITY is TRICHY WS-EMP-SAL is
00060000 and WS-EMP-BONUS and WS-EMP-CTS are low-values. WS-EMP-BONUS with low
values (without proper packed format) participated in arithmetic operation. Note that
packed decimal is expected to have sign in the last nibble.
WORKING-STORAGE for SANSOFT
BLW-0: 279890B8
+000000 279890B8

D4E4E3C8
C8E84040
|MUTHU
+000020 279890D8 00000000
00000000

E4404040 4040F2F9 E3D9C9C3


4040F0F0 F0F6F0F0 F0C00000
29TRICHY
0006000...|
00000000 00000000 00000000
00000000 00000000 00000000

|................................|

So if there are million records in a file and during the processing it abended after
n number of records, to identify the record caused problem, read the dump for the file
section unique variable(s) values and look for the respective record in the file and
analyse/correct/delete.
We have taken offset directly from sysout. If it is not available, then refer the
PSW. Based on AMODE 24/31, the last 24/31 bits contain the next sequential instruction
to be executed. From this value, subtract the entry point of the program being abended
and that will give you offset. One instruction above this offset is the one that caused the
abend. Entry point of all the programs executed be found in trace back or save trace
section of the dump. You can directly found the offset in the traceback also. (last 31 bits
of A7901180 is 27901180, 27901180-27900E10 = 370 is the offset, from the
compilation listing one instruction just before 370 is 36A.)
PSW..... 078D1000 A7901180
Traceback:
DSA Addr
0001D120
0001D018

Program Unit
CEEHDSP
SANSOFT

Statement

PU Addr
057780F0
27900E10

PU Offset
+00003C34
+0000036A

Load Mod

Service

Status

CEEPLPKA
SANSOFT

UK00165

Call
Exception

Entry
CEEHDSP
SANSOFT

E Addr
057780F0
27900E10

E Offset
+00003C34
+0000036A

HCL Technologies offers world class technology solutions for the emerging network centric world.
It provides a range of technology and software engineering services including Technology
Development Services, Software Engineering Services, Application Engineering Services,
Networking Services .
These services are predicated on a rich technology heritage. Experience with the development
and application of technologies like Internet and E-Commerce, Embedded software, Networking
and telecom protocols, VLSI design etc.
Skills on a wide variety of computing platforms from Open Systems to Enterprise Servers based
on mainframes expertise, object oriented and legacy system architecture, methodologies in
addition to distinguished R&D background uniquely positions us as a preferred provider of
technology and software engineering services in the emerging network centric world.
HCL Technologies has established dedicated offshore software factories with clients such as
Bankers Trust (Australia), Lexis Nexis (US) , Southern California Edison (US), A Networking
Major (US)
HCL Technologies operates through 29 offices in 14 countries in United States, Europe, Japan,
Asia Pacific
The company employs 3300 IT professionals worldwide.
HCL Technologies holds 100% stake in Intelicent (former HCL James Martin Inc.), a US based
methodology consulting led Services Company. The company also has a 100% subsidiary in
India, HCL Comnet Systems and Services Ltd, which provides networking services.

You might also like