Tips For Mainframe Programmers
Tips For Mainframe Programmers
Compiled by
Rijo Joseph
Page 1 of 104
CONTENTS
...............................................................................................4
1 . INTRODUCTION TO MAINFRAMES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
H ARDWARE CONFIGURATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...........5
M ICRO
COMPUTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........7
M INI
COMPUTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.............7
M AINFRAME CONFIGURATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........8
T HE SYSTEM /360-370
FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
M ULTIPROCESSING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...............10
HANNELS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................10
...11
R/SM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................11
I NPUT/OUTPUT
DEVICES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
A PPLICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.................15
.17
M VS CONCEPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.................20
A DDRESS SPACES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................20
PAGING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...................22
E XPANDED STORAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...............22
WAPPING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................22
T HE MVS
SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.......23
2 . COBOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 5
R EDEFINES
CLAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....25
R ENAMES CLAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................26
U SAGE
CLAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........27
U SAGE IS
DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......27
C OMP AND COMP-3
FIELDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 8
U SAGE IS COMP-
1...............................................................................................
28
U SAGE IS COMP-
2...............................................................................................
28
U SAGE IS COMP-
3...............................................................................................
29
..30
ALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1
CLAUSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2
........33
.....34
CALLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5
S tatic CALLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................35
D ynamic
CALLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.........36
TECHNIQUES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 8
I NDEXES Vs SUBSCRIPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...........40
..............................................................................................41
3 . COMPILER OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2
A WO Or NOAWO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................42
S SRANGE Or NOSSRANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
............43
...........43
........44
D YNAM Or
NODYNAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....44
R ENT Or NORENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................45
Page 2 of 104
A LL31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................45
C HECK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....................45
..............................................................................................46
4 . JCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 6
..47
A llocating a
PDSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....47
B atch
Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........47
T SO/E
Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.........48
I SPF Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................48
............50
D eleting PDSE
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
.....50
EBCOPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................51
PDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1
..........52
............53
.....54
Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5
I EBGENER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................55
S ample IEBGENER
JCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6
..............................................................................................59
5 . DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 0
N ULL
INDICATOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..........60
BRM: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...................60
P LAN: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....................60
S YNONYM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................60
IEWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................60
A RE THE VIEWS
UPDATABLE ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1
PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1
.............62
physically? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2
function? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2
ONLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3
............63
.................................................................................................
.......................65
UNSTATS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................66
I
MAGECOPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................66
..........66
Q MF (Query Management
Facility) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 7
M ore on
FORMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.........70
6 . IMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4
.........74
BD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....................75
SB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................75
TYPES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 6
.......76
.....76
76
Page 3 of 104
.................................................................................................
.......................77
ROCOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...................78
..............................................................................................79
7 . TSO ISPF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0
H RECALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................80
T SO
SEND/TRANSMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.........80
DATASET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0
COMMANDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0
T APE
DATASET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...........80
FILE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0
N O SPACE IN
DIRECTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
80
(ISPF). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0
C REATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....................81
R EPLACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.....................81
C UT AND
PASTE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
........82
I SPF EDITOR COMMANDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
............83
A UTOCOMPLETE
FEATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4
N RETRIEV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
....................84
C OBOL COMPILER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
................84
LAYOUTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4
T APE DATASET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.................85
D ASD
DATASET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...........86
........87
.............87
D FD Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...................89
........90
An
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...............93
9 . COMMON ABENDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4
J CL error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...................94
S 322 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 806 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 913 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 878 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 522 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 0C4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 013 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 722 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 0C7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
......................94
S 0C7 Abend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..................94
Page 4 of 104
1. INTRODUCTION TO MAINFRAMES
1) Micro Computers
2) Mini Computers
3) Mainframe Computers
These divisions are loosely based on the size of the computer systems
HARDWARE CONFIGURATIONS
· Processors
· I/O Devices
Although all computer systems consists of these basic components, the way those
components are combined for a particular computer system varies depending on the
system’s requirements.
Page 5 of 104
Device
Controllers
Terminals Printers
Disks
Page 6 of 104
MICRO COMPUTERS
Small, single user systems that provide a simple processor and just a few input/output
devices.
This category is termed micro because the CPU was created on a single chip
· Servers
MINI COMPUTERS
Also known as Mid-Range computers were first developed as special purpose mainframe
computers. They were used, for instance to control machines in a manufacturing unit.
Faster than the microcomputer with access to more storage space and more input and
output devices. The minicomputer is used when large groups need access to data
simultaneously. The minicomputer can do this because the hardware is designed for
plugging in more devices and the CPU and the support chips are designed for this kind of
work
For example, large super markets around the world need to have their cash register send
sales information to the same computer (so that the data is collected at one place)
Mini computers are used by medium sized business. They are also used in factories to
built the popular VAX minicomputer. IBM also creates a very popular mini computer
range with a branding of the AS/400. HP has a popular mini computer range branded
HP9000
Page 7 of 104
Unlike Micro computers, most mini computers provide more than one terminal so that
several people can use the system at one time. A system like this is called a multi user
system
MAINFRAME CONFIGURATIONS
Mainframe computers can process several million program instructions per second. Large
organizations rely on these room size systems to handle large programs with lots of data.
systems, etc
Mainframes have even more access to storage space and to input/output devices. To work
with these extra devices, mainframes also have more powerful processors. This power is
useful and required by large corporations who have large amounts of data to process.
Consider the example of a large international bank that has millions of customer accounts
require very powerful machines to process this data. These large banks would have a
mainframe maintain their customer account records so that the customer can turn-up at
Characteristics
Page 8 of 104
The most popular family of mainframe computers ever is the System/360-370 family,
……….
The figure shows the basic arrangement of the subcomponents that make up a typical
System/370 type processor. As you can see, the processor consists of 3 main parts: CPU,
The CPU contains the circuitry needed to execute program instructions that manipulate
data stored in main storage. Although the figure doesn’t show it, most System/370
processors use a special purpose high speed memory buffer called a cache that operates
between the CPU and Main Memory. This relatively small amount of storage operates at
Page 9 of 104
CPU
MAIN
STORAGE
speeds even faster than the storage in main memory, so the overall speed of the processor
is increased
Special circuitry constantly monitors access to main memory and keeps the most
MULTIPROCESSING
To understand what a multiprocessor does, let us focus on the term single processor. A
single processor or uniprocessor contains its own main storage and is controlled by a
single OS. A Multiprocessor, on the other hand, can share system resources and work.
For example, while one of the processors initiates an I/O operation, another processor can
CHANNELS
The purpose of a channel is to provide a path between the processor and an I/O device. In
the above figure, there are 7 channels. As a result, there are 7 different paths along which
data can pass between the processor and I/O device. Each channel can connect up to 8
devices called control units that connect to I/O devices. As a result, the processor in the
above figure can connect up to 56 control units. Depending on the processor and the
device, a control unit may be housed within the processor’s cabinet, the I/O device’s
The basic channel design of the System/370 requires that I/O devices to be connected to
channels using heavy copper cables that can no longer than 400 feet in length. These
channels use a parallel architecture which means that the cable transmits all of the bits
that make up a byte simultaneously. To do that, the cable must have a separate wire for
each bit – Sixteen in all (the channel sends two bytes simultaneously) - Plus additional
wires for control signals. The result is that parallel channel cable is both heavy and
expensive.
In 1990, IBM announced a new channel architecture, called ESCON (Enterprise System
Connection), which is based on fiber optic rather than copper table. Fiber optic cable is
not only 80 times lighter than copper table, but also 50 times less bulky. ESCON will
allow many data centers to replace literally tons of unmanageable copper cable with
neatly organized fiber optic cable. Besides its reduced size and weight, ESCON provides
two other advantages. First it extends the 400-feet cable limit of standard channels to 26
miles. This lets installations locate disk devices on another floor or even in another
Page 10 of 104
building. Second, ESCON channels are nearly 4 times as fast as standard channels,
In the new S/390 systems, a new channel architecture – S/390 Fiber Connectivity
(FICON) – provides a new high performance I/O channel, optimized for efficiency at
high speed.
CHANNELS
4381 1 OR 2 4 - 64 MB
18
3084 4 32 - 128 MB
48
3090 6 64 - 512 MB
128
ES/9000 4 - 8 2048 MB
256
S/390 G5/G6 4 - 12 1 - 32 GB
256
e-Server zSseries
990 (latest in z
series)
32 16GB – 256GB
1024(ESCON),
240 (FICON)
· Most of these values are ranges or numbers because the processors come in a
At one time, multiprocessor configurations were considered exotic, and the facilities for
advantage of multiple processors, but it didn’t provide all of the controls needed to take
To address this problem, current IBM multiprocessors include a feature called Processor
CPU processor into several partitions, or LPARs, each of which can function as an
for a primary partition. If the primary partition fails, the backup partition can
automatically take over the work that was being processed at the time of the failure.
Page 11 of 104
PR/SM also allows the I/O channels assigned to the various partitions to be reconfigured
INPUT/OUTPUT DEVICES
I/O devices are the devices that connect to a processor to provide it with input, receive
Card Devices and Printers. The name Unit record device implies that each record
processed by the device is a physical unit. URDs usually have built in control
units that attach directly to channels, so separate control units are not required
Card Devices
· Card Readers
· Card Punches
· Reader/Punches
Printers
to paper
depends on the length of the tape and the density used to record the data. Density
is a measurement of how many bytes are recorded in one inch of tape. Tape
densities for standard reel tapes are usually 1600 or 6250 bpi. Data records are
normally written to tape in groups called blocks. Empty spaces called gaps are
required to separate blocks from one another. The larger the block, the less the
amount of wasted space on a tape. However there is an extra cost involved when
blocking is used: a buffer is required in main storage to contain the entire block.
As a result, the larger the block, the more main storage that is required to contain
it
· Direct Access Device: The official IBM term for a disk drive is DASD. Because it
allows direct and rapid access to large quantities of data. Data is recorded on the
usable surfaces of a disk pack in concentric circles called tracks. The number of
tracks per surface varies with each device type. The component that reads and
writes data on the tracks of a disk pack is called the actuator. The actuator has one
read/write head for each recording surface. When the actuator moves, all of its
heads move together so they are all positioned at the same track of each recording
surface. As a result the disk drive can access data on all of those tracks without
Page 12 of 104
moving the actuator. The tracks that are positioned under the heads of the actuator
at one time make up a cylinder. As a result, there are as many tracks in a cylinder
as there are usable surfaces on the pack, and there as many cylinders in a pack as
there are tracks on a surface. So a pack that has 19 surfaces, each with 808 tracks
IBM manufactures two basic types of disk drives Count-Key-Data (CKD) devices
Each type of DASD devices requires two kinds of control units to attach it to a
processor channel. The first called a string controller, attaches a group of DASDs
of the same type: the resulting group is called a string. The second kind of control
channel
Special circuitry keeps track of what disk data is accessed most frequently and
tries to keep this data in the cache storage. Then, when that data is referenced, it
can be read directly from cache, the DASD unit doesn’t have to be accessed at all
Page 13 of 104
at the computer site) and remote terminals (terminals that are not at the computer
Page 14 of 104
STORAGE CONTROL
Communication Controller
Modem Modem
Modem Modem
Telecommunication
Lines
Terminal
Controller
Terminal
Controller
Printer Printer
T1
T2
T3
T1
T2
T3
Terminals
Terminals
Channel
Connections
At the center of the network is the host system, a System/370 processor. The control unit
manages the communications functions necessary to connect remote terminal system via
APPLICATIONS
microcomputers to do ‘what-if’ analysis, make decisions etc. Each branch may have a
mini computer to support a variety of needs for the individual branch. And the bank may
have a centralized mainframe computer that supports all the banks branches providing for
an even broader range of needs. In other words, the bank uses micro computers for
and mainframe computer at the corporate level. Mainframe at the branch headquarters
performs all the consolidated accounting functions and is responsible for processing both
transactions through the bank’s network of automatic teller machines (ATM) and credit
card transactions.
Page 15 of 104
Page 16 of 104
Mainframe
Terminals
Terminals
· VIRTUAL STORAGE
In most computer systems, the processor’s main storage is among the most
operating systems provide sophisticated services to make the best use of the
available main storage. Among the most important of these services include
virtual storage
storage that is larger than the actual amount of real storage. To do this, the
The key to understanding virtual storage is realizing that at any given moment,
only the current program instruction and the data it accesses need to be in real
storage. Other data and instructions can be placed temporarily on disk storage,
and recalled into main storage when needed. In other words, virtual storage
Operating Systems transfer data and instructions between real storage and disk
· MULTIPROGRAMMING
Multiprogramming means simply that the computer lets more than one program
execute at the same time. Actually, that is misleading; at any given moment, only
one program can have control of the CPU. A multiprogramming system appears
operations – like reading data from an input device – take much longer than
others. As a result, most programs that run on mainframe computers are idle a
large percentage of the time, waiting for I/O operations to complete. If programs
were run one at a time on a mainframe computer, the CPU would spend most of
its time waiting. Multiprogramming simply reclaims the CPU during these idle
· SPOOLING
sharing access to input and output devices for the programs that execute together.
One way to avoid this problem is to give one of the programs complete control of
Page 17 of 104
disk device instead. Then, when the program finishes, the operating system
Another benefit of spooling is that programs can execute faster. That is because;
disk devices are much faster than printers. The OS component that actually prints
the spooled output is multi programmed along with the application programs, so
the printer is kept as busy as possible. But the application programs themselves
are not slowed down by the relatively slow operation of the printer
· BATCH PROCESSING
When you use batch processing, your work is processed in units called jobs. A job
may cause one or more programs to execute in sequence. For example, one job
may invoke the programs necessary to update a file of employee records, print a
One of the problems that arises when batch processing is used is managing how
work flow through the system. In a typical mainframe computer system, many
users compete to use the system’s resources. To manage this, the Job Entry
· TIME SHARING
In a time sharing system, each user has access to the system through a terminal
device. Instead of submitting jobs that are schedules for later execution, the user
sometimes called interactive processing, because it lets users interact directly with
Page 18 of 104
Page 19 of 104
Communications Controller
3880
Storage
Controller
For Direct access storage, the configuration above uses three strings of 3390 model 1
DASDs, each containing 8 drives. Since each 3390 model 1 has a capacity of 946 MB,
the total DASD capacity of this system is about 22 billion bytes. 3390 are fixed-media
DASDs; their disk packs can’t be removed. To provide a way to create backup copies of
data on the 3390s, a string of four tape drives is used
The 4 operator consoles let system operators control the operation of the system. Some of
the consoles might be dedicated to specific tasks, such as managing the tape drives or
A local 3270 system, directly attached to the 4381 processor, provide 12 terminals and
one printer. This terminals are used by the programming staffs, who are based in the
The 3725 communications controller allows remote 3270 systems to access the system
MVS CONCEPTS
MVS stands for multiple virtual storage. Under MVS, the concepts of virtual storage and
Virtual Storage is a facility that simulates a large amount of main storage by treating
DASD storage as an extension or real storage. In other words when virtual storage is
used, the processor appears to have more storage than it actually does.
Multiprogramming is a facility that lets two or more programs use the processor at the
same time. The key to understanding multiprogramming is realizing that most programs
spend most of their time waiting for I/O operations to complete. So while one program
waits for an I/O operation, the CPU can execute instructions for another program.
ADDRESS SPACES
Main storage consists of millions of individual storage locations, each of which can store
address that indicates the storage location’s offset from the beginning of the memory.
An Address space is simply the complete range of addresses – and as a result, the number
of storage locations – that can be accessed by the computer. The maximum size of a
computer’s address space is limited by the number of digits that can be used to represent
an address. To illustrate, suppose a computer records its addresses using six decimal
digits, such a computer could access storage with addresses from 0 to 999,999
Page 20 of 104
The original System/370 processors used 24 bit binary numbers to represent addresses.
Since the largest number that can be represented in 24 bits is abut 16 million (16 M), an
address space on a System/370 can’t contain more than 16M bytes of storage. Because
this 16 MB address space limitation severely restricted the capabilities of the System/370,
IBM replaced it in the early 1980s with a new architecture known as 370-XA. 370-XA
processors can operate in 370 mode using standard 24 bit addresses or in XA, or
Extended Architecture, mode using 31-bit addresses, in XA mode, the largest address that
can be represented – and therefore the largest address space that can be used – is about
2G.
In the late 1980s and early 1990s, IBM extended this architecture even further with the
introduction first of ESA/370, then ESA/390. These designs utilize the same 31 – bit
MVS/370 was designed to operate on System/370 processors that utilize 24-bit addresses,
and MVS/XA was designed to operate on 370-XA processors that use 31 – bit addresses.
MVS/ESA also uses 31-bit addresses, but runs only on ESA/370 and ESA/390
processors.
Whether it interprets an address as 24 or 31 bit depends upon the setting of the addressing
mode bit in the current PSW at the time an instruction executes. Programs running in 24-
bit addressing mode can access the first 16 MB of the virtual storage. MVS allows
program to switch from one mode to another during execution in order to access data or
call modules running in the other mode. Thus new programs can take advantage of 31 bit
addressing and still be compatible with ones written for 24 bit addresses.
All MVS programs have an addressing mode (AMODE) attribute that indicates which
addressing mode is to take effect when a module is given control. The AMODE attribute
MVS modules have a residence mode (RMODE) attribute that indicates whether they
must be loaded below the 16 MB address line or can be loaded anywhere in the virtual
storage. RMODE = 24 modules require residency below 16 MB. RMODE = ANY allows
A program that must be directly addressable by 24 bit callers must reside below the 16
MB line. A program that doesn’t have 24 bit callers, or whose 24 bit callers call it
indirectly, can reside anywhere. The RMODE attribute is assigned as input to the
Page 21 of 104
PAGING
To allow the parts of a program in virtual storage to move between real and auxiliary
storage, MVS breaks real storage, virtual storage and auxiliary storage into blocks. The
A page, a frame and a slot are all of the same size; each consists of 4KB. An active
virtual storage page resides in a real storage frame; a virtual storage page that becomes
MVS divides virtual storage into 4K sections called pages. Data is transferred between
real and DASD storage one page at a time. As a result, real storage is divided into 4K
sections called page frames, each of which can hold one page of virtual storage.
Similarly, the DASD area used for virtual storage, called a page data set, is divided into
When a program refers to a storage location that is not in real storage, a page fault occurs.
When that happens, MVS locates the page that contains the needed data on DASD and
transfers it into real storage. That operation is called a page-in. In some cases, the new
page can overlay data in a real storage page frame. In other cases, data in a page frame
has to be moved to a page data set to make room for the new page. That is called a pageout.
Either way, the process of bringing a new page into real storage is called paging.
EXPANDED STORAGE
Most new System/370 processors include a special type of memory known as expanded
storage. Expanded storage improves the efficiency of virtual storage operations by acting
as a large buffer between real storage and the page data sets. Simply put, when a virtual
storage page must be paged out, the processor moves the page’s contents to expanded
storage. This transfer occurs at CPU speeds rather than at DASD speeds, so the operation
is almost instantaneous. Pages are written to the actual page data set only when expanded
storage becomes full. The amount of expanded storage on a processor varies depending
SWAPPING
In swapping, address spaces are moved from real storage to auxiliary storage and vice
versa. This has the effect of moving an entire address space into or out of real storage. It
is one of several methods MVS employs to balance the system workload as well as to
ensure that an adequate supply of available real storage frames is maintained. Address
Page 22 of 104
auxiliary storage slots. Address spaces that are swapped out are inactive; the address
space resides on auxiliary storage and can’t execute until it is swapped in. Swapping is
(SRM).
You can think of swapping as the same thing as paging, only at a higher level. Rather
than move small 4K pieces of virtual storage in an out of real storage, swapping
effectively moves entire address spaces in and out of virtual storage. Since paging occurs
only for address spaces that are currently in virtual storage, paging doesn’t occur for
· System Generation
When an installation purchases the MVS operating system, IBM sends the basic
libraries. System generation, only a part of the overall process of installing MVS
from the distribution libraries, selects and assembles the various components an
Page 23 of 104
Page
Data Sets
Swap
Data Sets
Real Storage
CPU
Add:
Space 1
(Swapp
ed in)
Add:
Space 2
(Swapp
ed in)
Add:
Space 3
(Swapp
ed in)
Add:
Space 4
(Swapp
ed out)
Add:
Space 5
(Swapp
ed out)
Add:
Space 6
(Swapp
ed out)
often called sysgen, a systems programmer codes special macro instructions that
specify how the MVS components from the distribution libraries should be put
together.
can generate a new one. This is because an existing MVS system is required to
version. So they can use their current version of MVS to execute the sysgen
For installations that do not already have an MVS system, the system installation
process includes setting up a small, limited function MVS system that can execute
The macro instructions a systems programmer codes for a sysgen fall generally
into two categories. The first category of macro instructions defines the system’s
hardware configuration... They are needed because MVS must know about every
I/O device that is attached to the system. As a result, whenever a new I/O device
is installed, the system must be generated again. MVS lets you do a smaller, less
time consuming type of sysgen called an iogen to change the I/O device
configuration.
the OS should be included. Like which Job Entry Subsystem, what optional
· System Initialization
Once an MVS OS has been generated, it can be used to control the operation of
the computer system. To begin a system initialization, the system operator uses
the system console to start an Initial Program Load or IPL. That causes the
computer system to clear its real storage and begin the process of loading MVS
Page 24 of 104
2. COBOL
REDEFINES CLAUSE
Sometimes, it may be found that two or more storage areas defined in the DATA
DIVISION are not in use simultaneously. In such cases only one storage area can serve
the purpose of two or more areas if the area is redefined. The REDEFINES clause allows
the same area to be referred to by more than one data name with different sizes and
pictures.
For example,
01 SALES-RECORD.
05 SALES-BY-UNIT.
05 TOTAL-SALES REDEFINES
SALES-BY-UNIT.
This example describes a sales record which may either contain the total amount of sales
The purpose of such description may be to have two types of records and their types may
Note that SALES-BY-UNIT & TOTAL-SALES refer to the same storage space. They
Syntax:
Rules
· When the 01 level is used, the size of data-name-1 must not exceed that of dataname-
· Multiple redefinitions are allowed. The entries giving the new descriptions must
Page 25 of 104
· In the case of multiple redefinitions, the data-name-2 must be the data name of the
· Entries giving new descriptions can't have the value clauses (except in the case of
condition-names(88))
· The REDEFINES clause must not be used for records (01 level) described in the
(COBOL 77 Standard)
According to COBOL - 85, a redefined data item can be equal or smaller in size than that
For example
05 DATA-B REDEFINES
DATA-A.
RENAMES CLAUSE
01 PAY-REC.
5 FIXED-PAY.
5 ADDITIONAL-PAY.
5 DEDUCTIONS.
66 PAY-OTHER-THAN-BASIC RENAMES
66 IT-AND-PF-DEDUCTIONS RENAMES
Page 26 of 104
overlaps on two original groups, namely, part of FIXED-PAY and the entire ADDITIONALPAY.
Such overlapping is allowed provided the elementary items are all contiguous. In a
similar way IT-AND-PF-DEDUCTIONS has two elementary items PF-DEDUCT and ITDEDUCT.
This new group is formed out of the original group DEDUCTIONS. Alternatively,
the same thing can also be done in the original group description by placing like this
..
5 DEDUCTIONS.
10 IT-AND-PF-DEDUCTIONS.
Syntax
Rules
· All RENAMES entries must be written only after the last record description entry
· The RENAMES clause must be used only with the special level number 66
description entry, nor can they be subordinate to an item that has an occurs clause
· Data-name-3, if mentioned, must follow data-name-2, in the record and must not
USAGE CLAUSE
Normally, a computer can store data in more than one internal form. In COBOL, a
programmer is allowed to specify the internal form of the data item so as to facilitate the
use of the data item more efficiently. Broadly, there are only two general forms of
internal representation – computational and display. Only numeric data items can be
can take part in arithmetic operations more efficiently. On the other hand, any data item
can be specified as display. This form is suitable for input/output and character
USAGE IS DISPLAY
This is the most common form of internal data. Each character of the data is represented
in one byte and a data item is stored in a couple of contiguous bytes. The number of bytes
Page 27 of 104
required is equal to the size of the data item. One can specify the usage as DISPLAY.
the computer actually does its computation. Usually this form is binary. Thus defining
A few notes to remember: while allocating the space, for COMP fields, the compiler will
allocate space in multiples of word, that is, it can be half word (2 bytes), full word or
So if the PIC specified is 9(1) COMP, 9(2) COMP, 9(3) COMP OR 9(4)
COMP, the space allocated by the compiler will be half word (2 bytes). This allocation
depends on the length of the maximum number that you can represent with this
specification.
That is if you specify 9(4), the max number that you can represent is 9999. This
number can be easily represented by 2 bytes. With 2 bytes you can represent up to
65535
If you specify 9(5) COMP, 9(6) COMP, 9(7) COMP OR 9(8) COMP, the
space allocated by the compiler will be one word (4 bytes). That is with 9(8), you can
represent a maximum of 99999999, this is possible with a word, and a word can
represent up to 4294967295
If you specify a PIC more than 9(8), it will allocate a double word (8 bytes).
USAGE IS COMP-1
If the usage of a numeric data item is specified as COMP-1, it will be represented in one
word (4 bytes) in the floating point form (single precision floating point form). Such
USAGE IS COMP-2
This usage is the same as COMP-1 except that the data is represented internally in two
words (8 bytes). The advantage is that this increases the precision of the data (double
Page 28 of 104
precision) which means that more significant digits can be available for the item. The PIC
USAGE IS COMP-3
COMP-3 enables the computer to store two digits in each storage position, except for the
rightmost position, which holds the sign. The sign is stored separately as the rightmost
The hexadecimal number C or F denotes a positive sign and the hexadecimal number D
Suppose if you move 1234567 into a field defined 9(7). In DISPLAY mode, which is
If you define the field with PIC 9(7) COMP-3, it will however use only four positions
12 34 56 7+
This usage stores data in the form in which the computer actually does its computation.
performed. The item must be an integer (no assumed decimal point is allowed).
A few notes to remember: while allocating the space, for COMP fields, the compiler will
allocate space in multiples of word, that is, it can be half word (2 bytes), full word or
So if the PIC specified is 9(1) COMP, 9(2) COMP, 9(3) COMP OR 9(4)
COMP, the space allocated by the compiler will be half word (2 bytes). This allocation
depends on the length of the maximum number that you can represent with this
specification.
That is if you specify 9(4), the max number that you can represent is 9999. This
number can be easily represented by 2 bytes. With 2 bytes you can represent up to
65535
If you specify 9(5) COMP, 9(6) COMP, 9(7) COMP OR 9(8) COMP, the
space allocated by the compiler will be one word (4 bytes). That is with 9(8), you can
represent a maximum of 99999999, this is possible with a word, and a word can
represent up to 4294967295
Page 29 of 104
If you specify a PIC more than 9(8), it will allocate a double word (8 bytes).
a) Properly DISPLAY
b) Nonnumeric or edited
c) A field associated with a unit record device or terminal (this means, you
a) A numeric field in a record input from a tape or disk file whether it was
already COMP
b) Numeric, is used in calculations, and is a field in a record to be output to a
tape or disk file from which it will later be input and used in further
computation
calculations
Evaluate is like a case statement and can be used to replace nested Ifs. The difference
between EVALUATE and case is that no ‘break’ is required for EVALUATE i.e. control
END-EVALUATE END-EVALUATE
END-EVALUATE END-EVALUATE
Page 30 of 104
During the execution of an EVALUATE statement, the values denoted by the list of
subjects (items in the EVALUATE statement) are compared with the values denoted by
the list of objects in a WHEN phrase to establish a “match” between the two.
· The value of a subject is compared with the value/range of values of the object in
· In the case of a single valued (numeric/non numeric) object, the subject – object
· When a range of values is specified for the object, the subject – object comparison
results in TRUE, if the value of the subject falls within the range
· In the case of conditional values, the subject – object comparison results in
TRUE, if both evaluate to the same value (that is if both are TRUE or both are
FALSE).
TRUE
· The list of subjects is said to “match” with the list of object, if all the
· Note that the values of the subjects need not be of the same class. For example
After the execution of one of the when clauses, the control is automatically passed on to
the next sentence after the EVALUATE statement. There is no need of any extra code.
SEARCH ALL is a binary search and the table must be sorted before using SEARCH
Binary Search is search on a sorted array. Compare the item to be searched with the item
at the center. If it matches, it stops the search else repeat the process with the left half or
descending order, then while defining the array, you should give DESCENDING KEY
Page 31 of 104
· Using DISPLAY data item to address a table is 450% slower than using
indexes!!!
· For a table with less than 50 entries, go for SEARCH (Sequential Search)
· For a table with more than 50 entries go for SEARCH ALL (Binary Search)
Packed Decimal
Using an odd number of digits for PACKED DECIMAL (COMP-3) is 5% to 20% faster
than using an even number of digits!
OR
Page 32 of 104
There is a big difference between NEXT SENTENCE & CONTINUE. Please refer the
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
PARA1.
PERFORM PARA2.
STOP RUN.
PARA2.
IF SAMPLE = 'AB'
NEXT SENTENCE
ELSE
END-IF
IF SAMPLE2 = 'CD'
ELSE
NEXT SENTENCE
END-IF
.
In this case, we may assume that ‘SAMPLE 2 IS CD’ will get displayed but since
SAMPLE is ‘AB’, NEXT SENTENCE will get executed and this will transfer control
to the statement following the period so the program will move to STOP RUN. ENDIF
won’t act here as a statement terminator. SYSOUT will be empty in this case.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
PARA1.
Page 33 of 104
PERFORM PARA2.
STOP RUN.
PARA2.
IF SAMPLE = 'AB'
IF SAMPLE3 = 'EF'
NEXT SENTENCE
END-IF
ELSE
END-IF
IF SAMPLE2 = 'CD'
ELSE
NEXT SENTENCE
END-IF
CONTINUE will transfer control to the end of the statement that contains ‘CONTINUE’
(remember, end of the statement may not be a period). So, for the following program
WORKING-STORAGE SECTION.
01 SAMPLE PIC X(2) VALUE 'AB'.
PROCEDURE DIVISION.
PARA1.
PERFORM PARA2.
STOP RUN.
PARA2.
IF SAMPLE = 'AB'
CONTINUE
ELSE
END-IF
IF SAMPLE2 = 'CD'
ELSE
CONTINUE
END-IF
Page 34 of 104
2) For variable or undefined length files, how long the next record will be if there is
one.
You WRITE RECORD because you know in advance the answer to both of the above
questions.
Keep in mind as you read this that some compilers let you set options that will override
the calling mechanisms shown below. Therefore, even if your program is coded to call a
program statically, the compiler can convert it to the dynamic form of CALL if you set
(or don't set) the correct compiler options. Such compiler options are discussed at the end
of this document.
Static CALLs
The static form of the CALL statement specifies the name of the subroutine as a literal;
e.g., it is in quotes.
This is the static form of a subroutine call. The compiler generates object code for this
which will cause the linker to copy the object module a.obj into your executable when it
is linked.
So, if you modify "A" and recompile it, you must also relink all of the executables that
call "A", because the each of the executables contains its own copy of "A".
· Fewer files are needed to distribute your application because your application can
be built into a single EXE file, or perhaps an EXE for your main, and a couple of
Page 35 of 104
· You must relink all of the EXE and DLL files in your application that use a
statically linked subroutine in order to use the newer version of the subroutine.
· If your application contains DLLs that call a subroutine statically, each DLL will
have its own copy of the subroutine, including the storage defined in the
· If your application has multiple DLLs that use the same statically named
subroutine, each DLL has its own copy of that subroutine and its storage.
Therefore, if you set a value in the subroutine in one of the DLLs, it's local to that
DLL. The copy linked to the other DLLs will not know about this. This can be
either a Good Thing or a Bad Thing, of course, but it's definitely a trap for the
unwary.
Dynamic CALLs
...
The dynamic form of the CALL statement specifies the name of the subroutine using a
The difference is that the name of the subroutine is found in the variable SUBROUTINEA.
The compiled code will cause the operating system to load the subroutine when it
Note that you can also load a module dynamically by including it in a DLL and then
Page 36 of 104
· You don't need to relink your application if you change something in your
· All executables that call this subroutine will share the same DLL; both the code
and data. Since your application only loads one copy of a dynamically called
available to all the DLLs that use it, because they all share the same copy of the
subroutine.
· Every dynamically called subroutine must be linked as a DLL (unless you use an
· It's possible to mix versions of your DLLs. This can be a problem both with
· If one of your DLLs is missing, you may not know about it until the user
exercises some facility that tries to call that DLL. At that point, your application
· If you CALL a DLL, CANCEL it, then CALL it again, you incur more I/O
because the routine needs to be reloaded if you CANCEL it. This can slow down
an application because it requires more disk activity
· If you mix and match static and dynamic calls to the same subroutine, your
software might have several different versions in memory at once. Guess how
Static subroutines are nice, because your application can be built into a single EXE file,
or perhaps an EXE for your main, and a couple of DLLs for subordinate modules.
Page 37 of 104
Dynamic subroutines are nice because you can manage memory differently and you can
update a portion of your application by shipping a newer DLL instead of the entire
application.
You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link
edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL
A statically called subroutine will not be in its initial state the next time it is called unless
you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will
Data Types
Using the proper data types is an important factor in determining the performance
When using binary (COMP) data items, the use of the SYNCHRONIZED clause
specifies that the binary data items will be properly aligned on half word, full
word or double word boundaries. This may enhance the performance of certain
operations on some machines. Additionally, using signed data items with eight or
fewer digits produces the best code for binary items. The following shows the
performance considerations (from most efficient to least efficient) for the number
of digits of precision for signed binary data items (using PICTURE S9(n) COMP)
· n is from 1 to 8
possible
· n is from 10 to 17
· n is 9
Full word values are converted to double word format and then double
· n is 18
Double word values are converted to a higher precision format and then
arithmetic is done using this higher precision (this is the slowest of all four
Page 38 of 104
When using PACKED DECIMAL (COMP-3) data items in computations use 15 or fewer
digits in the picture specification to avoid the use of library routines for multiplication
and division. A call to the library routine is expensive compared to the calculation in-line.
Additionally, using a signed data item with an odd number of digits produces more
efficient code since this uses an integral multiple of bytes in storage for the data item
Using an odd number of digits is 6% faster than using the next lower even number of
digits.
Using the fewest odd number of digits as possible may result in an additional 5% to 15%
characteristics of them before you use them. Shown below are some performance
considerations of doing several ADDs and SUBTRACTs on the various data types of the
specified precision.
Page 39 of 104
decimal
Data Conversions
operations when mixed data types are involved in the computation. This results in
additional processing time and storage for these conversions. In order to minimize
followed.
DISPLAY
Avoid using USAGE DISPLAY data items for computations (especially in areas
that are heavily used for computation). When a USAGE DISPLAY data item is
used, additional overhead is required to convert the data item to the proper type
both before and after the computation. In some cases, the conversion is done by a
call to a library routine, which can be expensive compared to using the proper
Using indexes to address a table is more efficient than using subscripts since the index
already contains the displacement from the start of the table and does not have to be
calculated at run time. Subscripts on the other hand contain an occurrence number that
must be converted to a displacement value at run time before it can be used. When using
subscripts to address a table, use a binary signed data item with eight or fewer digits (for
Page 40 of 104
example, using PICTURE S9(8) COMP) for the data item). This will allow full word
arithmetic to be used during the calculations. Additionally in some cases, using four or
fewer digits for the data item may also offer some added reduction in CPU time since half
Using binary data items (COMP) to address a table is 56% slower than using indexes
Using decimal data items (COMP-3) to address a table is 426% slower than using indexes
Using DISPLAY data items to address a table is 680% slower than using indexes
Page 41 of 104
3. COMPILER OPTIONS
AWO Or NOAWO
The AWO compiler option causes the APPLY WRITE ONLY clause to be in
effect for all physical sequential, variable length, blocked files, even if the
APPLY WRITE ONLY clause is not specified in the program. With APPLY
WRITE ONLY in effect, the file buffer is written to the output device when there
is not enough space in the buffer for the next record. Without APPLY WRITE
ONLY, the file buffer is written to the output device when there is not enough
space in the buffer for the maximum size record. If the application has a large
variation in the size of records to be written, using APPLY WRITE ONLY can
result in a performance savings since this will generally result in fewer calls to
One program using variable length files and AWO was 10% faster than NOAWO
To assist in the optimization of the code, you should use the OPTIMIZE compiler
option. With the OPTIMIZE (STD) or OPTIMIZE (FULL) options in effect, you
may receive optimizations that include
Additionally with the OPTIMIZE (FULL) option in effect, you may also receive
these optimizations
· Deleting unreferenced data items and the associated code to initialize their
VALUE clauses
Page 42 of 104
program since code is not moved. NOOPTIMIZE is required when using the
requires more CPU times for compiles than NOOPTIMIZE, but generally
produces more efficient run time code. For production runs, OPTIMIZE is
recommended.
SSRANGE Or NOSSRANGE
Using SSRANGE generates additional code, to verify that all subscripts, indexes
and reference modification expressions are within the proper bounds. This inline
degradation at run time. In general if you need to verify the subscripts only a few
times in the application instead of at every reference, coding your own checks
may be faster than using the SSRANGE option. For performance sensitive
When using the TRUNC(BIN) compiler option, all binary (COMP) sending fields
are treated as half word, full word or double word values, depending on the
PICTURE clause, and code is generated to truncate all binary receiving fields to
the corresponding half word, full word or double word boundary (base 2
truncation). This can add significant amount of degradation since typically some
data conversion must be done, which may require the use of some library
routines. BIN is usually the slowest of the three sub options for TRUNC.
When using the TRUNC(STD) compiler option, the final or intermediate result of
to the number of digits in the PICTURE clause of the binary (COMP) receiving
field (base 10 truncation). This too can add significant amount of degradation
number of digits in the PICTURE clause) and the remainder is used. A divide
Page 43 of 104
With TRUNC(OPT), the compiler assumes that the data conforms to the
PICTURE and USAGE specifications and manipulates the result based on the size
Using the NUMPROC(PFD) compiler option generates significantly more efficient code
for numeric comparisons. It also avoids the generation of extra code that
and DISPLAY numeric data items to ensure a correct sign is being used. With
NUMPROC(NOPFD), sign fix-up processing is done for all references to these numeric
data items. With NUMPROC(MIG), sign fix-up processing is done only for receiving
fields (and not for sending fields) of arithmetic and move statements
With NUMPROC(PFD), the compiler assumes that the data has the correct sign and
optimization. However not all external data files contain the proper sign for COMP-3 or
DISPLAY signed numeric data, and hence using NUMPROC(PFD) may not be
DYNAM Or NODYNAM
The DYNAM compiler option specifies that all subprograms invoked through the
CALL literal statement will be loaded dynamically at run time. This allows you to
easier maintenance of these subprograms since the application will not have to be
the use of virtual storage by giving you the ability to use a CANCEL statement to
free the virtual storage used by a subprogram when the subprogram is no longer
needed. However when using the DYNAM option, you pay a performance
penalty since the call must go through a library routine, whereas with the
Page 44 of 104
NODYNAM option, the call goes directly to the subprogram. Hence the path
overhead only)
On the average, for a CALL intensive application, the overhead associated with
the CALL using DYNAM ranged from 80% slower to 350% slower than
NODYNAM
RENT Or NORENT
Using the RENT compiler option causes the compiler to generate some additional
code to ensure that the program is reentrant. Reentrant programs can be placed in
shared storage like Link Pack Area (LPA) or the Extended Link Pack Area
(ELPA) on MVS. Also the RENT option will allow the program to run above the
16 MB line on MVS. Producing the reentrant code may increase the execution
1% slower.
Selecting the proper run time options is another factor that affects the performance of a
COBOL application.
ALL31
The ALL31 option allows LE to take advantage of knowing that there are no
will run in AMODE(31). This can help to improve the performance for an all
CHECK
The CHECK option activates the additional code generated by the SSRANGE
compiler option, which requires more CPU time resources for the verification of
CHECK(OFF) run time option deactivates this code but still requires some
Page 45 of 104
modification expression to determine that this check is not desired during the
particular run of the program. This options has an effect only on a program that
4. JCL
Page 46 of 104
members, just like a PDS. It can be created with JCL, TSO/E and ISPF just like a PDS
The directory can expand automatically as needed, up to the addressing limit of 524,286
members. It also has an index which provides a fast search for member names.
Space from deleted or moved members is automatically reused for new members, so you
don’t have to compress a PDSE to remove wasted space. Each member of a PDSE can
Allocating a PDSE
Batch Allocation
The DSNTYPE JCL Keyword specifies that a data set should be a PDSE or PDS.
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=XXXX.JCLTEST.RIJO.PDSE,
// DISP=(NEW,CATLG,DELETE),
// DSNTYPE=LIBRARY,
// UNIT=TESTDA,
// SPACE=(CYL,(10,10,10)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//
//SYSIN DD DSN=XXXX.JCLTEST.RIJO.PDSE2,
// DISP=(NEW,CATLG,DELETE),
// DSNTYPE=LIBRARY,
// DSORG=PO,
// UNIT=TESTDA,
// SPACE=(CYL,(10,10)),
Page 47 of 104
Tips for Mainframe Programmers
TSO/E Allocation
When allocating a PDSE with the TSO/E ALLOCATE command, you can specify
DSNTYPE to identify the data set as PDSE or PDS. If a data set exists with the
DCB attributes that you need, you can use the LIKE parameter to copy the
ALLOC DS(‘XXXX.JCLTEST.RIJO.PDSE2’)
LIKE(‘XXXX.JCLTEST.RIJO.PDSE’)
The example below shows an example of allocating a PDSE using the LIKE
ALLOC DS(‘XXXX.JCLTEST.RIJO.PDSE3’)
LIKE(XXXX.JCLTEST.RIJO.PDSE’)
DSNTYPE(LIBRARY)
ISPF Allocation
class)
**
**
or RECORDS)
Record format . . . . FB
Record length . . . . 80
The Data set name type field specifies whether the new data set is to be a PDSE
or PDS. Specify the Data set name type field to be LIBRARY to define a PDSE.
Page 48 of 104
Page 49 of 104
Member creation for PDSE is functionally same as for a PDS. There is no functional
A member of a PDSE can be deleted through the ISPF library panel or access method
services. With a JCL disposition of delete (DISP=(OLD,DELETE)), the entire data set is
IEBCOPY retains the original PDS, creates a PDSE and copies the members of the PDS
into the PDSE. The space is explicitly defined for the PDSE. You may use the LIKE
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS,
// DISP=(NEW,CATLG,DELETE),
// DSNTYPE=LIBRARY,
// DSORG=PO,
// UNIT=TESTDA,
// SPACE=(CYL,(10,10)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
A data set should be considered for PDSE allocation or conversion when one or more of
Page 50 of 104
· A large directory leads to lengthy directory searches (PDS directory searches are
· Protection is needed to prevent users from overwriting the directory or changing the
IEBCOPY
· Reload one or more members from a PDSU (Partitioned Data Set Unloaded – An
IEBCOPY unload data set. A sequential file that can be restored by IEBCOPY to
Examples
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//**********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.BKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(10,10,40)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
Page 51 of 104
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS,
// DISP=(NEW,CATLG,DELETE),
// DSNTYPE=LIBRARY,
// DSORG=PO,
// UNIT=TESTDA,
// SPACE=(CYL,(10,10)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//**********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT,DISP=SHR,
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT.BKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
'XXXX.JCLTEST.RIJO.WORK.SRTINPUT.BKUP'
MUST BE A PDS.
'XXXX.JCLTEST.RIJO.WORK.SRTINPUT' IS
Page 52 of 104
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.UNLOAD,
// DISP=(NEW,CATLG),
// UNIT=CART,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS.UNLOAD,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.LOADED,
// DISP=(NEW,CATLG),
// UNIT=TESTDA,
// SPACE=(CYL,(10,10,40),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT1
/*
Page 53 of 104
//*
//*********************************************************
*************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.IEBCOPY,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,5,5),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
SELECT MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4, -
IEBCOPY5,IEBCOPY6)
/*
//
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
*************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.OTHERS,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10,40),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
EXCLUDE MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4, -
IEBCOPY5,IEBCOPY6)
/*
//
Page 54 of 104
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
*******
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.IEBCOPY,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,5,5),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
SELECT MEMBER=(IEBCOPY1,IEBCOPY2,IEBCOPY3,IEBCOPY4,
IEBCOPY5,(IEBCOPY6,NEWIEBC6))
/*
//
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//**********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS.IEBCOPY,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.OTHERS,DISP=SHR
//SYSUT3 DD DSN=XXXX.JCLTEST.RIJO.JCLS.ALL,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10,40),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD *
COPY INDD=(SYSUT1,SYSUT2),OUTDD=SYSUT3
/*
//
IEBGENER
Page 55 of 104
//SYSIN DD *
CONTROL STATEMENTS
/*
Examples
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//********************************************************************
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*************************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS(IEBGEN2),
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.PDSE.JCLS(IEBGEN3),
// DISP=SHR,
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
Page 56 of 104
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
Using IEBGENER to create a back up copy of a sequential data set to another sequential data
set
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT,
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINBK,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
Using IEBGENER to create a back up copy of a sequential data set to a member of a PDS/PDSE
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT,
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK(SRTINBK),
// DISP=SHR,
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
Using IEBGENER to create a back up copy of a PDS/PDSE member to a sequential data set
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK(SRTINBK),
// DISP=SHR
Page 57 of 104
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTBKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//***********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK(SRTINBK),
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.PDSE.WORK(SRTINBK),
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// DSORG=PO,
// DSNTYPE=LIBRARY,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
Using IEBGENER to change the block size of an existing sequential data set to another new
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//************************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT,
// DISP=SHR,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.SRTINPUT.NEWBS,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
Page 58 of 104
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.WORK,
// DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.WORK.BKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(10,10,100),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
'XXXX.JCLTEST.RIJO.WORK.BKUP' SHOULD
Page 59 of 104
5. DB2
NULL INDICATOR
Syntax:
INTO :HOSTVAR:NULLIND
The picture clause that should be used for the null indicator is S9(4) COMP
Meaning:
DBRM:
DataBase Request Module, has the SQL statements extracted from the host language
PLAN:
A result of the BIND process. It has the executable code for the SQL statements in the
DBRM. Plan is marked as invalid if the index used by it is dropped. The next time the
SYNONYM
Synonym is an alternate name for a table or view. A synonym is accessible only by the
creator.
VIEWS
View is nothing but a stored query. Views are not supported by their own, physically
separate, distinguishable stored data. Instead, their definition in terms of other tables is
For example
FROM S
Page 60 of 104
When this CREATE VIEW is executed, the sub query following the AS is not executed;
instead it is simply saved in the catalog, under the specified view name (GOODSUPPLIERS)
SELECT *
FROM GOOD_SUPPLIERS
The system handles such an operation by converting it into an equivalent operation on the
FROM S
Not all of them. Some views are updatable e.g. single table view with all the fields or
mandatory fields. Examples of non-updatable views are views which are joins, views that
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD)
PLAN(EDD470BD)
LIB('EDGS01T.OBJ.LOADLIB')
END
Page 61 of 104
· If the table structure is changed ( a field is added ), the program will have to
be modified
· Program might retrieve the columns which it might not use, leading on I/O
over head.
ALIAS: is retained even if table or tablespace is dropped. ALIAS can be created even if
the table does not exist. It is used mainly in distributed environment to hide the location
High Values
How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a
complete name?
Avoid handling Nullable fields. It assigns a default of 0 to numeric fields which are
NULL
Page 62 of 104
In some applications, you execute queries that can return a large number of rows, but you
need only a small subset of those rows. Retrieving the entire result table from the query
can be inefficient. You can specify the FETCH FIRST n ROWS ONLY clause in a
SELECT statement to limit the number of rows in the result table of a query to n rows.
Example: Suppose that you write an application that requires information on only the 20
employees with the highest salaries. To return only the rows of the employee table for
FROM EMP
When an application executes a SELECT statement, DB2 assumes that the application
will retrieve all the qualifying rows. This assumption is most appropriate for batch
for a query to define a very large potential result set but retrieve only the first few rows.
The access path that DB2 chooses might not be optimal for those interactive applications.
What OPTIMIZE FOR n ROWS does: The OPTIMIZE FOR n ROWS clause lets an
DB2 uses the OPTIMIZE FOR n ROWS clause to choose access paths that minimize the
Use OPTIMIZE FOR 1 ROW to avoid sorts: You can influence the access path most
by using OPTIMIZE FOR 1 ROW. OPTIMIZE FOR 1 ROW tells DB2 to select an
access path that returns the first qualifying row quickly. This means that whenever
possible, DB2 avoids any access path that involves a sort. If you specify a value for n that
Page 63 of 104
is anything but 1, DB2 chooses an access path based on cost, and you won't necessarily
avoid sorts.
How many rows you can retrieve with OPTIMIZE FOR n ROWS: The OPTIMIZE
FOR n ROWS clause does not prevent you from retrieving all the qualifying rows.
However, if you use OPTIMIZE FOR n ROWS, the total elapsed time to retrieve all the
qualifying rows might be significantly greater than if DB2 had optimized for the entire
result set.
only on queries that can be performed incrementally. If the query causes DB2 to gather
the whole result set before returning the first row, DB2 ignores the OPTIMIZE FOR n
COUNT(DISTINCT C1).
Either GROUP BY or ORDER BY is used, and no index can give the necessary
ordering.
An aggregate function and no GROUP BY clause is used.
Page 64 of 104
Example: Suppose that you query the employee table regularly to determine the
employees with the highest salaries. You might use a query like this:
FROM EMP
you have also defined a descending index on column SALARY, that index is likely to be
very poorly clustered. To avoid many random, synchronous I/O operations, DB2 would
most likely use a table space scan, then sort the rows on SALARY. This technique can
cause a delay before the first qualifying rows can be returned to the application.
If you add the OPTIMIZE FOR n ROWS clause to the statement, DB2 will probably use
the SALARY index directly because you have indicated that you expect to retrieve the
Example: The following statement uses that strategy to avoid a costly sort operation:
SELECT LASTNAME,FIRSTNAME,EMPNO,SALARY
FROM EMP
The join method could change. Nested loop join is the most likely choice, because it
has low overhead cost and appears to be more efficient if you want to retrieve only
one row.
An index that matches the ORDER BY clause is more likely to be picked. This is
Sequential prefetch is less likely to be requested by DB2 because it infers that you
In a join query, the table with the columns in the ORDER BY clause is likely to be
picked as the outer table if there is an index on that outer table that gives the ordering
Page 65 of 104
Tips for Mainframe Programmers
RUNSTATS
RUNSTATS is a DB2 utility to collect statistics about the data values in tables which can
be used by the optimizer to decide the access path. These statistics are stored in DB2
catalog tables and is critical in determining access paths for an SQL statement.
IMAGECOPY
DECIMAL(n,m)
The COALESCE function avoids the use of nulls in the result column of OUTER JOIN
ON EMP.WORKDEPT = DEPT.DEPTNO;
QUALITY
It can be seen that the TRAINING DEPT's WORKDEPT is not shown in the table
because the query selects WORKDEPT from EMP, not the DEPTNO column from
DEPT. This can be rectified using the COALESCE function. The COALESCE function
notifies DB2 to look for a value in the listed columns, one from each table in the outer
join. If this value is found in either of the table it can be returned as a result. The
Page 66 of 104
SELECT EMP.EMPNO
DEPT.DEPTNAME
ON EMP.WORKDEPT = DEPT.DEPTNO;
The O/P for the above query would be now shown as follows...
QUALITY
We can see that the COALESCE function determines that the department code is stored
in the DEPT.DEPTNO column and returns that value instead of the null because there is
You can access QMF either through TSOA or TSOB. TSOA is test/development region
and TSOB is production region. That is if you access DB2 through TSOB, you will be
directly accessing production data (that is by default, the system will be pointing to
production databases)
· You can set the profile by selecting PF 11 from the QMF main panel. One
important setting is the CONFIRM, if you set it to YES, the system will ask for a
confirmation before you delete a table/proc etc… Printer is the 4 character Printer
ID installed in the Mainframe system and the user can direct the output of a query
to the printer using the 4=Print option in the query panel (by PF4). Other options
· Draw function enables the user to list all the fields in a table by entering the table
name in the command area (in the query panel) and by selecting the Draw option
(PF 6). For example, if you enter the table name ABCD.CUSTOMER_INFO in
the command line and press the PF 6 option, it will list a SELECT statement with
all the fields in the table without a where clause. This option is useful when you
Page 67 of 104
don’t know the fields in the table. If you want to delete a line from the listing thus
obtained, you can do so by selecting the line and by pressing PF 11. To insert a
new line (for example to add where clause) you can place the cursor at the bottom
· Save Query As - You can save a query for future reference by the option SAVE
will be available to other users also. To do this, after typing the query, issue the
save query as command. To View the query you have just saved, you can issue
· Once you have saved the query, you can retrieve using LIST QUERIES (OWNER
= <your id>) from the QMF main panel. This will list all the queries under your
id.
We can use the FORM option to format the output of a QMF Query. Press PF 9
after a query has run. This will show the default form for that query. Where you
can change the form and use this while running your query. A sample form is
given below
Page 68 of 104
FORM.MAIN
1 N_EMPL_INIT_TEST 2 4 C 1
2 N_EMPL_LST_RSLV 2 14 C 2
3 I_DSCRP 2 10 L 3
4 C_DSCRP_PRTY_TEST 2 5 C 4
5 N_TEST_CASE_NO 2 7 C 5
6 D_EST_DLVRY 2 10 TD 6
7 T_DSCRP_ABBR_DESC 2 40 C 7
8 T_DSCRP_DESC 2 240 C 8
FOOTING ===>
FOOTING ===>
BREAK2: NEW PAGE FOR BREAK? ===> NO
FOOTING ===>
Here also you can use the SHARE=Y option to make it available for all the users. Later
you can use the LIST ALL option to get this form and modify it according to your
requirement. The modified form can be saved by using the SAVE option.
While selecting the query to run, you can specify the form option in the command line to
get your display formatted according to your form (as shown below)
SELECT N_EMPL_INIT_TEST,
N_TEST_CASE_NO,D_EST_DLVRY,T_DSCRP_ABBR_DESC, T_DSCRP_DESC
FROM DB27.TCSS_DSCRP
Page 69 of 104
More on FORMS
Page 70 of 104
NNCNT
+----+--------------+----------+-----+-------+----------+----------------------
*1
--------------
*1
--------------
*1
--------------
*1
--------------
*1
--------------
*1
--------------
*2
==============
28,449
Page 71 of 104
FORM.MAIN T30831.DSCRP_FORM
2 N_EMPL_LST_RSLV COUNT 1 14 C 2
3 I_DSCRP 1 10 L 3
4 C_DSCRP_PRTY_TEST 1 5 C 4
5 N_TEST_CASE_NO BREAK1 1 7 C 5
6 D_EST_DLVRY 1 10 TD 6
7 T_DSCRP_ABBR_DESC 1 40 C 7
8 T_DSCRP_DESC 1 240 C 8
FOOTING ===>
FOOTING ===>
FOOTING ===>
You can also change the width of a field to format the display. SUM, AVERAGE also
To list all the forms, you can use LIST FORMS or LIST FORMS (OWNER = <your
The output of a query can be saved as a table name and you can use the same in another
This can be done by using the option SAVE DATA AS <table name>. To view all the
tables that you have saved, you can use the option LIST TABLES option from the QMF
main panel.
Page 72 of 104
Additional Information
· You can use wild card characters while using the LIST option. For example you
can use LIST QUERIES (NAME = %WEST%). This will list all queries with
· From the QMF main panel, you can issue PF 7 to retrieve the previous
commands. Another way by which you can retrieve the previous commands is by
the use of a Question mark (?) in the command line. You can use more than one
· You can use the reset option to clear out the queries/results in the QMF query
panel
· Even if you have logged on to TSOA, you can access the production version of
the data by using the CONNECT TO <db name> command in the query panel. By
default, TSOA will point to the test region databases, you can use the CONNECT
· In the QMF query panel, you can issue the EDIT command in the command line
to open up a TSO/ISPF like editor. Where you can use all the line commands to
· If a query is running for a long time and to cancel the same you can use Shift +
· You can use the short for O instead of OWNER in LIST command
Page 73 of 104
6. IMS
In the IMS, this takes the form of a Data Base Description (DBD) step. In this step, one
defines a Data Base Description (DBD), which is processed, and the resulting
A DBD describes the complete structure of a database. An installation must create one
Although each database has a single physical structure that’s defined by a DBD, the
application programs that process it can have different views of it. These views, also
called application data structures, specify the databases (one or more) a program can
access, the data elements the program can “see” in those databases, and the processing
the program can do. This information is specified in a PSB (Program Specification
Block)
The DBA codes the assembler language statements necessary to define a DBD or PSB,
then assembles and links them, storing the resulting load module in a PDS. This process
is called control block generation; generating a DBD is usually called a DBDGEN, and
Page 74 of 104
VENDOR
ITEM
LOCATION
DBD
PSB
The first macro in the PSBGEN job stream is PCB (Program Communication Block). The
PCB describes one database. A PSBGEN job contains one PCB macro for each database
the application program can access
The KEYLEN parameter specifies the length of the longest concatenated key the program
PROCOPT specifies the program’s processing options. They indicate what processing the
The DBA can code the PROCOPT parameter on the SENSEG macro to control access to
Page 75 of 104
This means that the user may not access the data within this segment but may use it only
for traversal of the hierarchy. A PROCOPT of K indicates that key sensitivity only. A
GN call with no SSAs can access only data sensitive segments. If a key sensitive segment
is designated for retrieval in an SSA, the segment is not moved to the user’s I/O area. The
key is placed at the appropriate offset in the key feedback area of the PCB.
If there is a difference in the processing options specified on the PCB and SENSEG
statements and the options are compatible, SENSEG PROCOPT overrides the PCB
PROCOPT
During installation, the database administrator (DBA) chooses the type of database to use
for the IMS-DL/I databases. The DBA decides which type of database to use based on
how most of the programs that use an IMS-DL/I database will access the data in the
database. The following is a list of database types that the DBA can use to define an IMSDL/
I database
It is a direct-access database that consists of one or more areas, with each area containing
both root segments and dependent segments. The database is accessed using VSAM
level.
locate any database record, regardless of the record sequence in the database, by using a
the order that the data are physically stored in the database.
Page 76 of 104
It is one of DL/I's two direct-access methods. HIDAM provides direct access to data
through an index.
are stored in a hierarchical sequence, one segment after another. HSAM provides
sequential access to root segments and dependent segments. You can access data in
You can processes data sequentially, but it has an index that enables you to directly
It allows IMS/ESA batch application programs to access a sequential OS/390 data set
record that is defined as a database record. This database record is handled as one unit,
with no segments, fields, or hierarchical structure. Any records to be added are inserted at
the end of the database. GSAM does not allow you to update or delete records in the
database.
It is an HSAM database that contains only one segment type, a root segment. Only two
types of calls are valid with SHSAM databases: Get calls to read a database and Insert
calls to load a database. You must reload a database in order to update it.
Page 77 of 104
PROCOPT
It is the parameter keyword for the processing options on sensitive segments declared in
G Get Function
I Insert Function
A All, includes the above four functions. PROCOPT = A is the default setting
O If the O option is used for a PCB, IMS doesn’t check the ownership of the
segments returned. Therefore, the read without integrity program might get a segment
that has been updated by another program. If the updating program abends and backs out,
the read without integrity program will have a segment that doesn’t exist in the database
N Reduces the number of abends that read only application programs are subject to.
Read only application programs can reference data being updated by another application
program. When this happens, an invalid pointer to the data might exist. If an invalid
pointer is detected, the read only application program abends. By specifying N, you avoid
this. A GG status code is returned to the program instead. The program must determine
T T is the same as the N operand, except that T causes DL/I to automatically retry
the operation. If the retry fails, a GG status code is returned to the application program.
GS Get Segments in ascending sequence only (HSAM only). If you specify GS for
HSAM databases, they will be read using the Queued Sequential Access Method
(QSAM) instead of the Basic Sequential Access Method (BSAM) in a DL/I IMS region.
LS Segments loaded in ascending sequence only (HIDAM, HDAM). This load option
is required for HIDAM. Because you must specify LS for HIDAM databases, the index
for the root segment sequence field will be created at the time the database is loaded
H Specifies high speed sequential processing for the application program using a
particular PSB. The restrictions for using PROCOPT = H are
Page 78 of 104
If you don’t specify the PROCOPT operand, it defaults to PROCOPT = A. The replace
In a non-terminal related or fixed terminal related MSDB, only the processing options G
Page 79 of 104
7. TSO ISPF
HRECALL
To recall a dataset that has been migrated without freezing your screen, type HRECALL
TSO SEND/TRANSMIT
To send short messages, use TSO SEND ‘message’ U(userid). If the person is not logged
on but you want to send a message which he/she can read when he logs on , say
TSO SEND ‘message’ U(userid) LOGON. To send Large information, use TSO
TRANSMIT.
To know the percentage free space and other statistics of your data set, go to option 3.1
The commands you use regularly can be saved as a function key. For example if you
often change a JCL, save it , submit it and then go to the job spool, you could save a PF
key as ‘SAVE;SUB,=IOF’. To do this , type KEYS on command line and make the
necessary entries.
TAPE DATASET.
You can’t Rename/Delete a tape dataset. Only you can uncatalog it.
Your PDS is out of space. Start another session, open this PDS in 3.4 and type Z next to
it, it will compress your PDS. All X37 abends are out of space situations.
NO SPACE IN DIRECTORY
If you get the above error message while creating a member in a PDS, which means your
PDS can no longer accommodate more members in it. You need to increase the directory
Suppose that you are editing your component in View mode and you want to save the
changes. In such a case, you can use CREATE or REPLACE. The said example is just an
Page 80 of 104
CREATE
CREATE creates a member of a PDS or a sequential dataset from the data you are editing
Simplified syntax is
Where member is the name of the new member and range is two labels that specify the
group of lines, from beginning to end, which are added to the new member.
Note: CREATE adds a member to a PDS only if a member of the same name doesn’t
already exist.
You have to specify a range of lines from the data you are editing. If you want to use the
entire data you are editing, you can use the system defined labels .ZF and .ZL (stands for
the first and last line) , or you can label the lines according to your needs or you can use
CC/MM to select the lines. But please note the difference between CC/MM.
You can specify the member in the command line or you can give CREATE .ZF .ZL and
press enter, you will get the edit entry panel and you can specify the DSN.
If you want to create a member in the same PDS in which the component you are editing
Or
CREATE .ZF .ZL (or the range that you wish), and press enter; specify the DSN in the
REPLACE
The REPLACE primary command replaces a sequential data set or a member of a PDS
with the data you are editing. If the member you want to replace doesn’t exist, the editor
creates it.
Simplified Syntax is
Page 81 of 104
The CUT primary command saves lines to one of eleven named clipboards for later
retrieval by the PASTE command. The lines can be appended to the lines already saved
Where,
Two line pointers that specify the range of lines in the current member those are to be
added to or replace data in the clipboard. A line pointer can be a label or relative line
number. You must specify both a starting and ending line pointer. If you do not specify a
range of lines, all lines in the edit session are copied to the clipboard.
E.g.: CUT .a .b
Clipboard name is
The name of the clipboard to use. If you omit this parameter, the ISPF default clipboard
(named DEFAULT) is used. You can define up to ten additional clipboards. The size of
PASTE CUT1
CUT CUT2
PASTE CUT2
REPLACE | APPEND is
APPEND as the default by entering the EDITSET command on the editor command line.
The default action depends on the setting specified in the panel displayed by the
EDITSET.
Page 82 of 104
DISPLAY is
Show a list of existing clipboards. From this list you can browse, edit, clear, or rename
the clipboards.
Clipboard manager will pop up and will give the options to view, edit …
To search for a value say ‘0980312’ stored in COMP-3 format, you can use this method
F X ‘0980312’
To do a case sensitive search for a given search string, use this method.
Just enclose the search string within quotes and have the letter C in front
E.g. F C ‘FindMe’ will find all the ‘FindMe’ strings only if the case
matches
To specify the direction of search i.e., how to search for a string in the backward/ forward
in backward direction
default direction
forward direction.
of the file
Count of all
instances in file
ALL F ‘job’ ALL finds the first instance
in the file.
To search for a string that is not prefix/suffix of another word. That is to find for an
instance of a search string that is whole word by itself. To do this, you can use the
following method.
Use the keyword ‘word’ at the end of the find command. That is
Page 83 of 104
AUTOCOMPLETE FEATURE
We can have auto complete feature in ISPF like that we have while browsing the internet.
1) Go to ISPF 3.4
2) Enter KEYS in the command line and press enter. The KEYS window will pop
up.
3) Set any key to AUTOTYPE, save and exit. For example set F4 as AUTOTYPE.
4) Now type any dataset partially and press the assigned PF key.
5) You can use the assigned PF key to get the next match.
NRETRIEV
This is a way of making the system remember previously typed dataset names.
1) Enter KEYS in the command line, the KEYS window will popup
3) Now when you are in 3.4 or which ever screen you have set the KEYS option,
4) Pressing the assigned PF key will bring up one by one the last 30 accessed
COBOL COMPILER
To know which version of COBOL compiler you are using, look at the first line of your
compilation listing.
Page 84 of 104
Suppose you want to compare the 2978:2979 (start_column:stop_column) of the new file
with the 1565:1566 (start_column:stop_column - 2 Chars) of the old file, then here is the
Select 3.13
CMPCOLMN 2978:2979
CMPCOLMO 1565:1566
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
// PARM=(CHNGL,WORDCMP,
// '',
// '')
//NEWDD DD DSN=ISPS.RJOSEPH.RIJO.WORK(COMP1),
// DISP=SHR
//OLDDD DD DSN=ISPS.RJOSEPH.RIJO.WORK(COMP2),
// DISP=SHR
//OUTDD DD SYSOUT= *
//SYSIN DD *
CMPCOLMN 2978:2979
CMPCOLMO 1565:1566
/*
give file compare; you can give either line compare or word compare
TAPE DATASET
Suppose that the LRECL is 100 bytes, the block size is 1000 bytes then, if we know the
block count, we can find the approximate number of records in the tape dataset by the
following calculation
Page 85 of 104
= 100
This is an approximate value because, the last block may not be full.
Note: To get the block count and all the details regarding the tape data set, you can use
Give DSN in the option ‘Inquire/update TMC record by Data Set Name’ without
quotes/Press enter.
This would work for data sets that are not archived.
DASD DATASET
1 Cylinder = 15 Tracks
In the above case, the maximum number of records that can be stored is
= (40 * 56664)/80
= 28332
Page 86 of 104
Data flow diagrams illustrate how data is processed by a system in terms of inputs and outputs.
Page 87 of 104
Page 88 of 104
DFD Levels
DFD levels
The first level DFD shows the main processes within the system. Each of these processes can be broken into
The numbering inside the circle may represent process identification number. Usually the
Page 89 of 104
Context Diagrams
Context Diagrams
A context diagram is a top level (also known as Level 0) data flow diagram. It only contains one process
node (process 0) that generalizes the function of the entire system in relationship to external entities.
You can use two different types of notations on your data flow diagrams: Yourdon & Coad or Gane & Sarson.
Page 90 of 104
Process Notations
Process Notations
Process Notation
Process
Data Store
Data stores are repositories of data in the system. They are sometimes also
referred to as files.
Data flows are pipelines through which packets of information flow. Label the
arrows with the name of the data that moves through it.
Page 91 of 104
Page 92 of 104
An Example
Page 93 of 104
9. COMMON ABENDS
JCL error
File attributes don’t match; For example, I have given RECFM=VB, RECLEN is same as
that specified in FD section. Why do I get this error? For variable record format files you
S322
S806
S913
S878
Region size is not enough. Increase the value you have specified in REGION parameter
of JOB statement or in EXEC step. Or you can give REGION=0M; in this case, the
S522
S0C4
Storage related problem. Check your linkage section, table definition, and FD section.
S013
A file open error.
S722
The Sysout or spool is full. You program is writing too many things to Sysout. Increase
then retry. This will increase your Sysout limit to ‘150’ thousand lines.
S0C7
S0C7 Abend
field and you tried to manipulate that field by some arithmetic expressions.
Page 94 of 104
The representation scheme that we use is EBCDIC. This is an 8 byte extension to the
Dec
He
ASCII EBCDIC
0 00
NU
Null
NU
Null
1 01
SO
SO
Start of Heading
2 02
ST
ST
Start of Text
3 03
ET
ET
End of Text
4 04
EO
5 05
EN
6 06
AC
7 07
BE
Bell
DE
Delete
8 08 BS Backspace (FE)
Start of Manual
Message
15 0F SI Shift In SI Shift In
16 10 DL
17 11 DC
Device Control 1 DC
Device Control 1
18 12 DC
Device Control 2 DC
Device Control 2
19 13 DC
20 14 DC
Device Control 4 RE
Restore
Page 95 of 104
22 16 SY
23 17 ET
24 18 CA
Cancel CA
Cancel
26 1A
SU
27 1B
ES
Escape
CU
Customer Use 1
IF
Interchange File
Separator
IG
Interchange Group
Separator
Interchange Record
Separator
IU
Interchange Unit
Separator
33 21 ! Exclamation Point SO
Start of Significance
35 23 #
"pound"
36 24 $ Dollar Sign
BY
Bypass
38 26 & Ampersand ET
End of Transmission
Block
Escape
40 28 ( Left Parenthesis
41 29 ) Right Parenthesis
43 2B + Plus Sign
CU
2
Customer Use 2
44 2C , Comma
Enquiry
Page 96 of 104
AC
Acknowledge
47 2F / Slash, Virgule
BE
Bell
48 30 0 0
49 31 1 1
50 32 2 2
SY
Synchronous Idle
51 33 3 3
52 34 4 4 PN Punch On
53 35 5 5 RS Reader Stop
54 36 6 6 UC Upper Case
55 37 7 7
EO
End of Transmission
56 38 8 8
57 39 9 9
58 3A : Colon
59 3B ; Semicolon CU
Customer Use 3
60 3C < Less-than Sign DC
Device Control 4
61 3D = Equal Sign NA
Negative Acknowledge
63 3F ? Question Mark
SU
Substitute
64 40 @ At Sign SP Space
65 41 A A
66 42 B B
67 43 C C
68 44 D D
69 45 E E
70 46 F F
71 47 G G
72 48 H H
73 49 I I
74 4A J J ¢ Cent Sign
Page 97 of 104
"dot"
77 4D M M ( Left Parenthesis
78 4E N N + Plus Sign
79 4F O O | Logical OR
80 50 P P & Ampersand
81 51 Q Q
82 52 R R
83 53 S S
84 54 T T
85 55 U U
86 56 V V
87 57 W W
88 58 X X
89 59 Y Y
90 5A Z Z ! Exclamation Point
97 61 a a / Slash, Virgule
98 62 b b
99 63 c c
100 64 d d
101 65 e e
102 66 f f
103 67 g g
104 68 h h
105 69 i i
106 6A j j
107 6B k k , Comma
108 6C l l % Percent
Page 98 of 104
112 70 p p
113 71 q q
114 72 r r
115 73 s s
116 74 t t
117 75 u u
118 76 v v
119 77 w w
120 78 x x
121 79 y y
122 7A z z : Colon
Octothorp, "pound"
127 7F
DE
128 80 Reserved
129 81 Reserved a a
130 82 Reserved b b
131 83 Reserved c c
132 84
IN
Index (FE) d d
133 85
NE
134 86
SS
135 87
ES
136 88
HT
137 89
HT
Justification (FE)
ii
138 8A
VT
Page 99 of 104
139 8B
PL
140 8C
PL
142 8E SS
143 8F SS
144 90 DC
145 91 PU
1
Private Use One j j
146 92 PU
147 93 ST
148 94 CC
Cancel Character m m
150 96
SP
151 97
EP
152 98 Reserved q q
153 99 Reserved r r
154 9A Reserved
155 9B CS
157 9D
OS
159 9F AP
160 A0
161 A1
162 A2 s s
163 A3 t t
164 A4 u u
165 A5 v v
166 A6 w w
167 A7 x x
168 A8 y y
169 A9 z z
170 AA
171 AB
172 AC
173 AD
174 AE
175 AF
176 B0
177 B1
178 B2
179 B3
180 B4
181 B5
182 B6
183 B7
184 B8
186 BA
187 BB
188 BC
189 BD
190 BE
191 BF
192 C0
193 C1 A A
194 C2 B B
195 C3 C C
196 C4 D D
197 C5 E E
198 C6 F F
199 C7 G G
200 C8 H H
201 C9 I I
202 CA
203 CB
204 CC
205 CD
206 CE
207 CF
208 D0
209 D1 J J
210 D2 K K
211 D3 L L
212 D4 M M
213 D5 N N
214 D6 O O
215 D7 P P
216 D8 Q Q
217 D9 R R
218 DA
219 DB
220 DC
221 DD
222 DE
223 DF
224 E0
225 E1
226 E2 S S
227 E3 T T
228 E4 U U
229 E5 V V
230 E6 W W
231 E7 X X
232 E8 Y Y
233 E9 Z Z
234 EA
235 EB
236 EC
237 ED
238 EE
239 EF
240 F0 0 0
241 F1 1 1
242 F2 2 2
243 F3 3 3
244 F4 4 4
245 F5 5 5
246 F6 6 6
247 F7 7 7
248 F8 8 8
249 F9 9 9
250 FA
251 FB
252 FC
253 FD
254 FE
255 FF
Look into the HEX column, where numeric 1 is represented as F1 where F is actually the
sequence used to represent the series. For calculation, the system will take only the lower
order nibbles. In this case, it is 1. So, S0C7 will occur only when an invalid value is
present in the lower order nibble. Where invalid value means not simply alphabetic
characters stored in numeric field. This is because, if you try to move 1A to a numeric
field, the COBOL compiler will do an automatic data conversion. 1A will be represented
internally as
1A
FC
11
Here the lower order nibbles contain numeric 11 so if you move 1A to a numeric filed
and try to manipulate that filed, it won’t cause a S0C7 , because it contains 11. Suppose
9*
F5
9C
Now, the lower order nibbles contain an invalid character C, if you try to manipulate this
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
ADD 1 TO SAMPLE1
******************************************************
STOP RUN
Its output is
9Ü IS SAMPLE 1:COMP-3:BEFORE COMPUTATION
Note that
Are not executed because just before that the program abended.
This is a possible cause of S0C7 error. For more information on the causes of this error,
--------------------------------------------END---------------------------------------------