VSAM Tutorials ,VSAM KSDS EXAMPLES,IBM's MVS, OS/390

This Page contains VSAM Tutorials, VSAM Tips , VSAM Manuals

VSAM is a file system used in IBM's MVS, OS/390 and ZOS operating systems.
It offers standard sequential files, key Sequential and indexed files. In VSAM ,
Files can be read sequentially as well as randomly.

IBM Mainframe Tutorials - JCL DB2 COBOL CICS

Here you can find
  • Links to JCL Tutorials, DB2 tutorials, SQL tutorials, COBOL tutorials, VSAM tutorials, XPEDITER tutorials, FILE-AID tutorials.
  • Links to DB2 Inteview Questions, COBOL Interview questions, JCL interview questions, CICS interview questions, VSAM interview questions.
  • You can also find links to IBMMAINFRAME Forums, COBOL forums, DB2 forums, CICS forums, VSAM forums, REXX forums, JCL forums, DFSORT forums, ICETOOL forums, EASYTRIEVE forums, IMS DB forums, IMS DC forums, XML forums, Mainframe Jobs forums, Interview questions forums.

COBOL TALLYING / BEFORE INTIAL / AFTER INITIAL statements

Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?We have different type of Inspect verb
1.counting INSPECT.
2.replacing INSPECT.
3.combined INSPECT.
4.converting INSPECT.
Give example of any Inspect verb which you know. 


INSPECT word TALLYING count FOR LEADING “L” BEFORE INITIAL “A”, count-1 FOR
LEADING “A” BEFORE INITIAL “L”.
Where word = LARGE, count = 1 and count-1 = 0.
Where word = ANALYST, count = 0 and count-1 = 1.
INSPECT word TALLYING count FOR ALL “L”, REPLACING LEADING “A” BY “E” AFTER
INITIAL “L”.
Nucleus
7830 7709–000 2–103
Where word = CALLAR, count = 2 and word = CALLER.
Where word = SALAMI, count = 1 and word = SALEMI.
Where word = LATTER, count = 1 and word = LETTER.
INSPECT word REPLACING ALL “A” BY “G” BEFORE INITIAL “X”.
Where word = ARXAX, word = GRXAX.
Where word = HANDAX, word = HGNDGX.
INSPECT word TALLYING count FOR CHARACTERS AFTER INITIAL “J” REPLACING ALL “A”
BY “B”.
Where word = ADJECTIVE, count = 6 and word = BDJECTIVE.
Where word = JACK, count = 3 and word = JBCK.
Where word = JUJMAB, count = 5 and word = JUJMBB.
INSPECT word REPLACING ALL “X” BY “Y”, “B” BY “Z”, “W” BY “Q” AFTER INITIAL
“R”.
Where word = RXXBQWY, word = RYYZQQY.
Where word = YZACDWBR, word = YZACDWZR.
Where word = RAWRXEB, word = RAQRYEZ.
INSPECT word REPLACING CHARACTERS BY “B” BEFORE INITIAL “A”.
word before: 1 2 X Z A B C D
word after: B B B B B A B C D

How COBOL FLAT files(Index,Sequential) are very secure for huge data?If not, How will you migrate with any Database with Frond end COBOL?

How COBOL FLAT files(Index,Sequential) are very secure for huge data?If not, How will you migrate with any Database with Frond end COBOL?

Well if you are using flat file you have advantage as well as disadvantages.
Advantage -It is Secure Physically edited.
Disadvantage - Logically speaking performance is slow difficult to find the particular record.

Give simple program example for Dynamic link and Dynamic call in COBOL?

Static Call In Cobol:

Is calling of a literal.

CALL 'ABC' USING ARGUMENTS

The call statement specifies the sub-routine called as a literal. i.e, within quotes 'ABC'.
In static calls, if ABC is modified and recompiled, then all the executables calling ABC should be relinked.

Dynamic Calls:

01 Sub-Routine pic x(8) value 'ABC'

CALL ABC USING ARGUMENTS

Dynamic calling invovles calling a sub-routine using a variable and the variable contains the sub-routine name.
here the complied code is loaded when needed and is not incorporated into the executable.

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. 

In exec statement the condition is used for by-passing the perticular step through the condition
if COND 0 Its a successfull execution
if COND 4 Its a warning
if COND 8 Its a serious error
if COND 16 Its a fatal error.
So that we can use this condition key word.

JCL -MCQ Comparison Operators

MCQ Comparison Operators
 In what order does the system evaluate comparison operators?

The operators and their precedence order from highest to lowest are:
  • Navigation operator ( . )
  • Arithmetic operators in precedence order:
    • + - unary
    • * / multiply divide
    • + - add subtract
  • Comparison operators: > < > < <>(not equal)
  • Logical operator NOT
  • Logical operator AND
  • Logical operator OR

What are the four divisions in COBOL

In Cobol there are 4 divisions.

1. Identification division or ID divisionIn this no setions are there. It has 5 paragraphs.
a. Progaram-id. programname
b. Author
c. Writen-date
d. Compiled-date
e. Installer

2. Environment Division
Under this there are two sub-sections
a. Configuration-section.
Source compter.
Object computer.
b. Input-Output section.
File control.
IO control.

3. Data DivisionFile-section.
Working-storage section.
Linkage section.
Report section.
Screen section.

4. Procedure Division

Coding RECFM=F over RECFM=FB

Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?

01 my_string pic x(30) value 'mainframeinterviews'.we can have operations on the string like inspect my_string tallying tally_ct for all e before intial s and after intial i.inspect my_string replacing all e by r before intal s and after intial

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc? 
An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 

Answer:
1. Internal sort is used in COBOL application prog while external sort is used in JCL.

2. Internal sort uses workfiles while external sort uses the DFSORT mechanism.

3. External sort is more complicated than internal sort.

4. Internal sort is more flexible as we can alter or update data beforeƂ  and after performing internal sort whereas the same doesn't hold true for external sort.

IBM Mainframes : COBOL Interview Questions and Answers

File Concept 
The Disposition Parameter in the JCL is Share ( DISP=SHR ) and Cobol program opens file in " Extend " mode. In this scenarion what will happen to that file?

If we open file in xtend mode then old data will not lose we append the new data without losing old data.

IBM Mainframes: COBOL Interview Questions,

INSEPCT 
Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?
01 my_string pic x(30) value 'mainframeinterviews'.
we can have operations on the string like
inspect my_string tallying tally_ct for all e before intial s and after intial i.
inspect my_string replacing all e by r before intal s and after intial i.

IBM Mainframes Interiew Questions and Answers-COBOL Interview Questions

Question:what will happen if i give program name and member name as 
different? program runs successful or w'll abend?
 Answer: 
The program will be compiled successfully and the load willbe created with the member name only. 
So, no issues withprogram name and member name being different.

(a)//COMPILE.SYSIN  DD  DSN=OZA093.SUNIL.COBO1(DATE),DISP=SHR
(b)//LKED.SYSLMOD   DD
DSN=OZA093.SUNIL.LOADLIB(DATE),DISP=SHR    

here (a) is for compilation.and (b) is for
execution.i.e.loadmodule of our program. after compilation
of our program.the compiler will generate an object code to
our program. this only going to be executed..what ever u
give at 
LOADLIB(DATE)..this name (for my program loadmodule name is
date) should be specified at 
//step  exec pgm=loadmodulename.(here date)