Skip to main content

Interview Questions @ EMphasis

Cobol,Jcl,Db2 related Interview Qns

  1. How to identify a file declared in Source (cobal pmg only) is a VSAM file (ESDS.) or not.

    1. AS(Address Sequential ) as to prefixed to the logical name

      1. Eg :: select File1 assign to AS-FILE11

    2. Check the FD section :: we declare ORGANISATION IS SEQUENTIAL/INDEXED/ RANDOM

    3. File status code (23 eof)

  1. How do create VSAM files

    1. Using IDCAMS / File Aid / Workbench (these tools internally uses idcams)

  1. How do u identify a file to be created is ESDS/KSDS/RRDS – by looking at Cluster create statements .

    1. ESDS will have :: Data and Cluster Datasets

    2. KSDS will have :: Index,Data and Cluster Datasets

    3. 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


  1. How do u identify whether VSAM file is Fixed or VB.

    1. If Record Size (F,F) -- > fixed, if Recordsixe (F,V) -- > Variable


  1. How do you identify the dataset is VSAM dataset or not by looking at the Job.

    1. 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)


  1. How do u copy records from 50 to 70 from a file having 100 records (for various vsam files).

    1. Use Repro with ESDS :: From (address) To (address)

    2. KSDS :: From (Index key) To (Index Key)

    3. RRDS :: From (Number) To (Number)

    4. LSDS :: Skip (nn), count(nn)


  1. How do u declare a Variable file in Cobol -- check roy and datidar

    1. Eg :: FD File1

Record Contains 10 to 1000 characters

        1. WS-Rec-MIN PIC X(10).

        2. 01 WS-Rec-Max PIC X(1000)


  1. how do u declare LRECL in JCL for Variable file.

    1. For above file lrcel = 1004 (i.e., 4 bytes additional to actual size of file)


  1. When do use Optional file – while declaring a file and where do u mention this.

    1. We use this in IO-section,

    2. The job will run even when the file is available or not.

Eg : :: select File1 assign to AS-FILE11

File1 is Optional


  1. When do we use Extend Mode for the seq file,

    1. This mobe is used to append the data. Usually it is used to record history.


  1. Can cobol pgm can be coded without FD section ?

    1. Yes.

    2. Eg : Usually most of the subprograms or stored procedures will not have FD section


  1. D in 7th column of cobol program

    1. This is used in the program for debugging mode


  1. 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)


  1. 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


  1. 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



  1. What is implicit and Explicit Commit

    1. 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.

    2. Implicit Commit is taken care by the system on successful/unsuccessful execution.


  1. I have 200 versions of a GDG, how to include all the versions in a single step.

    1. Use the GDG base, It will include all the versions (including the one created in above step)


  1. In step1 I have created a version with +1, how do crete 2nd version in next step

    1. Give it at (+2)


  1. Now I want to use the file created in step to in step 3, how do u refer that

    1. Give it as (+2) as we are in same Job


  1. How to Pass return Code / data to JCL from COBOL

    1. We can pass only two bytes of data from cobol to JCL using the RETURN-CODE.

    2. Eg : Move 04 to RETURN-CODE. This return code will override the actual return code of previous step.

  1. which file is required, to expedit(debug a program thru expeditor) a program

    1. Its DDIO (RRDS ) file (to generate this file pgm has to be compiled with Exped=y option)

Comments

Anonymous said…
Thanks for the post.Please visit the site for
Mainframe Interview Questions and Answers

http://www.aired.in/2010/01/mainframe-interview-question-answers.html
Unknown said…
Good list of questions,
For real time scenario based Mainframe interview questions,please refer
WWW.MAINFRAMEINTERVIEW.COM

Popular posts from this blog

Mainframe Written test @ Accenture

1. What r the 2 function we can get by using INSPECT verb? (c) A. file handling, error handling B. opening a file, closing a file. C. char counting, replacing. D. none of the above 2. Indicate which of the following is not true about the formal parameters in a subroutine? (c) A. every formal parameter must appear in the linkage section of the subroutine B. every formal parameter must appear in the using phrase of the procedure division header of the subroutine C. A formal parameter name can appear more than once in the using phrases of the procedure division header of the subroutine. D. A formal parameter can not be declared with value clause in a subroutine 3. What is the value of A? (B) 01 A pic 9(3). Move 100 to A. Perform 1000-para thru 1000-exit. Display the value of a=A Stop run. 1000-para. If A=100 Perform 1000-exit Else Move 150 to A End-if. Move 200 to A. 1000-exit. Exit. a.100 b.200 c.150 d. none of the above is correct. 4. What is the value of B? (A) Move 1 to A Evaluate tr

How to Solve SOC7 Abend - with screen shots

Below process helps to find out the statement, caused the SOC7 error. Check the Sysout of RUNJCL . This shows the error statement and lists offset value Take the Offset Value 000003C0 Got to respective Compilation Job listing, check the sysprint Search for the offset value 0003C0 (delete +00 -- initial 3 letters of Offset value and search for it) check below 2 screen shots This Offset value is listed under line no 0045 – which refers to Move statement. Take this no. 045 and find for it in same sysprint. This points to the exact statement, caused SOC7 T his 045 pints to the Move statement 1526, this is the exact line in the program Check for the above line no. In source program . This points to the statement highlighted below . Check the statement, variable check-4, which is added to check-6. These are having different Picture clause. check-4 is alfhanumaric, holding some junk data, when this data is moved to Chcek-6 variable(of comp-3) creates SOC7 error. This is just an example to e

NULL VALUES and NULL INDICATORS in DB2

In DB2, the columns defined as NULL needs to be handled carefully else it will throw null exception error, in order to over come this error data type can be handled by using null indicator . NULL is stored using a special one-byte null indicator that is "attached" to every nullable column. If the column is set to NULL, then the indicator field is used to record this. Using NULL will never save space in a DB2 database design - in fact, it will always add an extra byte for every column that can be NULL. The byte is used whether or not the column is actually set to NULL. The indicator variable is transparent to an end user Consider below Table : Create Table SAMP_TAB SN CHAR (10) SNAME CHAR (10) STATUS CHAR (2) NOT NULL BY DEFAULT CITY CHAR (10) NOT NULL Note :: Unless you specify NOT NULL, the default is to allow for NULL In above table SN and SNAME columns holds null values by default, in order to handle these null variables we need to have NULL-INDICATORS declares in the Pro