Mainframe Q
Mainframe Q
Question: answer to anon question for difference between next and continue clause
Answer: FOR ANON, Dear friends the difference between the next and continues verb is that in
the continue verb it is used for a situation where there in no eof condition that is the records are
to be accessed again and again in an file , whereas in the next verb the indexed file is accessed
sequentially ,hence when index class is accessed sequentially read next record command is
used hope that is satisfactory
Question: What is the Importance of GLOBAL clause According to new standards of COBOL
Answer: When any data name, file-name, Record-name, condition name or Index defined in an
Including Program can be referenced by a directly or indirectly in an included program, Provided
the said name has been declared to be a global name by GLOBAL Format of Global Clause is
01 data-1 pic 9(5) IS GLOBAL.
Question: What is Local Storage section in COBOL & what is its purpose?
Answer: I don’t know.
Question: what is the difference between search and search all in the table handling?
Answer: search is a linear search and search all is a binary search.
Question: What is the maximum length of a field you can define using COMP-3?
Answer: 10 Bytes (S9(18) COMP-3).
Question: What will happen if you code GO BACK instead of STOP RUN in a stand alone
COBOL program i.e. a program which is not calling any other program.
Answer: The program will go in an infinite loop.
Question: What is the difference between a DYNAMIC and STATIC call in COBOL.
Answer: To correct an earlier answer:All called modules cannot run standalone if they require
program varibles passed to them via the LINKAGE section. DYNAMICally called modules are
those that are not bound with the calling program at link edit time (IEWL for IBM) and so are
loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC
calling of a module the DYNAM compiler option must be choosen, else the linkage editor will
not generate an executable as it will expect ull address resolution of all called modules. A
STATICally called module is one that is bound with the calling module at link edit, and therefore
becomes part of the executable load module.
Question: read the following code. 01 ws-n pic 9(2) value zero. a-para move 5 to ws-n. perform
b-para ws-n times.b-para. move 10 to ws-n.how many times will b-para be executed ?
Answer: 5 times only. it will not take the value 10 that is initialized in the loop.
Question: What is the difference between SEARCH and SEARCH ALL? What is more
efficient?
Answer: SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a
binary search, continually dividing the table in two halves until a match is found. SEARCH ALL
is more efficient for tables larger than 70 items.
Question: What care has to be taken to force program to execute above 16 Meg line?
Answer: Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should
never have SIZE(MAX).BUFSIZE can be 2K, efficient enough.
Question: Why do we code s9(4)comp. Inspite of knowing comp-3 will occupy less space.
Answer: Here s9(4)comp is small integer ,so two words equal to i byte so totally it will occupy 2
bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and
sign will occupy 1/2 byte so totally it will occupy 3 bytes.
Question: The maximum number of dimensions that an array can have in COBOL-85 is
________.
Answer: SEVEN in COBOL - 85 and THREE in COBOL - 84
Question: What is the LINKAGE SECTION used for?
Answer: The linkage section is used to pass data from one program to another program or to
pass data from a PROC to a program.
Topic: JCL.
Question: What does the statements: typrun=scan and typrun=hold do in a JCL statement
Answer: typrun=scan checks the JCL for errors, typrun=hold holds the job until further notice.
Question: Which of the following is Online transaction? CICS, DB2 and JCl
Answer: CICS
Question: which is the most widely used batch performance monitor for DB2?
Answer: DB2PM
Question: GDG?
Answer: 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 gen.number, yy-version number. Can be sequential, direct, partitioned. (VSAM -
no). Must always be cataloged. Advantage - 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
Question: How much is memory space involved, when we code BLOCKSIZE,TRK & CYL
Answer: One block constitutes 32KB of formatted memory/ 42KB of Unformatted memory,6
blocks makes one Track & 15 Tracks makes one cylinder.
Question: On the DD statement, what is the main difference between creating a new sequential
flat file and a partitioned dataset?
Answer: 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.
Question: What is the difference between IEBGENER, IEBCOPY and REPRO in IDCAMS
utlity?
Answer: IEBGENER -- This is a dataset utility for copying sequential datasets which produces a
PDS or a member from a sequntial dataset.IEBCOPY -- This is a dataset utility for copying one
PDS to another or to merge PDSs.REPRO -- This is for copying sequential datasets. More or
less same as the IEBGENER.RAVI
Question: What is the difference betebeen static call & Dynamic call
Answer: In the case of Static call, the called program is a stand alog program, it is an executable
program . During run time we can call it in our called program. As about Dynamic call , the called
program is not an executable program it can executed thru the called program
Question: What is the difference between catalouge procedure and In-Stream procedure?
Answer: In Stream procedures are set of JCL statements written between JOB and EXEC
statements, start with PROC and end with PEND statement.Mainly used to test cataloge
procedures. Cataloged procedure is cataloged on the procedure library and is called by
specifying the procedure name on the EXEC statement.
.
Question: What do you feel makes a good program?
Answer: a program that follows a top down approach. It is also one that other programmers or
users can follow logically and is easy to read and understand.
Question: What are the maximum and minimum sizes of any CONTROL AREA (VSAM
datasets) ?
Answer: Minimum Size : 1 trackMaximum size : 1 cylinder
Question: How many parameters are there to a DISP statement and what are thier uses.
Answer: 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).
Question: What are three major types of JCL statements? What are their functions?
Answer: JOB, EXEC, DD. JOB - indicates start of jobstream to the operating system and
through parms coded on it, certain details about the job (time, region, message level, job
accounting data). EXEC - indicates the start of execution of a particular job step, be that step a
program or a proc.DD - is a data definition, which is used to describe the attributes of a data set
(name, unit, type, space, disposition).
TOPIC: CICS
Question: The error code aeiv?
Answer: this is the error code for length,if length of the source data is more than the receiving
field,this error will occur. this is the correct answer,previously i mentioned it as program id
error.sorry for the wrong information.
Question: In SYMBOLIC Cursor Positioning after moving -1 to the length field also the cursor
is not positioned in that particular field.Give reasons?
Answer: You have to explicitly specify the word CURSOR between your EXEC CICS and
END-EXEC in the program.
Question: I just wanted to add something to the answer given byBrian on June 25, 1998
Question: What command do you issue to delete a record in a transient data queue ? Answer:
READQ TD, the read is destructive. Yes it is correct but there is a restriction.U can deletethe
records sequentially.. For example if one want to delete 10 th record directly it is not possible
with this..
Answer: Answer: READQ TD, the read is destructive. Yes it is correct but there is a
restriction.U can deletethe records sequentially.. For example if one want to delete 10 th record
directly it is not possible with this..
Question: I just wanted to add something to the answer given byBrian on June 25, 1998
Question: What command do you issue to delete a record in a transient data queue ? Answer:
READQ TD, the read is destructive. Yes it is correct but there is a restriction.U can deletethe
records sequentially.. For example if one want to delete 10 th record directly it is not possible
with this..
Answer: Answer: READQ TD, the read is destructive. Yes it is correct but there is a
restriction.U can deletethe records sequentially.. For example if one want to delete 10 th record
directly it is not possible with this..
Question: What command do you issue to delete a record in a transient data queue ?
Answer: READQ TD, the read is destructive.
Question: What is the difference between CICS Program Control Table (PCT) and CICS
Processing Program Table (PPT) ?
Answer: PCT contains a list of valid transaction ID. Each transaction ID is paired with the name
of the program ,CICS will load and execute when the transaction is invoked. On the other hand,
PPT indicates each program's location which pertains to a storage address if the program has
already been loaded or a disk location if the program hasn't been loaded. PPT will also be used
to determine whether it will load a new copy of the program when the transaction is invoked.
Question: What is the difference between a physical BMS mapset and a logical BMS mapset?
Answer: The physical mapset is a load module used to map the data to the screen at execution
time. The symbolic map is the actual copybook member used in the program to reference the
input and output fields on the screen.
Question: WHAT DO YOU USE TO PASS DATA FROM ONE PROGRAM TO ANOTHER?
Answer: DFHCOMMAREA,TEMPORARY STORAGE, TRANSIENT DATA, TCTUA, TWA,
CWA, VSAM FILES
Question: What CICS facilities can you use to save data between the transactions?
Answer: COMMONAREA, TSQ & TDQ.
Question: How would you release control of the record in a READ for UPDATE?
Answer: By issuing a REWRITE,DELETE, or UNLOCK command or by ending the task.
Question: How would you release control of the record in a READ for UPDATE?
Answer: By issuing a REWRITE,DELETE, or UNLOCK command or by ending the task.
Question: What is the difference between a RETURN with TRANSID and XCTL ?For example
prog. A is issuing REUTRN with TRANSID to prog B. Prog A. is issuing XCTL to prog B.
Answer: In RETURN with TRANSID the control goes to the CICS region and the user have to
transfer the control to prog. B by pressing any of the AID KEYS.In XCTL the control is directly
transfer to prog. B.
Question: What is the maximum number of exceptions that can be specified with a single
HANDLE CONDITION command in CICS ?
Answer: SIXTEEN (16)
Question: WHAT WILL BE THE LENGTH OF THE EIBCALEN ,IF THE TRANSACTION IS
USED TO CICS FIRST TIME?
Answer: THE LENGTH WILL BE 0(ZERO).
Question: What is the difference between the XCTL and LINK commands?
Answer: The LINK command anticipates return of control to the calling program, theXCTL
command does not. Return to the calling program will be the result of the CICS RETURN
command, specifying TRANSID(name of the calling program).
Question: What CICS command would you use to read a VSAM KSDS sequentially in ascending
order?
Answer: First issue a STARTBR(start browse), which will position the browse at the desired
record. Retrieve records by using subsequent READNEXT commands. Indicate the end of
sequential processing with the ENDBR command. If the generic key is specified in the
STARTBR command positioning in the file will be before the first record satisfying the generic
key.For reading in descending order use the READPREV instead ofREADNEXT.
TOPIC: DB2
Question: How many Bufferpools are there in DB2 and what are they?
Answer: There are 4 Bufferpools.They are BP0,BP1,BP2 and BP32.
Question: how do you filter out the rows retrieved from a Db2 table ?
Answer: one way is to use The Sql WHERE clause.
Question: what's the equivalent Cobol Data type for Decimal(x,y) in DB2? what does the current
SQLID register contain?
Answer: Pic s9(x-y)V9(Y) Comp-3; the current SQLID contains the current authorization ID.
Question: When Can you be sure that a query will return only one row?
Answer: When you use the primary key and only the primary key in the where clause.
Question: CAN ALL USERS HAVE THE PRIVILAGE TO USE THE SQL STATEMENT
SELECT * (DML)?
Answer: NO THE USER SHOULD BE GRANTED PRIVILAGE TO USE IT.
Question: what's the best locksize that you could use when you create a tablespace?
Answer: The answer is Locksize = ANY.Unless you are Sure what's the Purpose of tablespace
ie.,Read-only or R/W.If you use lock size =any, Db2 would automatically determine what type of
locks it should use.
Question: Can you define an Index if the table size less than 10 PAGES?
Answer: the Answer is : NO
Question: What's the Maximum Length of SQLCA and what's the content of SQLCABC?
Answer: The Max length is 136. and the SQLCABC has the Value of SQLCA.
Question: Can you define an Index if the table size less than 10 PAGES?
Answer: The answer is
Question: What's the maximum number of volumes that can be added to a STOGROUP?
Answer: The answer is 133.Usually it will be difficult monitor more than 3 or 4 volumes to a
Stogroup.
Question: What's the maximum number of characters that a tablename can have?
Answer: The answer is 18 characters.
Question: when does the sql statement gets executed when you use cursor in the application
programming ?
Answer: sql statement gets executed when we open cursor
Question: What is the difference between TYPE 1 index & TYPE 2 index
Answer: TYPE 1 & TYPE 2 are specified when an index is created on the table. TYPE 2 index is
the option which comes with DB2V4. With TYPE 2 index data can be retreived faster as only the
data pages are locked and not the index pages. Hence TYPE 2 index is recommended.
Question: How do you achieve record locking in DB2 in the versions which donot support record
level locking?
Answer: Y'day I had posted this que. The answer shud hv read as follows:By having the record
length more than half of the page size !Sorry again& Thanx
Question: How do u achieve record level locking in DB2 versions when record level locking is
not allowed?
Answer: By having the length of the record greater than that of a page!
Question: What does DML stand for and what are some examples of it?
Answer: Data Manipulation Language. Some examples are SELECT, INSERT, DELETE,
REPLACE.
Question: How to define the dataitems to receive the fetch items for the SQL?
Answer: Using the DSECT, followed by lines of - 'dataitems DS datatype'.
Question: Re:How will you delete duplicate records from a table?
Answer: Delete From Table1Where Id In (Select Id From Tabel1 As Temp Group By Id Having
Count(*) >1)
Question: How do you declare a host variable (in COBOL) for an attribute named EMP-NAME
of type VARCHAR(25) ?
Answer: 01 EMP-GRP. 49 E-LEN PIC S9(4) COMP. 49 E-NAME PIC X(25).
Question: What is the maximum number of tables that can be stored on a Partitioned Table
Space ?
Answer: ONE
Question: what are the max. & min. no. of partitions allowed in a partition tablespace?
Answer: minimum is 4.maximum is 64.
Question: What technique is used to retrieve data from more than one table in a single SQL
statement?
Answer: The Join statement combines data from more that two tables
TOPIC: VSAM
Question: What is an alternet index and path ?
Answer: An alternet index is an another way of accessing key sequenced data record stored in a
base cluster and path is the linkage which connect alternet index to its base cluster.
Question: How many buffers are alloted to VSAM KSDS and ESDS?
Answer: Ans:2 data buffers by default for ESDS.for KSDS it allots 2 data buffers and 1 index
buffers. each buffer is about 4k.
Question: If fspc(100 100) is specified does it mean that both the control interval and control
area will be left empty because 100 % of both ci and ca are specified to be empty?
Answer: no,they would not be left empty.one record will be written in each ci and 1 ci will be
written for each ca.
MVS
Question: what are the major component of mvs?
Answer: 1.JOB MANAGEMENT,2.TASK MANAGEMENT,3.DATA MANAGEMENT
4.STORAGE MANAGEMENT,5.RESOURCE MANAGEMENT,6.RECOVERY
TERMINATION MANAGEMENT,7.SYSTEM APPLICATION ARCHITECTURE.
Topic: PL/1
Question: What are the reserved words in PL/1?
Answer: There are no reserved words in PL/1. IF IF=3 THEN DO=6; It is a perfectly valid
statement. Only in 48character set PL/1 there are reserved words.
Topic: MVS
Question: I ask this question Every one that i interview.What do you mean by a ADDRESS
SPACE?
Answer: A address Space is the amount of Virtual Storage Seen by the Job. 2 GB for MVS/XA
and MVS/ESA.TSO for On-Line Users.batch Jobs execute in an Intiator Address Space
Topic: TSO/ISPF
Question: What are the maximum number of extents that are allowed in secondary space
allocation?
Answer: Only once
Topic: TSO/ISPF
Question: What is the directory block size in option 3.2?
Answer: It deceides how many members you want to have under one pds. One directory block
can contain 5 members