Cobol,Jcl,Db2 related Interview Qns
How to identify a file declared in Source (cobal pmg only) is a VSAM file (ESDS.) or not.
AS(Address Sequential ) as to prefixed to the logical name
Eg :: select File1 assign to AS-FILE11
Check the FD section :: we declare ORGANISATION IS SEQUENTIAL/INDEXED/ RANDOM
File status code (23 eof)
How do create VSAM files
Using IDCAMS / File Aid / Workbench (these tools internally uses idcams)
How do u identify a file to be created is ESDS/KSDS/RRDS – by looking at Cluster create statements .
ESDS will have :: Data and Cluster Datasets
KSDS will have :: Index,Data and Cluster Datasets
RSDS will have :: Data and Cluster Datasets
Other Important Point is in Cluster Declaration, we declare Index, Non-Indexed
and Numbered for KSDS/ESDS/RRDS
How do u identify whether VSAM file is Fixed or VB.
If Record Size (F,F) -- > fixed, if Recordsixe (F,V) -- > Variable
How do you identify the dataset is VSAM dataset or not by looking at the Job.
Check the DCB parameter, for DSORG parameter
DSORG = PS (seq.dataset)
PO ( Partitioned dataset)
ESDS (esds vsame dataset)
KSDS (ksds vsame dataset)
RRDS (rrds vsame dataset)
How do u copy records from 50 to 70 from a file having 100 records (for various vsam files).
Use Repro with ESDS :: From (address) To (address)
KSDS :: From (Index key) To (Index Key)
RRDS :: From (Number) To (Number)
LSDS :: Skip (nn), count(nn)
How do u declare a Variable file in Cobol -- check roy and datidar
Eg :: FD File1
Record Contains 10 to 1000 characters
WS-Rec-MIN PIC X(10).
01 WS-Rec-Max PIC X(1000)
how do u declare LRECL in JCL for Variable file.
For above file lrcel = 1004 (i.e., 4 bytes additional to actual size of file)
When do use Optional file – while declaring a file and where do u mention this.
We use this in IO-section,
The job will run even when the file is available or not.
Eg : :: select File1 assign to AS-FILE11
File1 is Optional
When do we use Extend Mode for the seq file,
This mobe is used to append the data. Usually it is used to record history.
Can cobol pgm can be coded without FD section ?
Yes.
Eg : Usually most of the subprograms or stored procedures will not have FD section
D in 7th column of cobol program
This is used in the program for debugging mode
SOC4 :: trying to read a will which is not opened or index/subscript out of range (it basically happens while trying to access the data)
SOC7 :: Dataismatch (will give the statement of the process statement. (like IF ws-n > 0) or airthamatic statements or statemts involves evaluation etc.,) Note :: Move statement is root cause for SOC7 error Resolution :: a) get the error statemnt no. from the sysout of run-jcl b) search for the statement no. in sysprint of Compile jcl log -- this will give you the approxmate statement caused soc7 error, c) Find for the variable with comp3 in above statement, and find the cause using by displaying respective variables or using Expdeter
Pls write the jcl to run main program which has a subroutine?
Main Pgm::
Select INFILE-MAIN assign to MAINFL
SUB Pgm ::
Select INFILE-SUB assign to SUBFL
JCL ::
//job
//step exec PGM=MAINPGM
//MAINFL DD DSN=a.b.main
//SUBFL DD DSN = a.b.subp
What is implicit and Explicit Commit
Explicit commit is coded by the programmer, as and when specified commit point is reached data is commited, this is done to minimize the data loss in case of abends.
Implicit Commit is taken care by the system on successful/unsuccessful execution.
I have 200 versions of a GDG, how to include all the versions in a single step.
Use the GDG base, It will include all the versions (including the one created in above step)
In step1 I have created a version with +1, how do crete 2nd version in next step
Give it at (+2)
Now I want to use the file created in step to in step 3, how do u refer that
Give it as (+2) as we are in same Job
How to Pass return Code / data to JCL from COBOL
We can pass only two bytes of data from cobol to JCL using the RETURN-CODE.
Eg : Move 04 to RETURN-CODE. This return code will override the actual return code of previous step.
which file is required, to expedit(debug a program thru expeditor) a program
Its DDIO (RRDS ) file (to generate this file pgm has to be compiled with Exped=y option)
Comments
Mainframe Interview Questions and Answers
http://www.aired.in/2010/01/mainframe-interview-question-answers.html
For real time scenario based Mainframe interview questions,please refer
WWW.MAINFRAMEINTERVIEW.COM