You are on page 1of 246

An Introduction to Mainframes

Rijo Joseph
05-Dec-2007

An Introduction to Mainframes

To

Reena Paulson Alapatt
My sister and best friend…

An Introduction to Mainframes

-2-

PREFACE This is a humble effort to introduce mainframes DISCLAIMER No author writes a book without enormous help from others. I have drawn insights and ideas from many sources - from the IBM manuals to The Times of India Capital Edition. This book is a best effort on my part; I tried my level best to gather correct information from reliable sources. COPYRIGHT You can make as many copies of this book as you wish. I would be happy if you share it with others. You can’t sell it, nor modify the contents of this book, nor claim the material as your own, nor replace my name with another. ABOUT THE AUTHOR Rijo Joseph holds Masters Degree in Computer Applications from University of Kerala (India) and at present working as a technical team lead with IBM India Pvt Ltd The author is IBM certified DB2 Associate, DB2 Application Developer, and Solutions Expert Your feedback is most welcome; send your comments to rijo.joseph@in.ibm.com ABOUT THE BOOK The book has been divided into two parts. The PART-1 contains information about computing history, computers, mainframes and mainframe OS and PART-2 contains Tips and Tricks and technical tidbits in COBOL, JCL, and DB2 etc BOOK EDITIONS Dec-05-07 – First Edition The author shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.

An Introduction to Mainframes

-3-

ACKNOWLEDGEMENT It took me almost 3 years and a rigorous 2 months to complete this work. And I could say those 2 months were the toughest time in my life. The almighty chose those 2 months to teach me few tough lessons in life; however he made sure that my work is completed on time. Strange are your ways O Lord! I chose Dec 5 to publish this book as today is my sister’s birthday. This book goes as a surprise birthday gift to my sister. She is the one who ignited a change in my life that enabled me to think beyond the boundaries I express my sincere gratitude to My parents, AV Joseph and Elsamma Joseph, my brother in law and sister, Paulson Jose Alapatt and Reena Paulson Alapatt, my cousins Fr. Benny Maramparampil and Sr. Tresa John for their love, support, guidance and prayers My managers at US Technologies - Saju Mathew, Sabu Purushothaman, Rajesh Subramony, Sunil Balakrishnan, Manjith Sundaresan and my managers at IBM India - Rajiv Mittal, Pawan Wig, Gautam K Varma, Santanu Dev for an unmatched support, motivation and guidance My SMEs, Managers and Technical Staff at Duke Energy/IBM US. This book goes as a souvenir for a 2 year long association with them. The motivation and help provided by Dave Miller, Tom Susman, Jim Kanet, Don Shull, and Grant Marsh were fantastic. They are a group of wonderful people. My friends, specifically to Lismi Sundaran, Nancy George, Sooraj Puthiyadath and Sarath Babu who made me believe that I could actually complete this work and most of the time they woke me up from my dreams and put me on my writing chair Sandeep Midha for providing me with the necessary reference books and Prateek Vijayvergia for providing me with necessary software for converting my work in MS Word to a .pdf format All the ‘ghosts’ who came to interfere in my work, though you could take several days out of my schedule and you could crush me to the maximum, you couldn’t do anything else. The baton is still in my hand and I have the final laugh. I enjoyed your presence, you taught me few lessons too. Thanks for that and better luck next time! I wanted to write a complete book, but I found it would take more years for me to complete, I followed a prototype approach. I will refine this book as and when I get valuable suggestions and advices from you. You can send your valuable suggestions to rijo.joseph@in.ibm.com or you can post your comments at http://www.geocities.com/rijosmailbox Rijo Joseph Dec-05-2007 An Introduction to Mainframes -4-

........................................... 23 1.......4.......................... 25 1...............................1 1.....1...........3............... Joseph Marie Jacquard and Punched Cards ...............9...9....................... A Brief History of Computing .................................................................... Mainframe Computer.......................................................1.........................................................................5.............................. 26 1.......... Generation of Computers.. 16 1......................2.......................................... The Second Generation.......................................................3.......1... 24 1............................................................................................................................... 25 1.....8......... UNIVAC – I .. 21 1............ Evolution of the First Generation of Modern Computers .................................... Herman Hollerith and the Tabulating Machine ........ 19 1...........................................6.2 2..................................................5................... 30 Chapter ...................................................4...........1..9...................................................................... 26 1... EDSAC ...... Blaise Pascal and Pascaline ...........1....................................................................... ENIAC ...................1............................................................................................... 18 1....... History of IBM........1.................................................................. 22 1............................................ Napier’s Bones................2................................................. Charles Babbage ....... 37 2................................. 33 2...................... General Purpose Computer ......3........ The First Generation ......................... Special Purpose Computer... 18 1........................7.....................5.... 32 2..2.9.......2.............. Minicomputer.....2.... Microcomputer................................................6...................................1..................................................................... 28 1.......................................... 21 1.......... 40 An Introduction to Mainframes -5- . 35 2.9.................................................... 33 2......9...........9........................................................................9....................2..................................4..................9............................................2.................................................... 33 2....9................ 33 2...................3........................1.1........................................ 16 1........................................................ 40 2............3.4....................... Abacus..........TABLE OF CONTENTS PART .........1 Chapter ......2......... 32 2.............6..................................... The Fifth Generation........... Computer Classifications .......... 22 1.......... Analog Computer................................. Gottfried Wilhelm Leibniz and Leibniz’s calculator .................... Super Computer ......1........... 17 1.... The Fourth Generation................... The Third Generation...................2.............................................................9.... 20 1......................... EDVAC... 25 1................... Hybrid Computer ...... Digital Computer .................................................................

..............4...... MVS Concepts.2......................................................10........3..............................................4............... 69 An Introduction to Mainframes -6- ......................................................................................................................... 60 3..................2........................ 54 3.................3.................................4.................................................. 57 3................................3...3................................. Paging ... Virtual Storage............................ XA and 31 bit addressing .............. 61 3....................2.................................9............3...5....... 57 3.......3..3......................................5.......1... 42 3.1...........2......................3 3.................... 46 3.....................5...... Channels .............. Characteristic Features of Mainframe OS ............. 56 3. 44 3..........3..3...............2...... 45 3................ eServer zSeries 900.............5.... eServer zSeries 990......11. Swapping ... 65 3.........3......1.. Direct Access Device.2........2...................2.7....... Unit Record Devices............3................ 53 3..........8.........6................1.......................................2..........................7....... 45 3.. 64 3.. 55 3.........3...................................7.. 43 3..... Multiprocessing ............................ System Initialization .................2.......................................3.............. 47 3......................1..............................2............... Online Transactional Processing...........................9..........................4................3.....................................................................................3............1..............2............................ A peep into the history............ A small mainframe configuration .........................................3..............3.......................3....1... Reliability..........2..2.....................3......... 58 3....3..........................2.......................3........................ Typical Mainframe Workloads ........... Scalability ..10.3......2.................... 57 3................................................7..................1...............................3.. 64 3.......Chapter ..............2...............................................................................2............2...... 53 3.......... 52 3..................... PR/SM.................. 60 3....... Availability.............4................. 63 3....... Magnetic Tape Devices .......1................ 53 3.................................................... 62 3...1........................2..............2........ System/360...............9.............2........ LPAR ..3................................................. 43 3......... 47 3....... Continuing Compatibility ......................3..................2....9.. 56 3..7...................................... The MVS system ..... and Serviceability..5............ 54 3......3........2........................ Time Sharing.........3..... Multiprogramming................................. 62 3. Factors Contributing to Mainframe use ...... 53 3.................................................................2............... 49 3................3...............1.................. Spooling....... 67 3............................ Expanded Storage .......................................3........................ I/O Devices ................2.....2.........................3................................................ 63 3......3...........................................................3.........................3.................... System Generation........2.........................3................................................................................... Data Communications Equipment . Address Space.3............. 43 3... Security ........................................................................................2............. 59 3.....9...................2.........................2.... 43 3... System/390....2......5.2..................................................2......... System/370...........3.......2.......7.... More about Mainframes....................................... Batch Processing...............2.....................................................................3.........................................................................1............1. Batch Processing..............................10................. 52 3...............

.........5. Pages............ 74 4................................. 80 4.... 77 4..... Real Address...........................3...................3......... z/Architecture and z/OS ...................................1.............................3..............3........9......1............................. Channel Subsystem................................................................................................3.....................3......... 91 An Introduction to Mainframes -7- .......... 78 4................3.. 80 4.......................... External Time Reference ....... 75 4.. 75 4....1... 74 4.......... Channel Paths..........2.................... 77 4................5............................5..................... and Slots.............1.......... 76 4..........................5......3........ 76 4.. Operator Facilities....... Dynamic Address Translation ................. Virtual Memory ......... 87 4........................5........ 78 4.3...........2....................................... Storage Addressing..3........... 79 4.............................................................1........3...........3............................................ 73 4...................3........ Expanded Storage ..........................................1. 86 4............................ Virtual Storage Address...... 79 4........................................................5..................... 91 4.............................................3.......4....................................5.......... 85 4................. 82 4........... Operating System...............9....................................................4................5................................ Logical Structure of a z/Architecture system with 2 CPUs ..................9................3.1.............................................................................3................... Virtual Storage Operation .1..................4...2.............. 82 4...........................5....................3................................ Virtual Address......... PSW .................................. Control Blocks . Physical Storage used by z/OS ....6................................. 86 4..... Absolute Address........................ What does it really mean?........... I/O Devices and Control Units.... Floating Point Registers..3.......1..............................1.2........7...................................................................................5...................................7............. Address Space......................................... 73 4................................................................ Page Stealing............................1.................................................................. 75 4........................ 81 4......5.....4...........................................................5..... 90 4.......2.........2..............................3.................................9.................3............ 81 4...........................8....3.................... 82 4.. Hardware resources used by z/OS .. 76 4..............3...........................4...........5..........4......4 4..............................5................................3.................8......1.............................. 83 4............................. Cryptographic Facility ...... z/OS.......1................ 85 4............3...............1..................7............9... Cache Memory................................ CPU.................... Information Formats ....................1............... Virtual Memory and z/OS..............3...... Floating Point Control Register ..........1.....3.....................3.......................1......3...........Chapter ....5................................................ Control Registers ................5...... 77 4...............................................................3.6.. 88 4................................ 81 4...5.................5....5............................... General Registers.....9.....................3.........................3...........................3............ Swapping .........4.......6...........3...................... 74 4.... Integral Boundaries..................................10..................1.....3.......2.........1... Paging ......4.............1..... Access Registers .............................................9........ More about storage ..................... Address Types .................................................1.... 82 4............................5...9.....1..................6............. Frames.......1..............1..........5......... 75 4........3...................................................3......................... 73 4.................. 75 4...............5............... I/O ..4. 85 4........................................................ 76 4.............3....................... 83 4. Multiprogramming and Multiprocessing ........5.................................................................. Prefixing ............ 77 4......5............Overview................ 82 4..... Main Storage..........3.................................................4.........5...........................................................................

Bad things about Static CALLs .....1...................................1..... 113 1........ REDEFINES Clause ................ USAGE IS COMPUTATIONAL / COMP / BINARY ...........................................6...............................3........ Tips and Tricks! . 97 5...11......... 110 1.............................7...... SEARCH and SEARCH ALL........................... USAGE IS COMP-3 .................2 Chapter ............................ 102 1......2............. 108 1............5................... Job roles in the mainframe world...................1...... 109 1...................5.....1..........12.................. USAGE IS COMP-2 ..... 124 1....................... 107 1...................................................1................ 104 1......1......4................... 124 -8- An Introduction to Mainframes ...................................... 122 1.......... 108 1..................................1......1 1. Rule of the Thumb for SEARCH and SEARCH ALL..............4.................1.....................4.......5............ 96 5. Good things about Dynamic CALLs ..........................................................8..................................................1........ 96 5............ 98 PART .. USAGE Clause ...................................3.....................3....................2.......................... Bad things about Dynamic CALLs ............................. Do you know? .................................................3............ 122 1.......12............ Meaning of Device Name in SELECT Clause........5..................................................... 123 1...........2.......................10............2.........5 5.............12........... 96 5............ Leftover................................. Static CALLs ...... 122 1................................... 111 1........ 122 1............. 97 5.................................................................... System Operator.......... 105 1......1..... Packed Decimal ........ 98 5........................................................4.........................2. COBOL – Tips and Tricks ..2......................... RENAMES Clause...........12................................................................................6................................ 110 1........ 107 1................ 92 Chapter ..........................9............................................................................................................... USAGE IS COMP-1 .........1........ NEXT SENTENCE and CONTINUE ..... USAGE IS DISPLAY............................................................................ 110 1..1... 108 1......................................... 111 1............. 107 1................................... Application Designers and Programmers ............................... System Administrator ................................ BLOCK Structure in Files (COBOL) – General Perspective ...................7........................................... Different forms of EVALUATE Statement .. Production Control Analyst ....... 123 1............12....................1...................... 98 5..... Performance Considerations for Indexes VS Subscripts ....... Good things about Static CALLs................. Brief History of 64 bit addressability.......... S0C7 Abend .......3........... 102 1..................................... Static and Dynamic Subroutine CALLs............... 111 1............................... Program Products for z/OS ...2...................2......................................... 102 1..........................1...............................1.. System Programmer...5............................................................................................7........................12...2...................................................5...5.7...............................2......5.............................................................................................................................. Dynamic CALLs..................................12....

............. 127 1................................................................................................................ 135 2.... Plan ..13............ 125 1.................................. 137 2................15................................1.................................................................................................. Null Indicator ................................15............. 132 1................................... Data Types ........................ OPTIMIZE(FULL) OR NOOPTIMIZE ........16.....................................................................................................16......20.................... 128 1..... RETURN CODE of Internal SORT......................................... Why SELECT * is not preferred in embedded SQL programs?.. STD OR OPT .................. OPTIMIZE FOR n ROWS............. ALL 31.................................. 140 2... Synonym .................. 128 1............................ DECIMAL(n................................................. How does DB2 store NULL physically? ........... 130 1..................15.......6...............15..........2............................................................................13.......... 128 1..........1.............................................11.......2........................ 124 1..16.................. 125 1..........................16........................................................ 135 2....................... IMAGECOPY. 139 2........................7........................ DBRM................ 129 1........ Alias .............................................18...6..........................15.................7............................................ Why READ FILE and WRITE RECORD? .....................................8..... CASE Expressions .................................................................... 142 2............ Run Time Options that Affect Run Time Performance .. Comparing Data Types ....................... Views ...2.............................15...16.......................................9................................................. FETCH FIRST n ROWS ONLY.......................1.. RUNSTATS ...................17.. 137 2..........................17........ BINARY (COMP OR COMP-4). DCLGEN .....3...................................................... 132 1...................................... OPTIMIZE(STD)....... 131 1................................................................12...... TRUNC – BIN...2...........................5.......... Indicator Variable and -305 ABEND........... INDEXES Vs SUBSCRIPTS ...................... 142 2.............. 143 An Introduction to Mainframes -9- ................................ CHECK.........1..................................................................................... Compiler options that affect run time performance ............... RENT or NORENT................................ 136 2................17................ 137 2....4... 136 2. PACKED DECIMAL (COMP-3).......... 130 1......................................... 135 2........ 129 1.................................................14............................................... 133 Chapter .....10...................... 138 2............ 137 2.....................1.................. 139 2..........16....17...............15....................................................... AWO or NOAWO ........ Data Conversions.................................... 135 2...............................1.3................ SSRANGE or NOSSRANGE .........................................m)..........15............. DYNAM Or NODYNAM ...... 127 1......................... Which is Better Static or Dynamic?......... Efficient COBOL Coding Techniques ....2.................................... DB2 – Tips and Tricks...........3.................. 125 1..................16......................................................... How to Run a DB2 Batch Program............................................1..............4......................................... 142 2..................1....................... 132 1...........19............................................5..................... COALESCE Function in DB2 ......................... MIG OR PFD .............. 131 1. EXPLAIN....................................................................................................... 135 2..... 137 2..............18....................4........................................ 125 1........................................... NUMPROC – NOPFD...... 141 2....................14............... Concatenate.. 125 1...........3.......................................2 2...................... Dynamic Array................................................................................16................... 126 1......................16......12........................

................... 157 3..... Backup of a sequential data set to another sequential data set..............6..... SELECT...................... Loading ...................3.......4 4......... IEBCOPY ........1.... 164 3.. 168 3............... IEBCOPY TO CONVERT A PDS TO PDSE ......................9.................................. 154 3.........4...........................................................................................4............. 159 3....... ICETOOL .................... Create a data set from in stream data .................8................................3............1........................................................2....................................... PDSE...........................10 - ...........3.......7............................ 155 3. 160 3.......................................................................................... (NEW......8..... Merging PDSs......... 160 3....... 175 4......... To produce PDSE from a PDS member ......................................................... SORT – modify the output record................................ 187 An Introduction to Mainframes ..........4................. To change the block size..........3................................1........... 156 3............ 163 3.....................2......2.........................................................................................2............4................ 147 Chapter .3...... 154 3... 166 3.. DFSORT – Tips and Tricks ...........................................................2..................... Rename ................... 169 3.............. 155 3..................5..............2... 165 3........ Convert a PDS to a PDSE......................1.1..........................2................ EXCLUDE............................................................. JCL – Tips and Tricks.......1.............................................................................3..3.....................2.........7.....................2......................... 176 4.............................2............... Backup of a PDS/PDSE member to another PDS/PDSE............. 161 3........ 159 3.................................. INCLUDE Control Statement.. 157 3.. 174 4...........................1. When to use a PDSE .......3....................4...................... 165 3....................................................... 174 4.... 158 3................................................................................1...........6....8............. ICETOOL .................... CATLG.................................................1.......5....................... Copy an entire PDS to another PDS ....... TSO/E Allocation..... 156 3..............3.................. 163 3......2............ 171 Chapter ................ IEBGENER.................................... Query Management Facility................. Another Production ABEND – JCL ERR....................1............... CATLG) and a production ABEND..........................................................5...............................................7...........1.. ISPF Allocation..............1........................... 164 3.......... You will get error if you try the following JCL.................. Unloading................ 154 3........... Backup of a sequential data set to a member of a PDS/PDSE.............................................................3 3.... 161 3...... 167 3...5.............. Back up copy of a PDS/PDSE member to a sequential data set ........ Compressing .....6......10.................................................................................................2................................... DFSORT Unleashed .. Batch Allocation ...... Bit Logic Tests.............3................................ You will get error if you try the following JCL........................................2..1........1.. 166 3.................21.....................................................................1................ 170 3............ 158 3.........2........................................ 162 3.................................................................................................................................. A simple JCL for SORT ................................count the records...... 162 3..............................................................

............................... 199 6............................................... 194 5.....................................9......................................................................... 196 5.........13....................... 196 5............. 202 6... Auto complete .... 200 6...................3........................4.................... No space in directory ......... VSAM Overview ....................................2...............1................................3........................1............... 193 5................ Control Interval............ FLIP ......................... 211 An Introduction to Mainframes ....... 197 Chapter ...............11... CUT/PASTE ..........................................................2...................... VSAM Data Sets................1................................................................................................ NRETRIEV....3............................................................................ VSAM – Tips and Tricks........................ 209 6.......................... Record Management ................................1...............8.. 200 6..............12..............2.................... REPLACE.........................................................................................................................1.... TSO SEND/TRANSMIT .................................................................. 205 6............................. 193 5....9. Tape Datasets ..................2...............................................................6........4............... 193 5..................................................11 - .................................. Logical Record & Physical Record......................................................................................................... 200 6........................................9.....................................1............................ 199 6.......... 200 6.......................... RRDS ...............................1. 206 6... 195 5............. 194 5. Save a sequence of commands....................................................................................... 192 5.................... CREATE/REPLACE .......................... 192 5.....4............................2.............................. Accessing & Inserting VSAM Data..........2.. 199 6.................................................... 193 5.............................7. 199 6.............................................................7..................... Information about your DS ......................... What is VSAM?.........................................................................................................1.9......................10................1....14.....................................3................................ PATH and AIX ..............Chapter .........5............................................ 204 6......5 5... Catalog Management .......... 192 5............4....... KSDS .......... SB37 on Saving a DS............................................. 203 6..................................................................2.................2............................................................................................................................................1........1................................. CREATE........1................... Alternate Index........... 192 5.......................................................... TSO/ISPF – Tips and Tricks................................................ ESDS........................... LDS .........................................................5...................... 202 6..................... 194 5................................................. More about VSAM .....................................................................2....6........ 201 6............................................. VSAM Basics....... HRECALL ..................................................5.............. Saving a DS in view mode........................ 192 5....3.. 192 5..... 192 5... ISPF EDITOR COMMANDS ............................... COBOL Compiler Version ......................................................................6 6.......

..................... 232 8.....................................................10........4............................. EDIT............................................. 217 7............2....................6..................................... 215 7. 228 8......................... 240 An Introduction to Mainframes ....................................3............................................. CREATE.... 216 7.... EDITSET or EDSET..........................Data Shift Right...................................2..............21.......12 - .............................................................. LC/LCC............................................................. Comparing 2 files of different layouts .................3............................................... PROFILE .................. ) ... 233 8......................... SETUNDO ...................................................................................................10..........................................................................................................10...............................11.............................. 219 7............ SORT ................................................................ 233 8...... 221 Chapter .............. 236 8.2..........................Column Shift Right .................................................................... 232 8.....................................3... 216 7........................... 235 8...2............................................................................................9.............................. DASD Data Set .............. FLIP ..... 226 8...............................1... ( ....3.......23............ AUTOSAVE ............................................1................................................................. DEFINE ............................................... 235 8................ 239 8........10............7 7............................ 226 8.. RECOVERY .....................................Chapter .. Saving a DS in view mode.................... TS ....................... LOCATE/L ........5....................................... 236 8.......18.........................................................................................................................................................................1................................................................................................................. PROCOPT. CUT/PASTE .......... 232 8.........7.............. 228 8............ L ..................................... BOUNDS .............................. F ...............3..................Column Shift Left....................................................................................................................... 239 8........24............................1......19.................... IMS DL/I DATA BASE TYPES .. 214 7.... COMPARE .12.............. 236 8...................................................................................................................................................... > ......................................................................................... 225 8...................................Data Shift Left ............. BROWSE....................................... O.........................................8. Tape Data Set.........................................................4..22..22.................17........................................... 234 8.................16..2........................................................15...........................20................................................................................................. DEFINING THE IMS DATABASE ........................................................................... 225 8......... 10 Common Abends ...14.. ISPF Editor Commands .....4.................... CHANGE...................................................4.4...... 216 7............................................. 225 8....................................... 214 7..........3. < ...... 225 8............................................................ CREATE/REPLACE ......... 236 8......................................... REPLACE................................ Counting the number of records . General – Tips and Tricks........................................................ 235 8............................................. 240 8...............................................8 8................ 217 7...............................................................................................................................................13............................ 236 8..... 225 8.................................... Processing Options in IMS DB..........1.... 240 8............ 227 8........................

..............25.................... 240 An Introduction to Mainframes ............................................................. 8........................................26..... UC .................8............................................................. 240 UNDO .........13 - .....

1 An Introduction to Mainframes .PART .14 - .

A Brief History of Computing Chapter 1 A Brief History of Computing An Introduction to Mainframes .15 - .

The abacus was so efficient that it soon spread far and wide A Chinese Abacus An Introduction to Mainframes . In short. Computers have made possible such epic achievements as lunar landings. not at least till now.A Brief History of Computing 1. Computer is not really a brain. another piece of machinery devised to reduce labor or extend our mastery of the world Still. communication etc. Abacus A starting point. is a calculating tool for performing arithmetical processes.Abacus. A Brief History of Computing It has been an amazing journey… really it is. you can see the computer takes its shape from an abacus to a lap top machine! What a transformation! The transformation took a slow and steady fashion . Micro Processors… The true brilliance is human: the genius of men and women who have found a way to translate a variety of information from the real world into the zero’s and one’s of binary code – the logical and mathematical language tailor made for a computer’s electronic circuitry the language of the machines. Rather it is simply another tool. Napier’s Bones.1. Transistors. The user. Integrated Circuits. no other machine in history has so rapidly or so thoroughly changed the world. banking. often constructed as a wooden frame with beads sliding on wires. more than 1500 years ago. An abacus. Pascaline…Vacuum Tubes. Despite the headspinning pace of modern advances. medicine. called an abacist. and planetary probes. education. and they account for a myriad everyday conveniences and benefits in the field of science. also called a counting frame. computers have woven into the very fabric of modern life. and probably in the Mediterranean world – was the development of abacus.16 - . As you go through this chapter. slides counters by hand on rods or in grooves. the foundations of the computer revolution were built in slow and fitful fashion 1.

The rods could be arranged so that the answer to a multiplication/division problem could be found. the ‘Napier Bones’ were soon eclipsed by the slide rule. except for the top one.2. Napier’s Bones John Napier published his discovery of Logarithms in 1614 and in 1617 came up with an aid to multiplication called ‘Napier’s Bones’ Napier' Bones. John Napier A rod' surface comprises 9 squares. metal or heavy cardboard. although for obvious reasons it is not necessary for calculations. invented by John Napier for calculation s of products and quotients of numbers The abacus consists of a board with a rim. triple. The Napier' rods consist of strips of wood. and quadruple and so on until the last square s contains nine times the number in the top square. comprises two s halves divided by a diagonal line. and each square. The digits of each product are written one to each side of the diagonal.A Brief History of Computing European thinkers of the era were fascinated by the challenge of devising aids to calculations 1. s Napier' bones are three dimensional. with s four different rods engraved on each one. numbers less than 10 occupy the lower triangle. The figure additionally shows the rod 0. A set of such bones might be enclosed in a convenient carrying case. holding the numbers 1 to 9. and other type of calculators – most notably a mechanical type – An Introduction to Mainframes . I am not detailing the methods for multiplication/division as it is outside the scope of this book Although Napier’s theory of logarithms had an enduring impact. The board' s left edge is divided into 9 squares. with a zero in the top half. and the other squares hold this number' double. the user places Napier' s rods in the rim to conduct multiplication or division. developed by William Oughtred. an abacus. square in cross section. A set consists of 9 rods corresponding to digits 1 to 9.17 - . The first square of each rod holds a single-digit.

Blaise Pascal and Pascaline Blaise Pascal called his machine ‘Pascaline’ which was a boxed ‘wheel-and-cog’ machine. He used the principle of interlocking wheels. the stepped drum — a cylinder bearing nine teeth of different lengths which increase in equal amounts around the drum. Leibniz invented a calculating machine which was a major advance in mechanical calculating.A Brief History of Computing pioneered by a brilliant French man named Blaise Pascal.4. multiplication. Its most serious draw back was its convoluted method of performing any calculations other than simple addition Blaise Pascal Pascaline 1. The Leibniz calculator incorporated a new mechanical feature. which remained central to the operation of most adding machines for next 300 years 1. whose imagination seemed to spawn no end to original ideas . and division easily was invented by a German genius. Gottfried Wilhelm Leibniz and Leibniz’s calculator The first machine that could do subtraction. and his notation is the one in general use since. foundation of virtually all modern computer architectures In 1671.18 - . the stepped drum principle survived for 300 years and was used in many later calculating systems An Introduction to Mainframes .3. He also discovered the binary system.Gottfried Wilhelm Leibniz (1646-1716). He discovered calculus independently of Newton. Although the Leibniz calculator was not developed for commercial production.

A Brief History of Computing Leibniz Leibniz’s Calculator 1.19 - . The Jacquard loom revolutionized the weaving industry. and in its essential features. The loom was programmed by a mountain of punched cards. Joseph Marie Jacquard and Punched Cards The next great advancement had nothing to do with the numbers. French weavers had experimented with schemes for guiding their looms by perforated tapes. is still used today Jacquard’s effort is considered as the first practical use of the binary system Joseph Marie Jacquard Jacquard Loom An Introduction to Mainframes . punch cards or wooden drums In 1804. each controlling a single throw of the shuttles.5. Joseph Marie Jacquard built a fully automated loom that could handle enormously complicated designs. Throughout the 18th century.

Charles Babbage Charles Babbage (26 December 1791 – 18 October 1871) was an English mathematician.A Brief History of Computing 1. and mechanical engineer who originated the idea of a programmable computer In 1822." an arithmetic unit or "mill" capable of performing the four operations of arithmetic. The engine would have been steam-driven and programmed by the punched cards. For the next 10 years. and a printer to display the results. made with toothed wheels on a shaft turned by a crank. The difference engine fared better. enhanced and redesigned it In 1833 Charles Babbage conceived an ambitious plan for a general purpose calculating machine which in many features of its design is functionally analogous to the modern computer. Babbage wrestled with his brain-child. The engine was designed in great detail on paper but it was never completed. philosopher. Charles Babbage wrote a scholarly paper describing a machine that could compute and print lengthy scientific papers.6. but the difference engine grew increasingly complex as he modified. The same year he built a preliminary model of this ‘Difference engine’. all that exists of it are reams of plans and drawings and a small portion of the mill and printer built by Babbage’s son. It was designed to contain a memory or "store. It was modified and rebuilt by the Swedish Pehr George Scheutz. winning a gold medal in the exhibition at Paris Difference Engine Analytical Engine An Introduction to Mainframes .20 - . an input/output system which used punched cards.

and the Computing Scale Company (founded 1901 in Dayton. drew on his work at An Introduction to Mainframes . CTR was formed through a merger of three separate companies: Tabulating Machine Company (founded 1896 in Washington D. the International Time Recording Company (founded 1900 in Endicott). His series of patents on tabulating machine technology. reducing the time required as compared to the previous census by one third. The key person behind the merger was financier Charles R. one aspect of the Analytical Engine – the punched cards appeared in a functioning machine. USA). He formed the Tabulating Machine Company to sell his invention Herman Hollerith Tabulator 1. who brought together the founders of these companies to propose a merger and remained a member of the board of CTR until his retirement in 1930. The president of the Tabulating Machine Company at the time of the merger was Herman Hollerith. History of IBM IBM originated as the Computing Tabulating Recording (CTR) Company.C. first applied for in 1884. and a full statistical analysis in two and a half years. New York. which was incorporated on June 16. The machine was a statistical tabulator built by the American Herman Hollerith to speed up the processing of the returns of the 1890 US census The cards in Hollerith’s tabulator were the size of dollar bill. United States of America. who had founded the company and was a seminal figure in the industry. 1911 in Endicott. The Hollerith’s tabulating machine was a big success.21 - . So swift was Hollerith’s machine that a simple count of the census was ready in six weeks.8. Flint. Herman Hollerith and the Tabulating Machine Just 19 years after the death of Babbage.). Ohio.7.A Brief History of Computing 1.

including employee time-keeping systems. His transition to the use of punch cards. Limited and in February 14. Hollerith was initially trying to reduce the time and complexity needed to tabulate the 1890 Census. Shannon has been called ‘the father of information theory’ Claude Shannon An Introduction to Mainframes . Alan Turing published his seminal paper ‘On computational Numbers’ in the year 1936 In the same year. CTR entered the Canadian market under the name of International Business Machines Co. Generation of Computers The term ‘computer generation’ is often used in relation to the hardware of computers.S.9. In 1917. CTR changed its name to International Business Machines Corporation. weighing scales. Evolution of the First Generation of Modern Computers Around 1930. Over time CTR came to focus purely on the punched card business. scientists began making significant progress towards devising machines for performing complex computations. Sr 1. Watson. Vannevar Bush’s Differential Analyzer ushered in the modern computer age. and ceased its involvement in the other activities. At the helm during this period. It has been claimed that this was the most important master' thesis of s all time. automatic meat slicers. Each phase of computer development is known as a separate generation of computers. 1924. Each phase of development is characterized by the type of switching circuits it utilizes 1. in 1886. laid a foundation for generations of equipment and a core component of what would become IBM. Census Bureau from 1879-82. Thomas J.22 - . The companies that merged to form CTR manufactured a wide range of products.A Brief History of Computing the U. Claude Shannon showed the link between symbolic logic and electrical circuits paving the way for use of electricity in computation machines. Watson Sr became General Manager of CTR in 1914 and President in 1915. in a landmark thesis. punched card equipment. Thomas J.1. Watson played a central role in establishing what would become the IBM organization and culture.9. and most importantly for the development of the computer..

He also noted that the system should work with binary digits. must have a central arithmetic unit (ALU).23 - .2. He wrote that to be both efficient and general purpose. The First Generation The first one of two first generation computers appeared.9.A Brief History of Computing 1. The prototype. went into service cracking top secret German codes during World War II Colossus was designed by engineer Tommy Flowers at the Post Office Research Station. Colossus Mark II Computer In a landmark memorandum published in 1945. with input from Allen Coombs.. a central control unit to orchestrate operations. from one instruction to the next unless modified explicitly An Introduction to Mainframes . laid out in detail the five key components of what is often called the ‘von Neumann architecture’ of the modern computer. Colossus Mark I. The Colossus. a memory. and perform its operations one at a time The von Neumann architecture (Stored program concept) is based on three key concepts that are 1) Data and instructions (program) are stored in a single read-write memory 2) The memory contents are addressable by locations 3) Execution takes place in a sequential fashion i. in 1943.e. an input unit and an output unit. Dollis Hill with input from mathematician Max Newman and group at Bletchley Park. An improved Colossus Mark II was first installed in June 1944. a modern computing system. Hungarian born mathematician John von Neumann. operate electronically. was shown working in December 1943 and was operational at Bletchley Park by February 1944. and ten Colossi had been constructed by the end of the war.

the ENIAC (Electronic Numerical Integrator And Calculator) was unveiled by J. Presper Eckert and John Mauchly in the year 1946 at the University of Pennsylvania in USA. It has a very small memory and it was used for calculating the trajectories of missiles.500 relays 70.A Brief History of Computing John von Neumann John von Neumann model The first generation computers used vacuum tubes and machine language was used for giving instructions. This computer used high speed vacuum tube switching devices.000 watts of electricity. The computers of this generation were very large in size and their programming was a difficult task. ENIAC Based on the above principles. 10.9.000 capacitors. The following computers belong to the first generation 1. used 150.468 vacuum tubes. 6000 switches. When ENIAC was built.000 resistors. 7. it was 5000 times faster than the closest competitor MARK-1 ENIAC An Introduction to Mainframes . the first large scale electronic digital computer.200 crystal diodes. weighed 30 tons. contained 17. The first generation computers used the concept of ‘stored program’.1. This giant machine was 30X50 feet long.24 - .2. It took 200 microseconds for addition and about 2800 microseconds for multiplication. 1. which are a commonplace even today.

9. very large space requirement and limited programming capabilities. It also used Neumann concept of ‘stored program’. short for Electronic Delay Storage Automatic Computer was built by M. EDVAC The binary arithmetic was used in the construction of a computer called Electronic Discrete Variable Automatic Computer (EDVAC).2. high power consumption. With this.2. the operation became faster since the computer could rapidly access both the program and data 1.4.2. completed in 1950. restricted computing capacity. Further researches in this line aimed at removal of these limitations UNIVAC An Introduction to Mainframes .3.A Brief History of Computing 1. This allowed easy implementation of program loops 1. This computer also used vacuum tubes Initial applications of computers those days were in science and engineering but with the advent of UNIVAC – I. One such computer was UNIVAC – I. UNIVAC – I Commercial production of stored program electronic computers began in the early 50’s. built by Univac division of Remington Rand and delivered in 1951. The von Neumann concept of stored program was also applied in EDVAC.2.25 - .9. short mean time between failures. the prospect of commercial application were perceived The first generation computers suffered from some ‘big’ limitations like slow operating speed.V Wilkes at Cambridge University in 1949 and used mercury delayed lines for storage.9. EDSAC The EDSAC.

resistors and capacitors along with the associated circuitry encapsulated in a small package with many leads Jack Kilby is probably most famous for his invention of the integrated circuit. Batch operating systems ruled the second generation computers 1. It replaced the vacuum tubes. among other things. operating systems came into being.9. A single integrated circuit has many transistors. With speedy CPUs and the advent of magnetic tape and disk storage. The Third Generation The Third Generation was ushered by the invention of the integrated circuit. broadcast newsman. for which he received the Nobel Prize in Physics in the year 2000.3. After his success with the integrated circuit Kilby stayed with Texas Instruments and.A Brief History of Computing 1.4. was introduced Vacuum tube and the Transistor LEO In 1952. COBOL. William Shockley and Walter Brattain invented the transistor in 1947 at Bell Labs. The Second Generation John Bardeen. In 1951. the first business computer – the LEO. Walter Cronkite used a UNIVAC computer to predict a presidential election The increased reliability and availability of large memories paved the way for the development of high level languages such as FORTRAN.26 - . Algol and Snobol etc. he led the team that invented the hand-held calculator An Introduction to Mainframes .9. reducing the size and increasing the speed of the computer.

relatively inexpensive and faster. The CPUs became much more powerful with the capacity of carrying out 1 million instructions per second (MIPS) The third generation computers using integrated circuits proved to be highly reliable. This was done by adding the metal as a final layer and then removing some of it so that the wires needed to connect the components were formed. Magnetic disk technology also improved and it became feasible to have drive having capacity up to 100MBs. technology developed to medium scale integrated (MSI) circuits with 100 transistors per chip. s s mainly the problem of interconnecting all the components on the chip. Jack Kilby Robert Noyce From small scale integrated (SSI) circuits which had about 10 transistors per chip. Besides being one of the early pioneers of the integrated circuit.27 - . Noyce' circuit solved several practical problems that Kilby' circuit had. This made the integrated circuit more suitable for mass production. The size of main memories reached about 4 megabytes. Less human labor was required at assembly stage. Intel is one of the largest manufacturers of integrated circuits in the world. Examples of some mainframe computers developed during this generation are IBM 360 An Introduction to Mainframes . He did it half a year later than Jack Kilby. Robert Noyce also was one of the co-founders of Intel.A Brief History of Computing Integrated Circuit Robert Noyce came up with his own idea for the integrated circuit.

The Fourth Generation The advent of the microprocessor chip marked the beginning of the fourth generation computers. Honeywell -6000 series. entered the personal computer market with the IBM PC Original IBM PC An Introduction to Mainframes . Radio Shack TRS-80 and the Commodore 1981: IBM. ICL -1900 series. Medium Scale Integrated (MSI) circuits yielded to Large and Very Large Scale integrated (VLSI) circuits packing about 50000 transistors in a chip. Semiconductor memories replaced magnetic core memories. Some mini computers developed during this phase are ICL -2903 manufactured by International Computers Limited. Bill Gates and Paul Allen created the first personal computer software – a form of BASIC for the Altair 1977: Three mass-market personal computers emerged in one year: the Apple II. CDC -1700 manufactured by Control Data Corporation and PDP -11/45 (Personal Data Processor -11/45) from Digital Equipment 1.9.5.28 - . Honeywell Model 316. long dominated in big computers.A Brief History of Computing series. IBM 370/168. The emergence of the microprocessor (CPU on a single chip) led to the emergence of extremely powerful personal computers. Computer costs came down so rapidly that these found places in most offices and homes. ICL -2900. The faster accessing and processing speeds and increased memory capacity helped in development of much powerful operating systems 1971: Ted Hoffman designed the Intel 4004 microprocessor – a single chip with all the basic parts of a central processor – triggering a series of new developments 1974: Ed Roberts of MITS built a microcomputer called Altair 1975: Students.

The computers are being applied in various areas like simulation. Many of the mainframe CPU features became part of the microprocessor architecture in 90s.66GHz) Up to 4GB DDR2 160GB An Introduction to Mainframes .A Brief History of Computing The second decade of the fourth generation observed a great increase in the speed of microprocessors and the size of main memory. visualization.29 - . parallel computing. multimedia etc. virtual reality. Also RISC (Reduced Instruction Set Computers) microprocessors are preferred in powerful servers for numeric computing and file services The computer networks came of age and are one of the most popular ways of interacting with computer chains of millions of users. At the time of writing. The speed of microprocessors and the size of main memory and hard disk went up by a factor of 4 every 3 years. a Lenovo M series has the following configuration Lenovo M series Processor: Memory: Hard Drive: Up to dual-core processor Up to 8GB Up to 500GB And a Lenovo Y series Home/Home office widescreen has the following configuration Lenovo Y series Processor: Memory: Hard Drive: Up to Intel® Core™2 Duo Processor T5450 (1.

The Fifth Generation The fifth generation computers are on the way! The researchers are aiming at developing a machine that can be spoken to in simple plain language and is able to converse the way we human beings do. it is widely believed at the time.A Brief History of Computing 1.30 - . An Introduction to Mainframes . The fifth generation.6. The robots of science fiction will be science facts by the end of this century if these researches meet their goal.9. For this the concept of Artificial Intelligence (AI) is being used (Don’t worry about the Matrix movie). would turn to massive numbers of CPUs for added performance.

31 - .Computer Classifications Chapter 2 Computer Classifications An Introduction to Mainframes .

you can see mainframes come under the classification of ‘Size and Performance Wise’ 1) Digital Computers 2) Analog Computers 3) Hybrid Computers COMPUTERS DIGITAL ANALOG HYBRID Purpose Wise Size and Performance Wise Special Purpose General Purpose Micro Mini Mainframe Super 2. Computers used for business and scientific applications are digital computers. By counting. Digital Computer Encyclopedia Britannica defines a digital computer as any of a class of devices capable of solving problems by processing information in discrete form. Computer Classifications The computers have been classified into three categories.32 - . and manipulating these digits or their combinations according to a set of instructions held in its memory. letters. It operates on data. Digital computers can be further classified in two ways 1) Purpose wise 2) Size and Performance Wise An Introduction to Mainframes . that are expressed in binary form—i. and symbols.Computer Classifications 2. comparing.e. using only the two digits 0 and 1.. including magnitudes.1.

laptops. this type of computer works efficiently but such computers are not versatile 2. training. a microcomputer is most often taken to mean a computer with a microprocessor as its CPU. Special Purpose Computer Special Purpose Computer is the one that is designed to perform a specific task. These are mainly used in offices. Minicomputers are mainly multi user systems where many users simultaneously work on the systems. This category is termed micro because the CPU was created on a single chip. These computers are very versatile Size and performance wise digital computers can be classified into four types 2. designed for performing basic operations like educational. Mini computers possess greater storage capacity and An Introduction to Mainframes .33 - . Another general characteristic of these computers is that they occupy physically small amounts of space. Although the terms are not synonymous.4. Minicomputer Minicomputers are more powerful computers than micro computers in terms of processing power and capabilities.1.1. desktops. homes.3. schools. The instructions (programs) to carry out the task are permanently stored in the machine. Microcomputer Although there is no single definition.1.2. notebooks are examples of Micro computers A Lenovo M series Desktop A Lenovo Y series Laptop 2. shops. The programs are not permanently stored but are input at the time of execution. many microcomputers are also personal computers (in the generic sense). For the specific tasks. Work stations.1. small business applications. These are normally single micro processor. General Purpose Computer General Purpose Computer is the one that can work on different types of programs input to it and thus being used in countless applications. playing games etc.Computer Classifications Purpose wise digital computers are classified into two types 2. stores etc. single user systems.1.

Computer Classifications larger memories as compared to micro computers.34 - . and servers. manufacturing. workstations (Sun Microsystems and general UNIX/Linux parlance). etc. process control. HP has a popular mini computer range branded HP9000 Unlike Micro computers. most mini computers provide more than one terminal so that several people can use the system at one time. They are also used in factories to control automated assembly lines.output devices Mini computer lies in the middle range of the computing spectrum. Formerly this class formed a distinct group with its own hardware and operating systems. IBM also creates a very popular mini computer range with a branding of the AS/400. The minicomputer is used when large groups need access to data simultaneously. More modern terms for minicomputer-type machines include midrange systems (IBM parlance). Popular makers of minicomputer include DEC (Digital Equipment Corporation) – that built the popular VAX minicomputer. 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. being typically just a more powerful but still compatible version of a personal computer. 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. These computers are capable of handling more input . contemporary middle-range computers are not well differentiated from personal computers. in between the largest multi-user systems (mainframe computers) and the smallest single-user systems (microcomputers or personal computers). While the distinction between mainframe computers and smaller computers remains fairly clear. A system like this is called a multi user system We can see few examples of midrange (mini) computers IBM System i™ 515 Express An Introduction to Mainframes .

Linux. AIX 5L™ : Up to 2 TB : Up to 381 TB : 31500 to 216000 CPW Designed for large enterprises. computer manufacturers don’t always use the term mainframe to refer to mainframes.is a measure used in IBM' AS/400 and i s Series line of computers to compare computer system models in terms of how efficiently each system processes a typical workload of commercial applications involving frequent database access. most have taken to calling any commercial-use computer—large or small—a server. an IBM System i™ 595 has the following features Software Memory (Range) Disk (Range) Processor performance : i5/OS. AIX 5L™ : Up to 16 GB : Up to 560 GB : POWER5+ 1.5. A mainframe is the central data repository or hub in a corporation’s data processing center. and a range of updating complexity. Mainframe Computer Today. The CPW also represents a test of database commitment control.35 - . IBM. the System i™ 595 offers multiplatform management and maximum flexibility for customers requiring up to 64–way symmetrical multiprocessing capability CPW stands for Commercial Processing Workload . an IBM System i™ 515 Express has the following features Software Memory (Range) Disk (Range) Processor IBM System i™ 595 : i5/OS®. Windows Server®. now refers to its mainframes as zSeries servers. for example. linked to users through less powerful devices such as workstations or terminals. 2.1. Linux®. Windows Server™. with the mainframe simply being the largest type of server in use today. The presence An Introduction to Mainframes . Instead.Computer Classifications At the time of writing. concurrent data access by many users.9 GHz At the time of writing.

with some installations being much larger than this.” Early mainframe systems were housed in enormous. a typical mainframe occupied 2000-10. and mainframes become ever more flexible and multi-purpose. This increases the likelihood that the data is current. Having data centralized in a single mainframe repository saves customers from having to manage updates to more than one copy of their business data. often involving dedicated operations staff who use detailed operations procedure books and highly organized procedures for backups. This distinction. During their largest period in terms of physical size. Clearly. training. transaction servers. The mainframe required large amounts of electrical power and air-conditioning. while their functionality and capacity continued to grow. Instead. Mainframe systems today are much smaller than earlier systems--about the size of a large refrigerator. mainframe processors and most of the I/O devices became physically smaller. An Introduction to Mainframes . A style of operation. room-filling metal boxes or frames. the word typically applies to some combination of the following attributes: • • • • • Compatibility with mainframe operating systems. applications. the term “mainframe” has expanded beyond merely describing the physical characteristics of a system. so a working definition can be “a mainframe is what businesses use to host the commercial databases. Hardware and operating systems that routinely work with hundreds or thousands of simultaneous I/O operations.000 square feet.Computer Classifications of a mainframe often implies a centralized form of computing. Centralized control of resources. with automatic locking and protection against destructive simultaneous use of disk data. and data. Starting around 1990. and this is probably how the term mainframe originated. Also.36 - . is rapidly blurring as smaller machines continue to gain in processing power. recovery. Hardware and operating systems that can share access to disk drives with other systems. however. rather than a distributed form of computing. and applications that require a greater degree of security and availability than is commonly found on smaller-scale machines. a typical installation had several mainframes installed with most of the I/O devices connected to all of the mainframes. and disaster recovery at an alternate site. and the room was occupied mostly by I/O devices.

An Introduction to Mainframes . with database access controlled at the record level. Additional data and resource sharing capabilities. for example. known as Parallel Sysplex. It has one to 4 processors and the processor memory ranges from 8GB to 32 GB IBM System z9 Enterprise Class It has one to 54 n-way processors and a processor memory range of 16 GB to 512 GB 2. This configuration.Computer Classifications • Clustering technologies that allow the customer to operate multiple copies of the operating system as a single system. or discontinue using existing applications. as well as new granular growth options.1. but allows for systems to be added or subtracted as needed while applications continue to run. In a Parallel Sysplex. Super Computer Super computers are the most powerful computers among digital computers.6. This flexibility allows mainframe customers to introduce new applications. • We can see few examples of mainframe computers IBM eServer zSeries 890 The IBM eServer zSeries 890 (z890) includes zSeries functionality at a lower entry capacity level than previously available on IBM z/Architecture™ hardware. in response to changes in business activity. is analogous in concept to a UNIX cluster. it is possible for users across multiple systems to access the same databases concurrently.37 - . These consist of several processors running together thereby making them immensely faster and powerful.

Computer Classifications The term "Super Computing" was first used by New York World newspaper in 1929 to refer to large custom-built tabulators IBM made for Columbia University. He then took over the supercomputer market with his new designs. holding the top spot in supercomputing for five years (1985–1990) The Cray-2 was the world' fastest computer from 1985 to 1989 s Columbia Supercomputer / NASA Advanced Supercomputing Facility An Introduction to Mainframes . Supercomputers introduced in the 1960s were designed primarily by Seymour Cray at Control Data Corporation (CDC). Cray Research.38 - . and led the market into the 1970s until Cray left to form his own company.

Examples of super computers are CRAY X-MP/14.9 Applications Center / US Computational Research 117.3 Germany New Mexico Computing 126. The supercomputers vary radically with respect to the number of multiprocessors per cluster. Recently. and the number of simultaneous instructions per SIMD processor. A multiprocessing computer is a computer. has been ranked fourth in the widely anticipated top 500 list released at an international conference on high performance computing in Reno. NEC SX – 2. Each computer runs under a separate instance of an Operating System (OS). It could also be high performance processor or a low power processor. nuclear science research.8 Radio Establishment / Sweden Site/Country Maker IBM IBM SGI HP HP An Introduction to Mainframes .Computer Classifications Supercomputers are mainly used in applications like weather forecasting. the number of processors per multiprocessor. ANURAG As of November 2006. PARAM. Nevada and the Indian Super computer has been adjudged the fastest in Asia Computer BlueGene/L BlueGene/P ICE 8200 HP 3000 BL460c HP 3000 BL460c Speed (Teraflops) Lawrence Livermore 478. a cluster platform at Pune’s (India) Computational Research Laboratories. Within this hierarchy we have: A computer cluster is a collection of computers that are highly interconnected via a highspeed network or switching fabric. CDC -205. ETAGF – 10. each processor of which is SIMD (Single Instruction stream Multiple Data stream).9 Laboratories / India Swedish National Defense 102. a TATA subsidiary. The processor could be a general purpose commodity processor or special-purpose vector processor. seismology etc.39 - . operating under a single OS and using more than one CPU. An SIMD processor executes the same instruction on more than one set of data at the same time. FUJITSU VP – 400. where the application-level software is indifferent to the number of processors. The processors share tasks using Symmetric multiprocessing (SMP) and NonUniform Memory Access (NUMA). aerodynamic modeling. Each of them is a cluster of MIMD (Multiple Instruction stream Multiple Data stream) multiprocessors.2 National Laboratory / US Jülich Research Centre / 167. the top ten supercomputers on the Top 500 list have the same toplevel architecture.

a joint development of IBM and the US department of energy’s National Nuclear Security Administration and installed at DOE’s Lawrence Livermore National Laboratory.g. The devices that measure such quantities are analog devices e. Computational Research Laboratories has integrated this system with its own innovative routing technology and achieved a speed of 117. Hybrid computers are best used in hospital where analog part is responsible for measurement of patient’s heart beat.9 teraflop. An electronic weighting scale is an example of an analog computer 2.3. Computations are carried out with physical quantities such as voltage. temperature etc. Analog Computer In analog computers. length. current. blood pressure. The main advantage of analog computers is that all calculations take place in parallel and hence these are faster. Hybrid Computer Hybrid computers utilize the best qualities of both the digital and analog computers.Computer Classifications The TATA supercomputer. is a Hewlett Packard Cluster Platform 3000 BL460c system.2. voltmeter ammeter. Analog computers are used mostly in engineering and scientific applications. California IBM BlueGene/L Super Computer 2. Analog computers operate by measuring rather than counting. continuous quantities are used. named EKA after the Sanskrit term for one. In these computers some calculations take place in analog manner and rest of them take place in digital manner. temperature and other vital signs and then the operation is carried out in digital fashion to monitor patient’s vital signs. But their accuracy is poor as compared to digital counterparts. Hybrid computers are also used in weather forecasting An Introduction to Mainframes .40 - . A teraflop is a trillion floating point operations per second The number one position has been claimed by the BlueGene/L System.

41 - .More about Mainframes Chapter 3 More about Mainframes An Introduction to Mainframes .

and reliability are critical to the efficient and secure operation of contemporary information processing. A common impression of a mainframe user interface is the 80x24 character “green screen” terminal. a result of careful and steady technological advances since the introduction of System/360 in 1964. Processor memory ranges from 16GB to 256GB) Businesses today rely on the mainframe to: • • • • Perform large-scale transaction processing (thousands of transactions per second) Support thousands of users and application programs concurrently accessing many resources Manage terabytes of information in databases Handle large-bandwidth communications An Introduction to Mainframes . as well as many other types of work. production and inventory control. mission-critical applications. scalability.” Many of today’s busiest Web sites store their production databases on a mainframe host. payroll. named for the old CRT-based computer terminals from years ago that glowed green.More about Mainframes 3. there is often a mainframe computer providing crucial function “behind the scenes. evolutionary improvement. When a business application is accessed through a Web browser. financial transactions. However.42 - . These applications typically include customer order processing. current mainframe interfaces can look much the same as those for personal computers or UNIX systems. the mainframe is often used by IT organizations to host the most important. Because of these design strengths. IBM eServer zSeries 990 (1 to 32 Processors. we will see more about it now The mainframe owes much of its popularity and longevity to its inherent reliability and stability. No other computer architecture in existence can claim as much continuous. while maintaining compatibility with previous releases. New mainframe hardware and software are ideal for Web transactions because they are designed to allow huge numbers of users and applications to rapidly and simultaneously access the same data without interfering with each other. This security. More about Mainframes We have seen a brief introduction about mainframes in the previous chapter.

More about Mainframes 3. To protect data and to maintain the resources necessary to meet the security objectives. Reliability. or destruction. Availability. a controlled maintenance process. customers typically add a sophisticated security manager product to their mainframe operating system. a state of the art mainframe system might be said to provide high availability and fault tolerance. Factors Contributing to Mainframe use The reasons for mainframe use are many. data security is defined as protection against unauthorized access. Security In an IT environment. and Serviceability Reliability: Involves the use of high quality components.1. and system software designed for unlimited availability all help to ensure a consistent.1. either hardware or software Beyond Reliability.3. for example. The customer’s security administrator often bears the overall responsibility for using the available technology to transform the company’s security policy into a usable plan A secure computer system prevents users from accessing or changing any objects on the system. Scalability By scalability we mean the ability of the hardware. hardware components have extensive self checking and self recovery. Software reliability involves extensive testing and quick updates for detected problems Availability: The ability to recover from a failed component without impacting the rest of the running system.1. and Serviceability (known as RAS). transfer.1. This applies to hardware recovery (by automatically replacing failed elements with spares) and software recovery (through layers of error recovery provided by the operating system) Serviceability: Allows for the replacement of elements (hardware and software) while impacting as little of the operational system as possible. enhanced storage protection.43 - . the ability to retain An Introduction to Mainframes . but most generally fall into one or more of the following categories 3. including user data. It also implies well defined units of replacement.2. except through system provided interfaces that enforce authority rules. software.1. Redundant hardware components in critical paths. Mainframe computers can provide a very secure system for processing large numbers of heterogeneous applications that accesses critical data 3. modification. Availability. In addition. or a distributed system to continue to function well as it is changed in size or volume. whether accidental or intentional. highly available environment for business applications in the event that a system component fails 3.

with larger or smaller networks performing tasks of varying complexity. Some applications were written many years ago. Applications must continue to work properly.1. including personal computers (PCs). which have been upgraded many times since the first System/360 mainframe computer was shipped in 1964. does some computing or processing and produces information.More about Mainframes performance levels when adding processors. the impressive term “data set” on a mainframe turns out to be just a “file” on a PC The computer is essentially a device that reads some data. and directs the operation of the computer. IBM’s latest zSeries mainframes exhibit scalability characteristics in both hardware and software. initiates input/output. or Central Processing Unit Central Storage – also called real storage or computer memory Input and output devices. with the ability to run multiple copies of the operating system software as a single entity called a system complex of Sysplex 3. The main computer hardware that concerns you consists of • • • The CPU. It is the part of the computer that does the processing Central Storage: The computer memory holds both the instructions and data during computations and is termed central storage or real storage I/O Devices: The input/output contains external data An Introduction to Mainframes . and storage.44 - . much of the design work for new hardware and system software revolves around this compatibility requirement. Thus. let us look into the different aspects in detail While large mainframe computers have essentially the same hardware components as all other computers. tapes. the terminology is totally different. such as disks. Likewise. while others may have been written “yesterday. Continuing Compatibility Some of the mainframe applications have been developed and refined over decades. The formidable-sounding “Direct Access Storage Device” (or DASD) on a mainframe becomes the more unassuming “hard disk” on a PC. Given a brief about the mainframes. and printers CPU: The central processing unit executes instructions to perform computations.4. A scalable system can efficiently adapt to work. memory.” The need to support applications of varying ages imposes a strict compatibility demand on mainframe hardware and software.

2.1. they are processed on the mainframe without user interaction. manage. and produces output. it is not as commonplace as on mainframes because distributed systems often lack: • • • Sufficient data storage Available processor capacity or cycles Sysplex-wide management of system resources and job scheduling Mainframe operating systems are usually equipped with sophisticated job scheduling software that allows data center staff to submit. and track the execution and output of batch jobs. For example. Typical Mainframe Workloads Most mainframe workloads fall into either of two categories: batch processing and online transactional processing. reads and process data in bulk. mainframe systems make it possible for banks and other financial institutions to produce end-of-quarter processing when such reporting is necessary to customers The applications that produce these statements are batch applications.2. Batch Processing One key advantage of a mainframe is its ability to process terabytes of data from high speed storage devices and produce valuable output. An Introduction to Mainframes . A batch job is submitted on the computer.45 - . including Web based applications 3. such as customer billing statements While batch processing is possible on distributed systems.More about Mainframes Input/Output Operations Interface CPU Central Storage I/O Devices 3.

Information is generated about large numbers of users. teller systems for customer service Insurance .2. A scheduled batch process can consist of the execution of hundreds or thousands of jobs in a pre-established sequence.2. During batch processing. Interactive response time is usually not the primary requirement. Consolidated information such as profitability of investment funds.More about Mainframes Batch processes have the following characteristics: • • • • Large amounts of input data are processed. processing of daily orders and updating of inventories are typical examples of batch processing Batch Job Input Data Application Program Process data to perform a specific task Output 3. batch jobs often must complete within a “batch window.Agent systems for policy management and claims processing Travel and Support – Airline/railway reservation systems Manufacturing – Inventory control. Some industry uses of online systems Bank – ATMs. license issuance and management An Introduction to Mainframes . many types of work can be generated. and a large volume of output is produced.46 - . However. scheduled database backups. Online Transactional Processing Mainframes serve a vast number of online transaction processing (OLTP) systems. production scheduling Government – Tax processing. stored records accessed. These are mission critical applications that businesses depend on for their core functions.” a period of less intensive online activity prescribed by a service level agreement.

It combined micro electronic technology.1. On a transaction by transaction basis. we will see the important milestones 3. A peep into the history I don’t wish to write a long history log. the Model 195 was at the time.47 - .3. the user enters data and receives output back from the system Online (real time) transaction Application Program Access shared data on behalf of on-line user 3. with significant advances in the concepts of computer organization System/360 Model 195 Launched in 1969.3. the most powerful computer in IBM' s product line. An Introduction to Mainframes . System/360 IBM introduced System/360 on April 4 -1964. a user working at a display station interacts with the computer. which made possible operating speeds measured in billionths of a second.More about Mainframes In an online interactive system.

Microelectronic circuits .range from 2.basic pulse beat of a s computer . An Introduction to Mainframes . without reprogramming. Some of the most significant advances represented by the new IBM System/360 include: Solid Logic Technology . regardless of distance.all available within a single system using one set of programming instructions . Internal processing power of the largest System/360 configuration is approximately 50 times greater than that of the smallest. these tiny devices operate at speeds ranging from 300 down to six billionths-of-a-second. Control memories operate in as little as 250 billionths-of-a-second.000 characters of information . Transistors and diodes mounted on the circuits are only 28 thousandths-of-an-inch square and are protected by a film of glass 60 millionths-of-an-inch thick.containing up to 524. It is the balancing of these factors .A hierarchy of memories within System/360 makes information in core storage available at varying speeds.product of IBM' Solid Logic s Technology . The system' machine cycle time . Incorporated with these are more than 40 types of peripheral equipment which store information and enter it into and retrieve it from the computer.that will make it possible for a user to select a configuration suited to his own requirements for both commercial and scientific computing.5 millionths-of-a-second down to one millionth-of-a-second. a user can expand his System/360 to any point in its performance range. depending on need.48 - . Small local store memories operate in as little as 200 billionths-of-a-second. It was developed to perform information handling jobs encompassing all types of applications.000. Called logic circuits because they carry and control the electrical impulses which represent information within a computer.More about Mainframes System/360 is a single system spanning the performance range of virtually all the then IBM computers . Built-in communications capability makes System/360 available to remote terminals. System/360 core storage memory capacity ranges from 8. The equipment is supported by programs which enable System/360 to schedule its own activities for non-stop computing that makes most efficient use of system capabilities.make up the system' basic componentry.from the widely used 1401 to nearly twice that of the most powerful computer previously built by the company.000 characters of information to more than 8. System/360 is the first commercially s available data processing system whose design is based on the use of microminiaturized computer circuits. Memory power . Information storage devices linked to the system can store additional billions of characters of data and make them available for processing at varying speeds. With the same type of input/output devices.ranges from one millionth-of-a-second to only 200 billionths-of-a-second.000. System/360 includes in its central processors 19 combinations of graduated speed and memory capacity. Powerful main memories .

with equal effectiveness. Watson.2. or a combination of the two. It is the product of an international effort in IBM' laboratories and plants and is s the first time IBM has redesigned the basic internal architecture of its computers in a decade.The traditional distinction between computers for commercial and scientific use is eliminated in System/360.49 - . This is the beginning of a new generation . Mr.000 characters in bulk core storage . Users will be able to process both business and scientific problems.not only of computers . the IBM System/370 was announced.each character available in eight millionths-of-a-second and each at the direct command of a computer programmer.3. Application versatility . said: "System/360 represents a sharp departure from concepts of the past in designing and building computers. System/370 Models 155 and 165 could provide computer users with dramatically higher performance and information storage capacity. The computer' historic limitations on memory size s are overcome by this development. More than 100. the then IBM s Board Chairman.000. Please see the figure in the next page An Introduction to Mainframes . The result will be more computer productivity at lower cost than ever before.Built into System/360 is the ability to respond to inquiries and messages from remote locations at any time. System/370 In 1970. Hundreds of terminal devices can communicate simultaneously with a system while the computer continues to process the basic job on which it is working.More about Mainframes A key development provides 8. science and government.000 businessmen in 165 American cities attended meetings at which System/360 was announced! At a press conference at the company' Poughkeepsie facilities. This is over sixty times more directly addressable characters than were previously available in IBM computers. a new computer system. Communications capability . This versatility is reinforced by the variety of peripheral equipment which is part of the system.but of their application in business." 3.

• • An Introduction to Mainframes . remote computing and high throughput multiprogramming. streaming them into the central processing unit on demand at nanosecond speeds. 2821 Control Unit (right background). The ability to handle up to 15 different program tasks simultaneously. Monolithic buffer storage that holds data and instructions ready before they are actually needed. microscopic in size. 3066 System Console (center background). that perform logical and arithmetic operations at speeds measured in nanoseconds. IBM had built in many advances keyed to reliable performance. To help customers exploit the full throughput potential of System/370. 2314 Direct Access Storage Facility (right middle) and IBM 2305 Fixed Head Storage (right foreground). including programs written for the IBM 1400 and 7000 series. Main core memories having capacities up to 2-million bytes for the Model 155 and 3million for the Model 165. Expanded channels to carry more data faster between memory and other system units. This "white room" design model includes (from left) eight IBM 3420 Magnetic Tape Units and a single 3803 Tape Control. two 2540 Card Read Punch Units (foreground right center). including: • • • Monolithic integrated circuits. The buffer effectively matches the data from the larger but slower main memory to the very high internal speed of the processor. as well as System/360.More about Mainframes System/370 Model 165 The Model 165 of 1970 was designed to handle large data bases. three 2821 Control Units (background). four 1403 N-1 Printers (foreground left center).50 - . These new channels are analogous to pipelines whose width and flow pressure have been increased.

More about Mainframes This image of the Model 165 provides a close-up view of the operator' console (foreground) s and the IBM 2314 Direct Access Storage facility (background) Let’s take a deviation from the history and see few of the jargons in detail so that the reading will be smooth.51 - . The central components of mainframe computer system are the processors. CPU MAIN STORAGE Channel 0 Channel 1 Channel 5 Channel 6 An Introduction to Mainframes .

2. Multiprocessing To understand what a multiprocessor does. on the other hand. 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. called ESCON (Enterprise System Connection).52 - . A Multiprocessor. another processor can handle an interrupt and so on. This relatively small amount of storage operates at speeds even faster than the storage in main memory. the I/O device’s cabinet. while one of the processors initiates an I/O operation. In the above figure.3. the processor consists of 3 main parts: CPU. can share system resources and work.Plus additional wires for control signals. These channels use a parallel architecture which means that the cable transmits all of the bits that make up a byte simultaneously. 3. the processor in the above figure can connect up to 56 control units. a control unit may be housed within the processor’s cabinet. For example. Fiber optic cable is not only 80 times lighter than copper table.2. let us focus on the term single processor. The result is that parallel channel cable is both heavy and expensive. Main Storage and Channels. or in its own cabinet. A single processor or uniprocessor contains its own main storage and is controlled by a single OS. As a result. Each channel can connect up to 8 devices called control units that connect to I/O devices. IBM announced a new channel architecture. Channels The purpose of a channel is to provide a path between the processor and an I/O device. which is based on fiber optic rather than copper table. the cable must have a separate wire for each bit – Sixteen in all (the channel sends two bytes simultaneously) . but also 50 times less bulky.3. As you can see. there are 7 channels. To do that.More about Mainframes The figure shows the basic arrangement of the subcomponents that make up a typical System/370 type processor. There are two types of multiprocessing systems • • Loosely coupled multiprocessing : where processors operate under separate operating systems. In 1990. most System/370 processors use a special purpose high speed memory buffer called a cache that operates between the CPU and Main Memory.2. there are 7 different paths along which data can pass between the processor and I/O device. The CPU contains the circuitry needed to execute program instructions that manipulate data stored in main storage. yet share access to data Tightly coupled multiprocessing : where processors operate under the same OS 3. As a result. Although the figure doesn’t show it. ESCON will allow many An Introduction to Mainframes . so the overall speed of the processor is increased Special circuitry constantly monitors access to main memory and keeps the most frequently accessed sections in the cache. Depending on the processor and the device.1.

5. memory. I/O Devices I/O devices are the devices that connect to a processor to provide it with input.The name Unit record device implies that each record processed by the device is a physical unit. 3. multiprocessor configurations were considered exotic.2. This lets installations locate disk devices on another floor or even in another building.An LPAR (Logical Partition) contains resources (processors.3. a new channel architecture – S/390 Fiber Connectivity (FICON) – provides a new high performance I/O channel.5 MB per second In the new S/390 systems. URDs usually have built in control units that attach directly to channels. an OS designed to emulate multiple computer systems. each of which can function as an independent system. PR/SM At one time. PR/SM can be configured so that a partition is reserved as a backup for a primary partition.2.3. multiple logical partitions can exist within a system 3.4. Unit Record Devices Card Devices and Printers .3. If hardware requirements are met. optimized for efficiency at high speed. ESCON channels are nearly 4 times as fast as standard channels. and input/output devices) and operates as an independent system.53 - . receive output or provide secondary storage. and the facilities for managing them were often inadequate. the backup partition can automatically take over the work that was being processed at the time of the failure.2. Second. ESCON provides two other advantages. current IBM multiprocessors include a feature called Processor Resource/Systems Manager. First it extends the 400-feet cable limit of standard channels to 26 miles.3. LPAR A subset of the processor hardware that is defined to support an operating system . or LPARs. PR/SM allows an installation to divide a multi-CPU processor into several partitions. The common types of I/O devices found on IBM mainframes are 3. Besides its reduced size and weight.3.2. or PR/SM.More about Mainframes data centers to replace literally tons of unmanageable copper cable with neatly organized fiber optic cable. To address this problem. So many installations resorted to VM. but it didn’t provide all of the controls needed to take full advantage of modern multiprocessor configurations.1. transmitting data at 17 MB per second rather than 4. PR/SM also allows the I/O channels assigned to the various partitions to be reconfigured without disrupting the work 3. VM could be configured to take advantage of multiple processors. so separate control units are not required An Introduction to Mainframes . If the primary partition fails.5.

As a result the disk drive can access data on all of those tracks without moving the actuator. As a result. there are as many tracks in a cylinder as there are usable surfaces on the pack. because it allows direct and rapid access to large quantities of data. FBA devices store data in fixed-length blocks Each type of DASD devices requires two kinds of control units to attach it to a processor channel. the lesser the amount of wasted space on a tape.000 lines per minute 3. which in turn transfers ink to paper • Non Impact Printers: use laser technology. the larger the block.3. Data records are normally written to tape in groups called blocks. However there is an extra cost involved when blocking is used: a buffer is required in main storage to contain the entire block.5. IBM manufactures two basic types of disk drives Count-Key-Data (CKD) devices and FixedBlock-Architecture (FBA) devices. As a result. Magnetic Tape Devices How much data a reel or cartridge of tape can contain depends on the length of the tape and the density used to record the data. The component that reads and writes data on the tracks of a disk pack is called the actuator. Tape densities for standard reel tapes are usually 1600 or 6250 bpi.54 - .2. called a storage control.3. Density is a measurement of how many bytes are recorded in one inch of tape. each with 808 tracks has 808 cylinders.3. all of its heads move together so they are all positioned at the same track of each recording surface. So a pack that has 19 surfaces. The larger the block. The number of tracks per surface varies with each device type. the more main storage that is required to contain it 3. The actuator has one read/write head for each recording surface. each with 19 tracks. attaches a group of DASDs of the same type: the resulting group is called a string. CKD devices store data in variable-length blocks. When the actuator moves.2. The first is called a string controller. Data is recorded on the usable surfaces of a disk pack in concentric circles called tracks. and there are as many cylinders in a pack as there are tracks on a surface. Empty spaces called gaps are required to separate blocks from one another. IBM’s 3800 printing subsystem can print at rates of up to remarkable 20.2. The second kind of control unit. Direct Access Device The official IBM term for a disk drive is DASD.5. The tracks that are positioned under the heads of the actuator at one time make up a cylinder. connects up to eight strings of DASD units to a channel An Introduction to Mainframes .More about Mainframes o Card Devices • Card Readers • Card Punches • Reader/Punches o Printers • Impact : produce out put by striking an image of characters to be printed against a ribbon.

it manages the communications functions necessary to connect remote terminal system via modems and telecommunications lines.2. Whether attached locally or remotely.More about Mainframes Special circuitry keeps track of what disk data is accessed most frequently and tries to keep this data in the cache storage. it can be read directly from cache. Data Communications Equipment An installation creates a data communications network (telecommunications network) that lets users at local terminal (terminals at the computer site) and remote terminals (terminals that are not at the computer site) access a computer system At the center of the network is the host system. the most commonly used terminal system on IBM mainframe is the 3270 Information Display system See the figure in the next page An Introduction to Mainframes . Then.6.3. a System/370 processor. the DASD unit doesn’t have to be accessed at all STORAGE CONTROL String Controller String Controller 3.55 - . The control unit that attaches to the host system’s channels is called a communications controller. when that data is referenced.

the processor’s main storage is among the most valuable of the system’s resources. modern mainframe computer operating systems provide sophisticated services to make the best use of the available main storage. As a result. the computer uses disk storage as an extension of real storage An Introduction to Mainframes . Among the most important of these services include virtual storage Virtual storage is a technique that lets a processor simulate an amount of main storage that is larger than the actual amount of real storage. Virtual Storage In most computer systems.7.56 - . I give a brief here to make the understanding easier 3.More about Mainframes Connections Communication Controller Channel Modem Telecommunication Lines Modem Modem T1 Modem T1 T2 Terminal Controller Terminal Controller T2 T3 Printer Terminals Printer T3 Terminals 3. Characteristic Features of Mainframe OS We will see in detail about the mainframe OS.2.7.3. To do this.2.1.3.

Then. A multiprogramming system appears to execute more than one program at the same time The key to understanding multiprogramming is to realize that some processing operations – like reading data from an input device – take much longer than others. spooling (simultaneous peripheral operation online) is used. Other data and instructions can be placed temporarily on disk storage. But the application programs themselves are not slowed down by the relatively slow operation of the printer 3.3. For example. when the program finishes.2. If programs were run one at a time on a mainframe computer. Unfortunately. disk devices are much faster than printers. Spooling manages printer output for applications by intercepting printer output and directing it to a disk device instead. Batch Processing When you use batch processing. Spooling A significant problem that must be overcome by multiprogramming systems is 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 the printer. In other words. that is misleading.2. so the printer is kept as busy as possible. In a multiprogramming environment. only one program can have control of the CPU.2. Multiprogramming simply reclaims the CPU during these idle periods and lets another program execute 3. waiting for I/O operations to complete. the operating system collects its spooled print output and directs it to the printer.3. most programs that run on mainframe computers are idle for a large percentage of the time. virtual storage Operating Systems transfer data and instructions between real storage and disk storage as and when they are needed.4. As a result.3.7. A job may cause one or more programs to execute in sequence.7.7. Multiprogramming Multiprogramming means that the computer lets more than one program execute at the same time.57 - . at any given moment. The OS component that actually prints the spooled output is multi programmed along with the application programs. Actually. only the current program instruction and the data it refers need to be in real storage. the CPU would spend most of its time waiting.2. that defeats the purpose of multiprogramming because the other program has to wait until the printer is available To provide shared access to printer devices. and recalled into main storage when needed. That is because.More about Mainframes The key to understanding virtual storage is to realize that at any given moment. your work is processed in units called jobs.3. the OS stores the spooled output separately on disk so it can print each program’s output separately Another benefit of spooling is that programs can execute faster. 3. one job may invoke the An Introduction to Mainframes .

and produce payroll checks.58 - .7. One of the problems that arise when batch processing is used is managing how work flows through the system.More about Mainframes programs necessary to update a file of employee records. To manage this. the Job Entry Subsystem.2.5. print a report listing employee information. many users compete to use the system’s resources. Time Sharing In a time sharing system.3. In a typical mainframe computer system. while batch job processing is called background processing An Introduction to Mainframes . the user enters commands that are processed immediately. each user has access to the system through a terminal device. because it lets users interact directly with the computer. Instead of submitting jobs that are scheduled for later execution. time sharing is sometimes called interactive processing. or JES processes each user’s job in an orderly fashion 3. Sometimes. timesharing processing is also called foreground processing. As a result.

8.59 - .More about Mainframes 3.3. A small mainframe configuration Impact Printers (2) 3490 Tape Drives (4) 4381 Processor 3880 Storage Controller Operator Consoles (4) 3390 –1 Disk Drives (24) Communications Controller Remote 3270 System Local 3270 System An Introduction to Mainframes .2.

3. the processor appears to have more storage than it actually does. the concepts of virtual storage and multiprogramming are closely related.9. a string of four tape drives is used The 4 operator consoles let system operators control the operation of the system. each of which can store one character. Since the largest number that can be represented in 24 bits is abut 16 million (16 M).9. each containing 8 drives. of information.3. directly attached to the 4381 processor. 3390 are fixed-media DASDs. an address An Introduction to Mainframes . suppose a computer records its addresses using six decimal digits.60 - . An Address space is simply the complete range of addresses – and as a result. the total DASD capacity of this system is about 22 billion bytes. the CPU can execute instructions for another program.999 The original System/370 processors used 24 bit binary numbers to represent addresses. who are based in the same building that houses the computer. their disk packs can’t be removed. provide 12 terminals and one printer. such a computer could access storage with addresses from 0 to 999. In other words when virtual storage is used. The maximum size of a computer’s address space is limited by the number of digits that can be used to represent an address.1 DASDs. Multiprogramming is a facility that lets two or more programs use the processor at the same time. To refer to a particular location. To provide a way to create backup copies of data on the 3390s. So while one program waits for an I/O operation.More about Mainframes For Direct access storage. 3.2. A local 3270 system. you use an address that indicates the storage location’s offset from the beginning of the memory. Since each 3390 model 1 has a capacity of 946 MB. To illustrate. Some of the consoles might be dedicated to specific tasks. the configuration above uses three strings of 3390 model .3. or byte. These terminals are used by the programming staffs. the number of storage locations – that can be accessed by the computer. The key to understanding multiprogramming is realizing that most programs spend most of their time waiting for I/O operations to complete. such as managing the tape drives or controlling the 2 high speed impact printers. Address Space Main storage consists of millions of individual storage locations. Virtual Storage is a facility that simulates a large amount of main storage by treating DASD storage as an extension or real storage.2. MVS Concepts MVS stands for multiple virtual storage. The 3725 communications controller allows remote 3270 systems to access the system via telephone lines. Under MVS.1.

then ESA/390. Because this 16 MB address space limitation severely restricted the capabilities of the System/370. and MVS/XA was designed to operate on 370-XA processors that use 31 – bit addresses. 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. IBM replaced it in the early 1980s with a new architecture known as 370-XA.2. If RMODE = ANY. If RMODE = 24. MVS/ESA also uses 31-bit addresses. can reside anywhere. In the late 1980s and early 1990s. or by default. The default is 24 bit residence 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. MVS breaks real storage.61 - . These designs utilize the same 31 – bit addresses that 370-XA uses. The RMODE attribute is assigned as input to the assembler or the linkageeditor. but runs only on ESA/370 and ESA/390 processors.2. 3. in XA mode. MVS/370 was designed to operate on System/370 processors that utilize 24-bit addresses. the largest address that can be represented – and therefore the largest address space that can be used – is about 2G. The AMODE attribute is assigned to MVS program module by the programmer as input to the assembler or linkageeditor. To maintain compatibility with MVS/370. MVS/XA recognizes 24-bit processing. Paging To allow the parts of a program in virtual storage to move between real and auxiliary storage. or Extended Architecture. it allows the OS to load a module anywhere in virtual storage A program that must be directly addressable by 24 bit callers must reside below the 16 MB line. The default is 24 bit addressing mode. IBM extended this architecture even further with the introduction first of ESA/370. virtual storage and auxiliary storage into blocks. The terminology the system uses is as follows • • • A block of real storage is a Frame A block of virtual storage is a Page A block of auxiliary storage is a Slot An Introduction to Mainframes .3. 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. 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. 370-XA processors can operate in 370 mode using standard 24 bit addresses or in XA. Programs running in 24-bit addressing mode can access the first 16 MB of the virtual storage. A program that doesn’t have 24 bit callers. modules require residency below 16 MB.More about Mainframes space on a System/370 can’t contain more than 16M bytes of storage.9. or whose 24 bit callers call it indirectly. mode using 31-bit addresses.

In some cases. a page fault occurs. Expanded Storage Most new System/370 processors include a special type of memory known as expanded storage.2. Expanded storage improves the efficiency of virtual storage operations by acting as a large buffer between real storage and the page data sets. As a result. An active virtual storage page resides in a real storage frame. the address space resides on auxiliary storage and can’t execute until it is swapped in. That operation is called a page-in. Pages are written to the actual page data set only when expanded storage becomes full.62 - . MVS locates the page that contains the needed data on DASD and transfers it into real storage. data in a page frame has to be moved to a page data set to make room for the new page. so the operation is almost instantaneous.More about Mainframes A page. MVS divides virtual storage into 4K sections called pages. Swapping is performed in response to the recommendations from the System Resource Manager (SRM).4. This transfer occurs at CPU speeds rather than at DASD speeds.2. each consists of 4KB.3. Data is transferred between real and DASD storage one page at a time. the new page can overlay data in a real storage page frame.9.3. This has the effect of moving an entire address space into or out of real storage. a virtual storage page that becomes inactive resides in an auxiliary storage slot. Similarly. Address spaces that are swapped in are active having pages in real storage frames and pages in auxiliary storage slots. See the figure in the next page An Introduction to Mainframes . Either way. a frame and a slot are all of the same size. each of which can hold one page of virtual storage. The amount of expanded storage on a processor varies depending on the processor model. When a program refers to a storage location that is not in real storage. the process of bringing a new page into real storage is called paging. 3. the processor moves the page’s contents to expanded storage.9. when a virtual storage page must be paged out. When that happens. each of which holds one page of virtual storage. the DASD area used for virtual storage. is divided into 4K page slots. Swapping Swapping is the process of transferring all of the most recently valid pages of an address space between real storage and auxiliary storage. called a page data set. Address spaces that are swapped out are inactive. That is called a page-out. real storage is divided into 4K sections called page frames. In other cases. 3.3. 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. Simply put.

3. Fortunately.1. only a part of the overall process of installing MVS from the distribution libraries. System generation. swapping effectively moves entire address spaces in and out of virtual storage. an installation must already have a working MVS system before it can generate a new one. a systems programmer codes special macro instructions that specify how the MVS components from the distribution libraries should be put together.2. The MVS system System Generation When an installation purchases the MVS operating system. selects and assembles the various components an installation needs to create a working MVS system. most installations perform sysgen to upgrade to a newer version of MVS or to make changes to their current version. only at a higher level. often called sysgen. called distribution libraries. To control system generation.More about Mainframes Page Data Sets Real Storage Swap Data Sets 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) CPU You can think of swapping as the same thing as paging. Since paging occurs only for address spaces that are currently in virtual storage. IBM sends the basic components that make up the MVS on a series of tapes. 3.10.3. paging doesn’t occur for address spaces that are swapped out 3. Interestingly. So they can use their current version of MVS to execute the sysgen An Introduction to Mainframes .2.10. This is because an existing MVS system is required to execute the sysgen macro instructions. Rather than move small 4K pieces of virtual storage in an out of real storage.63 - .

Some of the largest physical boxes that IBM ever s produced. in XA mode. IBM' flagship was the 370 architecture line. the system must be generated again.3. That causes the computer system to clear its real storage and begin the process of loading MVS into storage from the system libraries.10.. The second category of macro instructions in a sysgen indicates which options of the OS should be included. itself a s development of IBM' earlier 360 line. less time consuming type of sysgen called an iogen to change the I/O device configuration. The first category of macro instructions defines the system’s hardware configuration.64 - . Sounds cool now? If so.. the system operator uses the system console to start an Initial Program Load or IPL. MVS lets you do a smaller. what optional access methods and so on The output from sysgen is a series of system libraries that contain. you might not have read the following lines or you might have already knew it “370-XA processors can operate in 370 mode using standard 24 bit addresses or in XA. though less so than it is today. As a result. it can be used to control the operation of the computer system. To begin a system initialization.2. the largest address that can be represented – and therefore the largest address space that can be used – is about 2G” Still confused? Didn’t you read 31 bit?! Didn’t you think why 31 and not 32? We have an answer for that 3. the executable code that makes up the OS 3. the system installation process includes setting up a small.More about Mainframes For installations that do not already have an MVS system. System Initialization Once an MVS OS has been generated. full function MVS system The macro instructions a systems programmer codes for a sysgen fall generally into two categories. mode using 31-bit addresses. limited function MVS system that can execute the sysgen for the complete.3.11.2. XA and 31 bit addressing The IT landscape of the early 1980s was dominated by the mainframe computer. They are needed because MVS must know about every I/O device that is attached to the system. In those days there were various other manufacturers selling proprietary and mostly long forgotten systems such as Burroughs and ICL. and the mainframe marketplace was dominated by IBM. among other things.2. Like which Job Entry Subsystem. whenever a new I/O device is installed. big 370 systems like the 3033 and 3081 mostly ran IBM' proprietary operating s An Introduction to Mainframes . or Extended Architecture.

a new connection architecture and many functional enhancements.including the most powerful the company has ever offered. the other 8 bits were essentially available to the programmer to do as they pleased. if it was zero then the next 7 bits were ignored and only the last 24 bits represented the address. which caused problems later. this had become a severe limitation for large sites. Although every unit of work. The most serious limitation of this operating system. But why 31 bit and not 32 bit? Well this is because of those flags often stored in the first 8 bits. in order to save their customers from the problems of rewriting huge volumes of 24 bit code.3.3. much as the 640 KB limit in the PC operating system DOS became a limitation. The new ESA/390 architecture and new MVS/ESA. VM/ESA and VSE/ESA operating systems.More about Mainframes system MVS/SP V1. The 370 architecture always used 4 byte. facilitate the function and computing power of System/390. along with new technologies. or 32 bit. bringing access to a 2 GB address space. but only the last 3 bytes or 24 bits actually represented an address. An Introduction to Mainframes . This was achieved by setting the top bit as the 24 or 31 bit mode bit. in s practice you were lucky to get 9 MB for your own use).65 - . System/390 IBM announced System/390 on September 5. The 370/XA (XA stands for eXtended Architecture. Many programs used these bits for passing flags. System/390 introduced the IBM Enterprise System/9000 family of 18 new processors . known as an address space in MVS. 1990. enriched family of Enterprise Systems Architecture/390 operating systems. but after the operating system reserved areas for it' own use. words to store virtual memory addresses. You should feel comfortable now! Let’s go ahead with our discussion on mainframe history 3. was that it used a 24 bit addressing scheme. If the bit was set.3. the address took up the following 31 bits. had access to it' own virtual storage area of 16 s MB (well 16 MB in theory. IBM ensured that XA could run it without modification. and the 370 architecture on which it ran. In addition to a new. why it was never just called EA is one of those nomenclature mysteries with which IBM is riddled) altered this 24 bit scheme to use the entire word for addressing. and so 31 bit addressing was born.

allow reconfiguration of channels and input/output equipment without impacting the system. Among the functional highlights are: • Enterprise System Connection (ESCON) architecture that implements high speed fiber optic channels. Very high performance supercomputing vector options for the most powerful ES/9000 models. and help move applications from one system or network to another. and A unique external time reference system that connects and synchronizes separate IBM processors in a multi-system complex (sysplex) and allows customers to operate them as one system. Software enhancements that speed application development. and provide functions that help customers move closer to the goal of 24 hours/7 days a week operation. that are especially suited to high-speed. allows customers to locate traditional "computer room" equipment anywhere within a 9-kilometer (5.6 miles) radius. New client/server hardware and software products designed to simplify the management and coordination of an enterprise' local area network environment. better manage distributed data. with integrated cryptography at central processor speeds.More about Mainframes The System/390 line of servers was the IBM flagship mainframe family in the 1990s. high-volume transmission of sensitive information such as financial transactions. and facilitates any-toany connectivity System management and system availability enhancements that reduce planned and unplanned outages. Enhanced enterprise-wide security functions. s On-line transaction processing capabilities that can improve applications linking thousands of remote terminals and huge databases. • • • • • • • An Introduction to Mainframes . making advanced scientific and technical applications affordable to many customers for the first time.66 - . such as those in airline reservation and banking systems. as well as new cost-effective vector facilities on intermediate processors.

scalability in the face of unpredictable spikes in workload or traffic. 2000. and near zero downtime when clustered. Along with the new design.the z900' flagship operating system . z/OS The z900 and z/OS were the result of a $1 billion. allowing thousands of servers to operate within one box. This was the comment made by Dan Colby.67 - .4. which works hand-in-hand with z/OS .More about Mainframes System/390 Parallel Enterprise Server The S/390 Parallel Enterprise Servers were microprocessor-based mainframes designed for any business application. Enterprise Servers. eServer zSeries 900 IBM unveiled the IBM eServer zSeries 900 on Oct 3. The z900 will allow customers to push performance and connectivity to the outer limits without any concessions to reliability and security. 3. The first in a new class of e-business servers. the air-cooled CMOS processors introduced in 1994 extended the scalability of earlier S/390 parallel processors to meet the needs of a wide range of customers. It is built to handle the unpredictable demands of e-business. two-year effort to specifically address the needs of businesses in the age of e-commerce.is s designed for high speed connectivity to the network and to storage systems. IBM also introduced its new 64-bit operating system. From traditional accounts payable to advanced video serving applications.3. the first mainframe built from scratch with e-business as its primary function. while the server was introduced "The z900 knows what you need before you do”! An Introduction to Mainframes . general manager. IBM. the system.

The heart of the z900 is the IBM multichip module (MCM) . The zSeries 900 was the first IBM mainframe built from scratch with e-business as its primary function The ability to run thousands of virtual servers within one physical box made the z900 the ideal platform for e-business-intensive operations like application service providers. Functioning like thousands of servers within the server. The z900 reached unprecedented levels in capacity and security. The module uses IBM' leading-edge copper technology and contains 2. Internet service providers and technology hosting companies. The bandwidth has been tripled to accommodate applications that require huge I/O bandwidth to process the large number of transactions and inquiries driven by the Internet. most advanced semiconductor and packaging technology in the world. Designed and manufactured by IBM' world-class chip developers. Clustered.68 - . 24GB/second of 110 bandwidth.the densest. the z900 has self-healing capabilities. On most servers these adjustments must be made manually or are limited to a single logical or even physical partition. In addition.226 I/0 pins by 1 kilometer of wire. this leadings edge technology provided significant advantages in performance. including: • • Greater than 2. It continuously monitors itself and can automatically detect and correct errors.500 MIPs (Million Instructions Per second) on 16 processors. An Introduction to Mainframes . allowing applications to run without interruption.More about Mainframes eServer zSeries 900 The only server capable of dynamically shifting workloads in the server and the network according to priorities set by the customer. the z900 addressed one of the greatest e-business challenges facing companies .5 billion s transistors.efficiently and robustly managing unpredictable resource requirements. The 5" x 5" x 1/4" module contains 35 chips mounted on 101 layers of ceramic glass connected to 4. resources shift automatically to the applications that need them. the z900 can handle up to 9 billion transactions/day (300 million transactions/day stand alone). power consumption and reliability.

000 Secure Sockets Layer (SSL) transactions/second . 2003. Reliability -. 2. or less than five minutes of downtime per year. and the hardware availability rate for a clustered zSeries is up to 99. The ability to process greater numbers of SSL transactions means businesses can serve more customers and make more sales in less time.designed from the ground up to help thwart intrusion into the system. • • An Introduction to Mainframes . Security . more than $1 billion investment in the zSeries platform involving 1. IBM introduced eServer zSeries 990.the z990 features IBM' exclusive Intelligent Resource Director (IRD) s technology. eServer zSeries 990 On May 13. Enhanced Capacity on Demand capabilities .mainframe reliability is measured in decades.are crucial to e-business transactions.69 - .the z990 architecture can support hundreds or even thousands of virtual Linux servers in a single box. New HiperSocket technology . not weeks or days. It also features FICON directors for Magstar tape and the IBM Enterprise Storage Server. enabling companies to securely process orders on-line.000 transactions/second. the IBM mainframe is one of the most secure servers on the market. built on the breakthrough technology of the eServer z900. Automation .provides high speed TCP/IP connectivity between virtual servers within a single z900. The z990 also offers the ability to turn capacity on and off.5. which rewrote the rules for enterprise-class computing with fortress-like security.200 IBM developers The z990 sets a new standard for enterprise-class computing and will feature industry leadership in: • • • Virtualization .the best Sun claims is 125 SSL/second.More about Mainframes • • • FICON enhancements . A clustered z990 can handle up to 13 billion transactions/day. the new flagship of the eServer family. That roughly equates to an entire data center on one server the size of a refrigerator. • 3. SSL transactions .a single z990 offers massive capacity and the ability to scale up and out.3. exceeding the average weekly volume on the New York Stock Exchange. and extreme performance in Linux virtualization and automation The new z990 was the result of a four-year.999%. rock-solid reliability. creating a network in a box.scales effortlessly from 1-way to 16way processor capability on the fly and without disruption. which dynamically moves system resources to the workloads that need them. distance and sharing capabilities for networked storage. allowing customers to temporarily add server engines during peak periods. Scalability . It can scale up to process 450 million e-business transactions/day or scale out to manage hundreds of virtual Linux servers.offers native FICON attachment to Magstar tape storage that enhances performance. A 16-way z990 can securely process up to 11.those that cause the "locked" padlock icon to appear at the bottom of browsers . according to priorities and objectives set by the customer.

and turn them off when they don' offering the ultimate flexibility to help respond to daily or seasonal t. double the number of its . SSL handshakes -. the new z990 provides up to 512 I/O channels. with twice the virtualization capabilities and the ability to do nearly three times the work of the z900. release 4.and allows customers the ability to scale up from 1.More about Mainframes The z990 is the most powerful and scalable IBM mainframe in the 40-year history of the product. when they need them. enabling companies to more securely process orders on-line. eServer zSeries 990 The z990 will provide new levels of scalability.70 - • • • • An Introduction to Mainframes .twice the number of processors and almost three times the system capacity of the z900 .to 32-way.000 MIPS (million instructions per second) on 32 processors . For customers seeking additional connectivity for new e-business workloads on the mainframe. providing twice the LPAR capability of the z900. and a dramatically simplified product structure that reduces the number of mainframe models from 42 to 4. mainframe customers can power up available additional engines on demand. with On/Off Capacity on Demand. Topping its own security record. customers can quickly create and effectively manage hundreds of virtual Linux servers within one physical box. without taking the system down. Up to 30 logical partitions (LPARs) are supported on the z990.those that cause the "locked" padlock icon to appear at the bottom of browsers -.000 Secure Sockets Layer (SSL) transactions/second (a 57% improvement over a 16-way z900). Running the latest version of z/VM. surges in demand. The z990 features up to 9.are crucial to e-business transactions. a new "building block" design that allows customers to plug in new capacity without taking the system down. IBM' advanced virtualization technologies make the s z990 an ideal consolidation platform for customers seeking to reduce the cost and management expense of server farms.4. The ability to process greater numbers of SSL transactions helps businesses serve more customers and make more sales in less time. the new 16-way z990 can handle up to 11. security and connectivity: • For the first time.

which provide high speed TCP/IP connectivity between virtual servers within a single z990. IBM has also introduced a new technology called logical channel subsystems. which can make it easier for customers to consolidate multiple mainframes into a larger z990.71 - . The z990 has available up to four times the memory of the z900. there are now up to 16 HiperSockets. • An Introduction to Mainframes . quadruple the number in the z900.More about Mainframes predecessor. 256GB versus 64GB. In addition.

z/Architecture and z/OS Chapter 4 z/Architecture and z/OS An Introduction to Mainframes .72 - .

1. one or more central processing units (CPUs). z/Architecture and z/OS Logical Structure of a z/Architecture system with 2 CPUs ETR Expanded Storage CPU Main Storage CPU Crypto Channel Subsystem Logically. depending on the model. I/O devices are attached to the channel subsystem through control units. At any instant. operator facilities.z/Architecture and z/OS 4. the amount in the configuration may be under control of model-dependent configuration controls. The connection between the channel subsystem and a control unit is called a channel path 4. 4. The storage is available in multiples of 4K byte blocks. and. the channel subsystem and An Introduction to Mainframes . a channel subsystem.1. provides for high speed processing of data by the CPUs and the channel subsystem. Main Storage Main storage. a system consists of main storage. which is directly addressable. Both the data and programs must be loaded into main storage from input devices before they can be processed.73 - . and I/O devices.1. The amount of main storage available in the system depends on the model.

and other information used to control instruction sequencing and to determine the state of the CPU. decimal integers of variable length. when available. Expanded Storage Expanded storage may be available on some models. Expanded storage. the semi privileged control instructions can be executed in the problem state. and other machine related functions The CPU. PSW The program-status word (PSW) includes the instruction address. condition code. and I/O instructions. floating-pointsupport (FPS). These instruction are called PAGE IN and PAGE OUT instructions I don’t detail about these instructions… that is beyond the scope of this book Each 4K byte block of expanded storage is addressed by means of a 32 bit unsigned binary integer called an expanded-storage block number 4. They include 4. The An Introduction to Mainframes . in executing instructions.1. branching. CPU The Central Processing Unit (CPU) is the controlling center of the system. and other non-arithmetic operations.1.1. sometimes called a cache. control. 4. The privileged control instructions and the I/O instructions can be executed only when the CPU is in the supervisor state. interruption action. while the FPS instructions operate on floating-point data independent of the format or convert it from one format to the other.3. initial program loading. can process binary integers and floating point numbers (binary and hexadecimal) of fixed length. binary-floating-point (BFP). It contains the sequencing and processing facilities for instruction execution. and logical information of either fixed or variable length. timing functions.3.74 - . can be accessed by all CPUs in the configuration by means of instructions that transfer 4K byte blocks of data from expanded storage to main storage or from main storage to expanded storage. hexadecimal-floating-point (HFP). The general instructions are used in performing binary-integer-arithmetic operations and logical.z/Architecture and z/OS all the CPUs in the configuration have access to the same blocks of storage and refer to a particular block of main storage locations by using the same absolute address Main storage may include a faster access buffer storage. The CPU provides registers which are available to programs but do not have addressable representations in main storage. Each CPU may have an associated cache. Processing may be in parallel or in series Instructions which the CPU executes fall into seven classes: general. decimal. subject to the appropriate authorization mechanisms. The BFP and HFP instructions operate on data in the BFP and HFP formats. respectively. The decimal instructions operate on data in the decimal format.2.1.

General Registers Instructions may designate information in one or more of 16 general registers. pairs of floating-point registers can be used for extended (128-bit) operands.4.z/Architecture and z/OS active or controlling PSW is called the current PSW.3.2. each having 64 bit positions. BFP. Each register contains 64 bit positions For some operations. the program handling the interruption may reload the old PSW. the program must designate an even-numbered register. It governs the program currently being executed. In these operations. so that the interrupted program can continue 4.3. a data exception code.1. flag bits. When an interruption occurs. 4. The CPU has an interruption capability. respectively. called the old-PSW location. Access Registers The CPU has 16 access registers numbered 0-15. 4. The bit positions in the registers are assigned to particular facilities in the system. for the particular class of interruption. either bits 32-63 or bits 0-63 of two adjacent general registers are coupled.75 - . making it again the current PSW.3. The CPU has 16 floating-point registers. the CPU places the current PSW in an assigned storage location. This new PSW determines the next program to be executed.6. Floating Point Registers All floating-point instructions (FPS.1. and HFP) use the same floating-point registers. The CPU fetches a new PSW from a second assigned storage location. An access register consists of 32 bit positions containing an indirect specification of an address-space-control element. Each floating-point register is 64 bits long and can contain either a short (32-bit) or a long (64-bit) floating-point operand. Each of the eight pairs is referred to by the number of the lower-numbered register of the pair. which contains the leftmost (high-order) 32 or 64 bits. Control Registers The CPU has 16 control registers.1. The general registers may be used as base-address registers and index registers in address arithmetic and as accumulators in general arithmetic and logical operations. When it has finished processing the interruption.3. An An Introduction to Mainframes .1. and rounding-mode bits 4.3. such as program-event recording. Floating Point Control Register Floating Point Control (FPC) register is a 32 bit register that contains mask bits.5.1. providing a 64-bit or 128-bit format. which permits the CPU to switch rapidly to another program in response to exceptional conditions and external stimuli. The next higher-numbered register contains the rightmost (low-order) 32 or 64 bits. and are used either to specify that an operation can take place or to furnish special information required by the facility 4.3.

Channel Subsystem The channel subsystem directs the flow of information between I/O devices and main storage. External Time Reference Depending on the model an External Time Reference (ETR) may be connected to the configuration. and to facilitate key management. A serial channel path may connect to a control unit through a dynamic switch that is capable of providing different internal connections between the ports of the switch. The ETR facility provides a means to initiate and maintain the synchronization of TOD (Time of Day) clocks to an external time reference 4. selecting an available channel path. When the cryptographic facility is provided on a CPU. to support message authentication and personal identification. we will see this later) mechanism to translate references to a corresponding address space. and initiating execution of the operation with the I/O device An Introduction to Mainframes .7.1.1. It relieves CPUs of the task of communicating directly with I/O devices and permits data processing to proceed concurrently with I/O processing. 4. Cryptographic Facility Depending on the model.1. The high-performance cipher capability of the facility is designed for financial transaction and bulk-encryption environments. A channel path employs either a parallel-transmission protocol or a serial-transmission protocol and. 4. is called either a parallel or a serial channel path. it functions as an integral part of that CPU. I/O devices and their control units attach to the channel subsystem. I/O Input/output (I/O) operations involve the transfer of information between main storage and an I/O device.6.5. and it complies with the Data Encryption Standard (DES).1. accordingly. an integrated cryptographic facility may be provided as an extension of the CPU. As part of I/O processing. which controls this data transfer. the channel subsystem also performs the path-management function of testing for channel-path availability. 4.4.z/Architecture and z/OS address-space-control element is a parameter used by the dynamic address translation (DAT. The integrated cryptographic facility provides a number of instructions to protect data privacy. The channel subsystem uses one or more channel paths as the communication link in managing the flow of information to or from I/O devices.76 - .

Associated with the operator facilities may be an operator-console device. an operating system is a collection of programs that manage the internal workings of a computer system. direct-access-storage devices. The subchannel also provides storage for information concerning I/O operations and other functions involving the associated I/O device. Many I/O devices function with an external medium. and display. such as paper or magnetic tape. such as those found in displays and communications networks. and an I/O device may be attached to more than one control unit. In all cases.1. keyboards. stop. alter. and sensor based equipment. I/O Devices and Control Units I/O devices include such equipment as printers. The control-unit function may be housed with the I/O device or in the CPU. 4. start. teleprocessing devices. Channel Paths I/O devices are attached through control units to the channel subsystem via channel paths. initial program loading.77 - . depending on the model and the configuration. Operator Facilities The operator facilities provide the functions necessary for operator control of the machine.9.1. Information contained in the subchannel can be accessed by CPUs using I/O instructions as well as by the channel subsystem and serves as the means of communication between any CPU and the channel subsystem concerning the associated I/O device. communications controllers. and ensure that the maximum amount of work is processed as efficiently as possible.10.1. displays. 4. Although an operating system cannot increase the speed of a An Introduction to Mainframes . In all. an individual I/O device may be accessible to a channel subsystem by as many as eight different channel paths. From the programming point of view. or a separate control unit may be used. Control units may be attached to the channel subsystem via more than one channel path.z/Architecture and z/OS One subchannel is provided for and dedicated to each I/O device accessible to the channel subsystem. 4.8. magnetic-tape units. clearing. The actual number of subchannels provided depends on the model and the configuration. I/O-device operation is regulated by a control unit that provides the logical and buffering capabilities necessary to operate the associated I/O device.2. most control-unit functions merge with I/O-device functions. Each subchannel contains storage for information concerning the associated I/O device and its attachment to the channel subsystem. Operating System In simplest terms. Operating systems are designed to make the best use of the computer’s various resources. Other I/O devices handle only electrical signals. 4. which may also be used as an I/O device for communicating with the program. The main functions provided by the operator facilities include resetting.

At any point in time. Finding a way to keep the processor working while a job waited would increase the total amount of work the processor could do without requiring additional hardware. and then passes control along to a user program or another component 4. thereby making the computer seem faster by allowing it to do more work in a given period of time. or written out to a device such as a tape drive or a printer.1. The operating system processed each request or job as a unit. one component or another gets control of the processor. and various types of user consoles. Mainframe hardware consists of processors and a multitude of peripheral devices such as disk drives (called direct access storage devices or DASD).3. When a job waited for I/O. Input and output (I/O) take a long time compared to the electronic speed of the processor. magnetic tape drives. z/OS In most early operating systems. requests for work entered the system one at a time. Hardware resources used by z/OS The z/OS operating system executes in a processor and resides in processor storage during execution. z/OS gets work done by dividing it into pieces and giving portions of the job to various system components and subsystems that function interdependently.z/Architecture and z/OS computer. 4. z/OS is commonly referred to as the system software. This arrangement worked well when a job could execute continuously from start to completion. and makes its contribution. Tape and DASD are used for system functions and by user programs executed by z/OS. and did not start the next job until the one ahead of it had completed. The figure shows a simplified view of mainframe concepts An Introduction to Mainframes .78 - . the processor was idle.3. it can maximize its use. But often a job had to wait for information to be read in from.

on behalf of many users at once. allocate resources for work.Often called real or central storage (or memory). Multiprogramming and Multiprocessing z/OS is capable of multiprogramming.The system hardware consists of all the devices. and processors that constitute a mainframe environment Peripheral devices . all user programs share the use of processor storage with the operating system. or interrupt. which is the simultaneous operation of two or more processors that share the various hardware resources.79 - . Generally speaking.3. Many users running many separate programs means that. 4. In multiprogramming. Processor Storage . DASD devices. controllers. when a job cannot use the processor. the system can suspend. During the install process. convert work to a form that the computer can recognize. freeing the processor to work on another job z/OS makes multiprogramming possible by capturing and saving all the relevant information about the interrupted program before allowing another program to execute. Control Blocks As instructions execute the work of a computer system. z/OS is made up of programming instructions that control the operation of the computer system. the job. monitor work. or executing many programs concurrently. z/OS users need large amounts of memory to ensure suitable system performance 4.The z/OS operating system consists of load modules or executable code. z/OS includes sets of instructions that. they keep track of this work in storage areas known as control blocks. and handle output. accept work. there are three types of z/OS control blocks: • System-related control blocks • Resource-related control blocks • Task-related control blocks An Introduction to Mainframes .2. Multiprogramming allows z/OS to run hundreds of programs simultaneously for users who might be working on different projects at different physical locations around the world.z/Architecture and z/OS • • • • Software . Also. for example. Hardware . it can resume execution just where it left off. and consoles etc. When the interrupted program is ready to begin executing again.3.These include tape drives. z/OS can also perform multiprocessing.3. this is where the z/OS operating system executes. execute work. keep track of work. along with large amounts of complex hardware. the system programmer copies these load modules to load libraries residing on DASD volumes. These instructions ensure that the computer hardware is being used efficiently and allow application programs to run. such as memory and external disk storage devices.

If it is nonvolatile. such as how many processors are in use. the processor is free to execute other. Auxiliary storage is less expensive than real storage. Both data and programs must be loaded into main storage (from input devices) before they can be processed. sometimes called caches. During an I/O request. That is.3. mainframes and all other computers have two types of physical storage. In contrast. Because real storage is more closely integrated with the processor. unrelated work. except on performance. Main storage may include one or more smaller faster-access buffer storages.5. However. • • The physical storage located with the mainframe processor itself. The effects. 4. such as disk drives and tape drives. Auxiliary storage is accessed asynchronously. 4. such as a processor or storage device. Physical Storage used by z/OS Conceptually.80 - . If it is volatile. More about storage Main storage provides the system with directly addressable fast-access storage of data. A cache is usually physically associated with a CPU or an I/O processor.4. so it provides the capability for many jobs to be running while keeping real storage costs down. The physical storage external to the mainframe. think of it as memory for the mainframe. Main storage may be volatile or nonvolatile. including storage on direct access devices. Each task-related control block represents one unit of work. turning power off and then back An Introduction to Mainframes . This is called processor storage or real storage. the processor must wait while data is retrieved from real storage. This storage is called auxiliary storage. The primary difference between the two kinds of storage relates to the way in which it is accessed.3. which is scheduled to run amid other work requests in the system. it takes the processor much less time to access data from real storage than from auxiliary storage. mainframe auxiliary storage is located on (comparatively) slower external disk and tape drives. mainframe real storage is tightly integrated with the processor itself. the contents of main storage are not preserved when power is turned off. Each resource-related control block represents one resource. As with memory for a personal computer. as follows: • • Real storage is accessed synchronously with the processor. the processor is free to do other work while waiting for an I/O request to be satisfied. of the physical construction and use of distinct storage media are not observable by the program. The processor accesses auxiliary storage through an input/output (I/O) request.z/Architecture and z/OS Each system-related control block represents one z/OS system and contains system-wide information.

bits are numbered in a left-to-right sequence.5. An eight-bit unit is called a byte. and CCWs (Channel Command Words). A quadword is a group of 16 consecutive bytes on a 16-byte boundary Integral boundary says. The leftmost bits are sometimes referred to as the “high-order” bits and the rightmost bits as the “low-order” bits. and so on s Instructions must be on two-byte integral boundaries. Unless otherwise specified. A boundary is called integral for a unit of information when its storage address is a multiple of the length of the unit in bytes. The bits in a byte are numbered 0 through 7. a group of bytes is called a field. 4.3. which is the basic building block of all information formats.3. For most operations. accesses to storage proceed in a left-to-right sequence. Addresses are unsigned binary integers and are 24. An Introduction to Mainframes . only bytes can be addressed. provided all CPUs are in the stopped state and no references are made to main storage when power is being turned off. IDAWs (Indirect Address Words). or 64 bits 4. a group of bytes in storage is addressed by the leftmost byte of the group. A doubleword is a group of eight consecutive bytes on an eight-byte boundary. or a group of bytes.z/Architecture and z/OS on does not affect the contents of main storage. Storage Addressing Storage is viewed as a long horizontal string of bits.1. The number of bytes in the group is either implied or explicitly specified by the operation to be performed. the byte address. 4.2. Special names are given to fields of 2. Each byte location in storage is identified by a unique nonnegative integer. To operate on individual bits of a byte in storage.3. from left to right. Integral Boundaries Certain units of information must be on an integral boundary in storage. Bit numbers are not storage addresses. Within each group of bytes.5. The string of bits is subdivided into units of eight bits. an 8-byte field must have an address exactly divisible by 8. 8. A word is a group of four consecutive bytes on a fourbyte boundary.5. When used in a CPU operation. which is the address of that byte location or. and 16 bytes on an integral boundary. starting with 0 on the left and proceeding in a left-to-right sequence. The storage operands of most instructions do not have boundary-alignment requirements. 31.81 - . Information Formats Information is transmitted between storage and a CPU or the channel subsystem one byte. a 4-byte field' address must be divisible by 4. at a time. simply. and the storage operands of certain instructions must be on other integral boundaries.3. it is necessary to access the entire byte. however. A halfword is a group of two consecutive bytes on a two-byte boundary and is the basic building block of instructions. 4. Adjacent byte locations have consecutive addresses.

it is converted. Prefixing Prefixing provides the ability to assign the range of real addresses 0-8191 (8KB) to a different block in absolute storage for each CPU. Real Address A real address identifies a location in real storage. Prefixing causes real addresses in the range 0-8191 to correspond one-for-one to the block of 8K-byte absolute addresses (the prefix area) identified by the value in bit positions 0-50 of the prefix register for the CPU. Address Types For purposes of addressing main storage. 4. by means of prefixing. The particular transformation is defined by the value in the prefix register for the CPU.4. it is translated by means of dynamic address translation to a real address.82 - . When a real address is used by a CPU to access main storage. including the first 8K bytes and the locations designated by the prefix registers of other CPUs. and virtual. and the addresses are always assigned in complete 4K-byte blocks on integral boundaries.5. especially in the processing of interruptions.3. and the block of real addresses identified by that value in the prefix register to correspond one-for-one to absolute addresses 0-8191.3. 4. At any instant there is one real-address to absolute-address mapping for each CPU in the configuration.5. it is converted to an absolute address by prefixing. This transformation allows each CPU to access all of main storage. 4.5.5. Virtual Address A virtual address identifies a location in virtual storage. When a real address is used for an access to main storage.2. real.3.4. When a virtual address is used for an access to main storage. to an absolute address.4. Available main storage is usually assigned contiguous absolute addresses starting at 0. The channel subsystem and all CPUs in the configuration refer to a shared main-storage location by using the same absolute address.5.4. An Introduction to Mainframes .3. The remaining real addresses are the same as the corresponding absolute addresses.z/Architecture and z/OS 4.4. 4. three basic types of addresses are recognized: absolute.1.4. thus permitting more than one CPU sharing main storage to operate concurrently with a minimum of interference. which is then further converted by prefixing to an absolute address.3. Absolute Address An absolute address is the address assigned to a main-storage location.3. An absolute address is used for a storage access without any transformations performed on it.

sometimes called a cache store or RAM cache. Each of these is very small.6. Thus making the execution of the programs faster 4. or into variable length portions called segments. then once you filled up the available RAM. Memory caching is effective because most programs access the same data or instructions over and over. If there were no such thing as virtual memory. Cache Memory This is a small fast memory placed between the CPU and the main memory.3. you can not load any more applications. an email program. CPU Cache Main Memory A memory cache. is a portion of memory made of high-speed static RAM (SRAM) instead of the slower and cheaper dynamic RAM (DRAM) used for main memory. By keeping as much of this information as possible in SRAM. "Sorry. Only the relevant portion is loaded into the main memory. what the computer can do is look at RAM for areas that have not been used recently and copy them onto the hard disk." With virtual memory.5. If you load the operating system.z/Architecture and z/OS We have few more different jargons here. 64 megabytes is not enough to hold it all. This frees up space in RAM to load the new application. Prefixing….5. Virtual Memory breaks a program into a number of fixed length portions called pages. Virtual Memory Imagine your PC has only 64MB of main memory. the computer avoids accessing the slower DRAM. Virtual Memory.83 - . a Web browser and word processor into RAM simultaneously.5. let’s see what they really mean 4. Cache Memory. your computer would have to say.3. Please close another application to load a new one. whereas the remaining other program pages are stored on a peripheral disk CPU Cache Main Memory Virtual Memory Disk Storage An Introduction to Mainframes .

The computer could be playing music for the user while the user is busy using an accounting software on the same computer On your PC (Windows XP Machine).84 - . you can setup virtual memory size by selecting Control Panel/System Properties/Performance Options An Introduction to Mainframes .z/Architecture and z/OS This permits the loading of portions of two or more programs at the same time on the RAM. This is the reason why computers can run two or more programs at the same time.

8. each user has access to virtual storage.7. This ability to use a large number of storage locations is important because a program may be long and complex. by means of prefixing. This use of virtual storage is central to the unique ability of z/OS to interact with large numbers of users concurrently. Virtual Memory and z/OS In z/OS. mainframe might have much less real storage installed. z/OS uses a variety of storage manager components to manage virtual storage. z/OS supports 64-bit long addresses. What does it really mean? Virtual storage means that each running program can assume it has access to all of the storage defined by the architecture’s addressing scheme. then. The range of virtual addresses in an address space starts at zero and can extend to the highest address permitted by the operating system architecture.3. Virtual storage. by means of dynamic address translation (DAT). is this combination of real and auxiliary storage 4. and both the program’s code and the data it requires must be in real storage for the processor to access them.3. To allow each user to act as though this much storage really exists in the computer system.1. z/OS keeps the rest of the code and data in files called paging data sets on auxiliary storage. z/OS requires sufficient amounts of real storage and many billions of bytes of auxiliary storage. and then. to a real address. Within each address space the user can start multiple tasks. z/OS keeps only the active portions of each program in real storage.z/Architecture and z/OS 4. An Introduction to Mainframes . 4.85 - . The only limit is the number of bits in a storage address. using task control blocks or TCBs that allow user multiprogramming. it is first converted.3. which allows a program to address up to 16 Exa (1 Exa is 260) of storage locations. When a virtual address is used by a CPU to access main storage. z/OS provides each user with a unique address space and maintains the distinction between the programs and data belonging to each address space.5. to an absolute address. which usually consists of a number of high-speed direct access storage devices (DASDs).7. while processing the largest workloads. rather than physical storage.5. Address Space The range of virtual addresses that the operating system assigns to a user (or separately running program) is called an address space. How much less depends on the model of computer and the system configuration.5. To make virtual storage possible. z/OS uses a system of tables and special settings (bit settings) to relate the location of data on disk storage and real storage. In reality. This is the area of contiguous virtual addresses available for executing instructions and storing data. and keep track of the identity and authority of each user or program.

separate address spaces ensure that users’ programs and data do not overlap. 4. An active z/OS system uses many address spaces. an address space includes system code and data as well as user code and data. these areas are called frames.5. Thus. each the same size and accessible by a unique address.3. There is at least one address space for each job in progress and one address space for each logged-on user. There are many address spaces for operating system functions. and so on. by bringing pieces of the program into real storage only when the processor is ready to execute them—moving them out to auxiliary storage when it doesn’t need them. such as operator communication. Let’s see how the system makes it happen Physical storage is divided into areas. In z/OS. regardless of whether the page is in real storage or auxiliary storage.5. each of which has a unique virtual address 4. the entire program does not really need to be in real storage when an instruction executes.9. Virtual Storage Operation . z/OS then transfers the page into real storage An Introduction to Mainframes . the virtual address of the page remains the same. networking.86 - . The ability of many users to share the same resources implies the need to protect users from one another and to protect the operating system itself. However. Each page consists of individual locations called bytes. in auxiliary storage. the operating system can divide a program into pieces the size of frames or slots and assign each piece a unique address. security. yet each address space also contains a common area that is accessible to every other address space. automation. they are called slots Similarly. This arrangement allows the operating system to keep track of these pieces. To find a page of a program.1. rather than searching through all of physical storage for it.z/Architecture and z/OS Address spaces provide isolation of private areas in different address spaces (and this provides much of the operating system’s security). the program pieces are called pages The addresses of pages are called virtual addresses. Because it maps all of the available addresses. not all of the mapped addresses are available for user code and data. The convention of early operating systems was to have the entire program reside in real storage when its instructions were executing. In real storage. From the time a program enters the system until it completes.Overview Recall that for the processor to execute a program instruction.3. Paging z/OS maintains tables to determine whether a page is in real or auxiliary storage. Along with such methods as “keys” for protecting real storage and code words for protecting data files and programs. z/OS checks the table for the virtual address of the page. Instead. an operating system can execute more and larger programs concurrently.9. both the instruction and the data it references must be in real storage.

A region is a block of sequential virtual addresses spanning 2-8 gigabytes. beginning at a 1-megabyte boundary. accordingly. That is. z/OS follows a “Least Frequently Used” algorithm. Paging is key to understanding the use of virtual storage in z/OS. Address spaces are divided into 2-8 gigabyte units called regions. for example. Bits 0-32 are called the region index (RX). to real storage. consists of 2048 segments. 4.z/Architecture and z/OS or out to auxiliary storage as needed. Only those portions of the address space that are needed at any one point in time are actually loaded into real storage.2. bits 33-43 are called the segment index (SX).87 - . A virtual address has the following format: RX 0 33 SX 44 PX 52 BX 63 An Introduction to Mainframes . and no empty real storage is available. During job execution. and bits 52-63 are called the byte index (BX). or another page is required by the same application or a higher priority application. z/OS assumes that a page that has not been used for some time will not be used in the near future. Virtual Storage Address Each user or program gets an address space. A 2-gigabyte address space. A 2-terabyte address space. consists of 2048 regions. bits 44-51 are called the page index (PX). z/OS keeps the inactive pieces of address spaces in auxiliary storage z/OS manages address spaces in units of various sizes. beginning at a 2-gigabytes boundary. A segment is a block of sequential virtual addresses spanning megabytes. as follows: Page: Segment: Address spaces are divided into 4-kilobyte units of virtual storage called pages Address spaces are divided into 1-megabyte units called segments. z/OS paging is transparent to the user. To select pages for paging out to auxiliary storage.9. The pages remain in real storage until no longer needed. is divided into four principal fields. only those pieces of the application that are required are brought in. Region: A virtual address. This movement of pages between auxiliary storage slots and real storage frames is called paging.5.3. for example. and each address space contains the same range of storage addresses. or paged in.

The RX part of a virtual address applying to a 2G-byte address space must be all zeros. an exception is recognized. 4.88 - . otherwise.z/Architecture and z/OS As determined by its address-space-control element.3.9. segment. If the virtual address is already in central storage. Bits 0-10 are called the region first index (RFX). one in which the RSX is the left most significant part (a 53-bit address) is capable of addressing 8P bytes (4M regions). Dynamic Address Translation Dynamic address translation.3. a page fault interrupt occurs. The faults repeat down the DAT structure until ultimately a page fault is presented and the virtual page is brought into central storage either for the first time (there is no copy on auxiliary storage) or by bringing the page in from auxiliary storage. A type. An Introduction to Mainframes . and bits 22-32 are called the region third index (RTX). region. or DAT. Bits 0-32 of the virtual address have the following format: RFX 0 11 RSX 22 RTX 33 A virtual address in which the RTX is the left most significant part (a 42-bit address) is capable of addressing 4T bytes (2K regions). DAT is implemented by both hardware and software through the use of page tables. region tables and translation look-aside buffers.5. and z/OS is notified and brings the page in from auxiliary storage. segment tables. Looking at this process more closely reveals that the machine can present any one of a number of different types of faults. DAT allows different address spaces to share the same program or other data that is for read only. the DAT process may be accelerated through the use of a translation look-aside buffer. or page fault will be presented depending on at which point in the DAT structure invalid entries are found. is the process of translating a virtual address during a storage reference into the corresponding real address. and one in which the RFX is the lifetimes significant part (a 64-bit address) is capable of addressing 16E bytes (8G regions). a virtual address space can be a 2G-byte space consisting of one region. bits 11-21 are called the region second index (RSX). The RX part of a virtual address is itself divided into three fields. or it may be up to a 16-exabyte space consisting of up to 8G regions. If the virtual address is not in central storage. This is because virtual addresses in different address spaces can be made to translate to the same frame of central storage.

there would have to be many copies of the program or data. In effect. so in most cases the virtual to physical mapping does not require an additional memory access An Introduction to Mainframes . so most systems which support virtual addressing have a small associative memory (called a translation look-aside buffer.89 - . in which a page map is maintained in physical memory. or TLB) which contains the last few virtual addresses and their corresponding physical addresses. This means that each physical memory reference requires both an access to the page table and an operand fetch.z/Architecture and z/OS Otherwise. all memory references are indirect Virtual page Number Offset Page Map Physical Page Number Base Address of Page In Physical Memory Offset Absolute Address Virtual address translation hardware without translation look-aside buffer This requirement would be a considerable performance penalty. a direct mapping scheme is supported by the system hardware. one for each address space. in most processors. Generally.

the entire program appears to occupy contiguous space in real storage at all times. and Slots When a program is selected for execution.3. To the programmer.90 - . transfers the pages into real storage for execution. and the pages that are in real storage do not necessarily occupy contiguous space. of 4 kilobytes.5. The following blocks are defined: An Introduction to Mainframes . Actually. To allow this. and transfers pages that are not needed out to auxiliary storage. Pages. the system brings it into virtual storage. divides it into pages of 4 kilobytes (4K).4. The pieces of a program executing in virtual storage must be moved between real and auxiliary storage. not all pages of a program are necessarily in real storage.9. or blocks. z/OS manages storage in units.z/Architecture and z/OS Virtual page Number Offset Page hit In TLB TLB Page miss in TLB Page Map Physical Page Number Base Address of Page In Physical Memory Offset Absolute Address Virtual address translation hardware with translation look-aside buffer 4. Frames.

An active virtual storage page resides in a real storage frame. A virtual storage page that becomes inactive resides in an auxiliary storage slot (in a paging data set). When this supply becomes low. When a program refers to a page that is not in real storage. A block of virtual storage is a page. that is. A block of auxiliary storage is a slot. z/OS uses page stealing to replenish it. z/OS uses a real storage page frame from a supply of available frames. Swapping Swapping is the process of transferring all of the most recently valid pages of an address space between real storage and auxiliary storage.3.5. The decision to steal a particular page is based on the activity history of each page currently residing in a real storage frame. a frame.91 - . This has the effect of moving an entire An Introduction to Mainframes . Page Stealing z/OS tries to keep an adequate supply of available real storage frames on hand. Pages that have not been accessed for a relatively long time are good candidates for page stealing 4. Frames.5.9. A page.3. Pages and Slots 4. and a slot are all the same size: 4096 bytes (4 kilobytes). it takes a frame assigned to an active user and makes it available for other work.5.9.z/Architecture and z/OS • • • A block of real storage is a frame.6.

777. Swapping is performed in response to recommendations from the z/OS Workload Manager (WLM) component. System/370 defined storage addresses as 24 bits in length. MVS/XA provided an address space for users that was 128 times larger than the address space provided by MVS/370. or out of.6. With the release of the System/370-XA architecture in 1983. which meant that the highest accessible address was 16. With 31-bit addressing. as MVS/370 gained more functions and was asked to handle more complex applications. the operating system at that time. A swapped-out address space is inactive. The use of 24-bit addressability allowed MVS/370. IBM introduced System/370. Brief History of 64 bit addressability In 1970. Since that time.z/Architecture and z/OS address space into. to allot to each user an address space of 16 MB. IBM extended the addressability of the architecture to 31 bits. the operating system (now called MVS Extended Architecture or MVS/XA™) increased the addressability of virtual storage from 16 MB to 2 gigabytes (2 GB). real storage. It is one of several methods that z/OS uses to balance the system workload and ensure that an adequate supply of available real storage frames is maintained. The 16 MB address became the dividing point between the two architectures and is commonly called the line 2GB The ‘Bar’ 31 bit Addressing (MVS/XA) 16MB 24 bit Addressing (MVS) The ‘Line’ An Introduction to Mainframes .3. even access to 16 MB of virtual storage fell short of user needs. In other words. the first of its architectures to use virtual storage and address spaces. the address space resides on auxiliary storage and cannot execute until it is swapped in.92 - .216 bytes (or 224 bytes). 4. the operating system has changed in many ways. Over the years. having pages in real storage frames and pages in auxiliary storage slots. One key area of growth and change is addressability. A swapped-in address space is active.

Each address space. is 16 exabytes (EB – 16 260) in size 16 EB 64 bit Addressing (z/OS) 2GB The ‘Bar’ 31 bit Addressing (MVS/XA) 16MB 24 bit Addressing (MVS) The ‘Line’ An Introduction to Mainframes . IBM further extended the addressability of the architecture to 64 bits. Instead. called a 64-bit address space. while allowing application developers to write new programs to exploit the 31-bit technology. With the release of zSeries mainframes in 2000.93 - . With 64-bit addressing. the potential size of a z/OS address space expands to a size so vast that we need new terms to describe it. To preserve compatibility between the different addressing schemes. MVS/XA reserved this bit to indicate how many bits would be used to resolve an address: 31-bit addressing (Bit 32 on) or 24-bit addressing (Bit 32 off). To maintain compatibility for existing programs. MVS/XA did not use the high-order bit of the address (Bit 32) for addressing. MVS/XA remained compatible for programs originally designed to run with 24-bit addressing on MVS/370.z/Architecture and z/OS The new architecture did not require customers to change existing application programs.

Programs running on z/OS and zSeries mainframes can run with 24-. If so. the z/OS operating system increases the storage available to the user from 2 GB to 16 EB. Programs can use a mixture of instructions with 64-bit operands or 32-bit operands or other operands. 31-. The address space exceeds this limit only if a program running in it allocates virtual storage above the 2 GB address. continues to create address spaces with a size of 2 GB. An Introduction to Mainframes .94 - . by default.z/Architecture and z/OS We say that the potential size is 16 exabytes because z/OS. or 64-bit addressing (and can switch among these if needed).

Leftover Chapter 5 Leftover An Introduction to Mainframes .95 - .

The system programmer might be presented with the latest version of the operating system to upgrade the existing systems. and also installs or upgrades products that run on the system. An Introduction to Mainframes . such as database management systems. online transaction processing systems. The system programmer installs. Web servers. the system programmer (or systems programmer) plays a central role. and the sophistication and complexity of the system software that supports the users and applications. Middleware is a software “layer” between the operating system and the end user or end-user application. 5.96 - . 5. These problems are often manifested by software system images. applications running on the system.1. System Programmer In a mainframe IT organization. and IMS™ can be as complex. Major Middleware products such as DB2. than the operating system itself. a variety of roles are needed to support and operate the system. such as a sort. and maintains the operating system.1.1. and so forth. customizes. Most of those who interact with mainframes are end users – the people who use the applications hosted on the system. Leftover Job roles in the mainframe world It would be better to present the job roles in the mainframe world as it is entirely different from the normal scenarios Mainframe systems are designed to be used by large numbers of people. Or. In any case. However. the system programmer must perform tasks like the following: • • • • • • • • Planning software and hardware system upgrades and changes in configuration Training system operators and application programmers Automating operations Capacity planning Running installation jobs and scripts Performing installation-specific customization tasks Integration-testing the new products with existing applications and user procedures System-wide performance tuning to meet required levels of service The system programmer must be skilled at debugging problems with system software. because of the large number of end users. It supplies major functions not provided by the operating system. if not more so.Leftover 5. sometimes known as dumps that have been produced by the software products or in user jobs or transactions System programmers are needed to install and maintain the middleware on the mainframe. the installation might be as simple as upgrading a single program. CICS.

on the database side. read dumps. the system administrator generally relies on the software vendor support center personnel to diagnose problems. while the system programmer focuses on maintaining the system itself. One reason for the separation of duties is to comply with auditing procedures.1. System Administrator The distinction between “system programmer” and “system administrator” varies widely among mainframe sites. Based on requirements gathered from business analysts and end users.2.3. test. but they are key to its smooth operation nonetheless. And. Examples of system administrators include database administrators and security administrators. and identify corrections for cases in which these tasks aren’t performed by the system programmer 5. build.97 - . system administrators are more likely to have experience with the applications. In larger IT organizations with multiple departments. 5. In many smaller IT organizations. and deliver mainframe applications for the company’s end users and customers. which often require that no one person in the IT organization be allowed to have unlimited access to sensitive data or resources.Leftover There are a wide variety of system configuration options to be maintained. in addition to the daily monitoring and debugging of the system. the terms may be used interchangeably. In larger IT organizations. System administrators perform more of the day-to-day tasks related to maintaining the critical business data that resides on the mainframe.1. the designer creates a design An Introduction to Mainframes . where one person might be called upon to perform several roles. the system administrator maintains the system software environment for business purposes. including the day-to-day maintenance of systems to keep them running smoothly. These roles are not necessarily unique to the mainframe environment. Other examples of common system administrator tasks can include: • • • • • • Installing software Adding and deleting users and maintaining user profiles Maintaining security resource access lists Managing storage devices and printers Managing networks and connectivity Monitoring system performance In matters of problem determination. They often interface directly with the application programmers and end users to ensure that the administration aspects of the applications are met. the database administrator (DBA) is also present to ensure the integrity and smooth operation of the data that is stored in the database management systems. Application Designers and Programmers The application designer and application programmer (or developer) design. the job responsibilities tend to be more clearly separated. While system programmer expertise lies mainly in the mainframe hardware and software areas.

who works with the operator to ensure that production workloads are completing properly. System Operator The system operator monitors and controls the operation of the mainframe hardware and software. each module is passed through a testing process that can include function. 5.1.2. Program Products for z/OS A z/OS system usually contains additional program products (priced products) that are needed to create a practical working system. followed by batch updates that run after the prime shift when the online systems are not running. integration. Following the tests. who assist the operator in determining the proper course of action.4. 5. For example. In fact. languages such as Java™ have become popular for building new applications on the mainframe. and unit testing During the application development process. While many mainframe installations still create new programs with COBOL or PL/I. The operator is also responsible for starting and stopping the major subsystems. Production Control Analyst The production control analyst is responsible for ensuring that batch workloads run to completion--without error or delay. the programmer often works on a team of other programmers who are building code for related application program modules. the designer and programmer must interact with other roles in the enterprise. When completed.Leftover specification from which the programmer constructs an application. the application programs must be acceptance tested by the user community to determine whether the code actually satisfies the original user requirement. application builds. the programmer is responsible for maintaining and enhancing the company’s existing mainframe applications. Besides creating new application code. and works with the system programming and production control staff to ensure the health and normal operation of the systems. and with the production control analyst. database systems. Many mainframe installations run interactive workloads for online users.1. this is frequently the primary job for many application programmers on the mainframe today. such as transaction processing systems. The operator starts and stops system tasks.98 - . The process includes many iterations of code changes and compiles.5. just as on distributed platforms. the operator communicates with system programmers. such as a security manager product and a database manager product. and the operating system itself. In case of a failure or an unusual situation. An Introduction to Mainframes . 5. and system-wide tests. monitors the system consoles for unusual conditions.

IBM and other vendors offer sophisticated sorting products. such as DB2 Other types of database products. A relational database. such as hierarchical databases. A large variety of utility programs For example. efficient sorting of large amounts of data is highly desirable in batch processing. are also available. are offered as separate products. including: – Customer Information Control System (CICS) – Information Management System (IMS) – WebSphere Application Server (WAS) A sort program Fast. Transaction processing facilities IBM offers several. Non-IBM security system program products are also available. such as the COBOL compiler.Leftover Some common choices include: A security system z/OS provides a framework for customers to add security through the addition of a security management product (IBM’s program product is Resource Access Control Facility or RACF®). Other compilers. An Introduction to Mainframes . Compilers z/OS includes an assembler and a C compiler.99 - . the System Display and Search Facility (SDSF) A large number of other products are available from various independent software vendors (commonly called ISVs in the industry).

PART .100 - .2 An Introduction to Mainframes .

COBL – Tips and Tricks Chapter 1 COBOL – Tips and Tricks An Introduction to Mainframes .101 - .

Let there be Light! 1. COBOL – Tips and Tricks Tips and Tricks! I still remember the day the Tips and Tricks took its birth. The Input Output Control System (IOCS) takes care of blocking. The beginning was like this. I hope it would help you in your daily work. block can consist of 10 records. In this respect the function of the IOCS in the case of writing on a file is just the reverse of reading. I could say I started sending Tips and Tricks few months after I started my IT career.1. However. and so on. The number of records in a block is often called the ‘blocking factor’ The actual handling of the blocks is transparent to the programmer. IOCS releases the second record from the buffer. This memory space s is known as the buffer. the next 10 records will form the next block of the file. In this way only when all the records in the block has been released to the program and the programmer wants to read the next record. However. The programmer should only specify the number of records that should be contained in a block. The IOCS reserves a memory space equal to the size of a block of the file. This means that the first 10 consecutive records will form the first block of the file. the programmer would like to read or write only one record at a time. normally a single record is not read or written. it is important to note that every read or write statement doesn’t require the physical reading or writing of the file. 1. We did a bit of research and came up with a write – up and shared it with the team. This is the updated version of that. the IOCS reads the first block into the buffer but releases only the first record to the program. the usual practice is to group a number of consecutive records to form what is known as a block or physical record. This requirement of the programmer is fulfilled by the IOCS in the following manner. We had a confusion regarding the internal representation of numbers inside mainframe.2. It fuelled my wish to send it continuously.COBL – Tips and Tricks 1. a physical read or write operation on the file is only applicable to the entire block and not to the individual records in the block. the IOCS reads another block. A consolidation of all the Tips and Tricks were published already. When the programmer wants to read the first record from the file. Thus the read/write statements in the program are An Introduction to Mainframes . BLOCK Structure in Files (COBOL) – General Perspective While handling a tape or disk file. Instead. The next time the programmer wants to read a record. The response was quite surprising.102 - . For example. I think so far I had sent more than 75 such documents. When a file is blocked.

V indicates variable length records while F indicates fixed length records. an inter-record gap is generated between any two consecutive records. The other advantage of blocking is that a substantial amount of storage space on the tap of disk can be saved. In the latter case. Blocking helps to get the number of such gaps reduced thereby decreasing the wastage of storage spaces o n account of these gaps We specify blocking in FD file name BLOCK CONTAINS <INTEGER1> RECORDS/CHARACTERS Magnetic tape of disk files can contain variable length records. The records as defined in the program are sometimes called logical records and the blocks which are records as stored on the file medium are called physical records. In this case the file can have records with different fixed lengths or one or more records can contain variable number of table elements. blocking results in saving in terms of input – output time required to handle a file.COBL – Tips and Tricks logical operations. having LRECL = 80 An Introduction to Mainframes . The COBOL features for variable length records are only limited to the file description and record description entries in the file section. BLOCK CONTAINS INTEGER-1 TO INTEGER-2 RECORDS/CHARACTERS RECORD CONTAINS INTEGER-3 TO INTEGER-4 CHARACTERS The above forms for the BLOCK CONTAINS and RECORD CONTAINS clauses are quite sufficient to indicate that the said file is a file with variable length records. The advantage of blocking is two fold. We know that in the case of tape files. the table elements are defined with the occurs … depending on clause Each record in a file with variable length records carries a data item that contains the length of the record. JCL: Declaration for a fixed block data set. these clauses being optional in some computers. The total space occupied by these inter record gaps is quite substantial. The clause is as follows RECORDING MODE IS F/V Where. the physical reading or writing is done by the IOCS at the block level. a non standard clause is also required.103 - . However. • • Firstly.

REDEFINES Clause Sometimes. They really represent two different mappings of this same storage area Advantage: Conservation of Storage space Syntax: Level-number data-name-1 REDEFINES data-name-2 An Introduction to Mainframes . In such cases only one storage area can serve the purpose of two or more areas if the area is redefined. X(02). 10 QTY 10 UNIT-PRICE 05 TOTAL-SALES REDEFINES SALES-BY-UNIT.DSORG=PS) For a variable block file.104 - . 05 SALES-TYPE 05 SALES-BY-UNIT. The REDEFINES clause allows the same area to be referred to by more than one data name with different sizes and pictures. it may be found that two or more storage areas defined in the DATA DIVISION are not in use simultaneously.BLKSIZE=800.LRECL=84.DSORG=PS) 1.BLKSIZE=840. 10 AMOUNT 10 FILLER PIC PIC PIC PIC PIC X(01). 9(08)V99. you have to take 4 more bytes into consideration while specifying LRECL in JCL (this 4 bytes is used for marking the length of the record) // DCB=(RECFM=VB.LRECL=80. 01 SALES-RECORD. For example.3.COBL – Tips and Tricks // DCB=(RECFM=FB. This example describes a sales record which may either contain the total amount of sales (TOTAL-SALES) or the QTY & UNIT-PRICE The purpose of such description may be to have two types of records and their types may be determined from the data item named SALES-TYPE Depending on some predetermined values of SALES-TYPE the record will be interpreted in one of the two forms. Note that SALES-BY-UNIT & TOTAL-SALES refer to the same storage space. 9(04). 9(10)V99.

COBL – Tips and Tricks Rules 1) The level-number of data-name-1 and data-name-2 must be identical. data-name-1 and dataname-2 must be of same size 3) When the 01 level is used. the data-name-2 must be the data name of the entry that originally defined the area. The entries giving the new descriptions must immediately follow the REDEFINES entry.85. the size of data-name-1 must not exceed that of dataname-2 4) Multiple redefinitions are allowed. 2) Except when the REDEFINES clause is used to 01 level. Note that in COBOL . The appearance of multiple 01 entry in the record description is implicitly assumed to be the redefinition of the first 01 level record. An Introduction to Mainframes . the two must be equal. For example 05 05 DATA-A DATA-B REDEFINES DATA-A. RENAMES Clause Sometimes a re-grouping of elementary data items in a record may be necessary so that they can belong to the original as well as to the new group.4. 9(02). a redefined data item can be equal or smaller in size than that of the data item it redefines. 9) This clause must not be used for level-number 66 or 88 (COBOL 77 Standard) According to COBOL .74. 1.105 - . 5) In the case of multiple redefinitions. 6) The REDEFINES clause must immediately follow the data-name-1 7) Entries giving new descriptions can' have the value clauses (except in the case of t condition-names(88)) 8) The REDEFINES clause must not be used for records (01 level) described in the FILE SECTION. 10 FIELD-A 10 FIELD-B PIC PIC PIC X(12) 9(03)V99.

15 PF-DEDUCT 15 IT-DEDUCT 10 OTHER-DEDUCT PIC PIC 9(3)V99. 05 DEDUCTIONS. 10 PF-DEDUCT 10 IT-DEDUCT 10 OTHER-DEDUCT PAY-OTHER-THAN-BASIC RENAMES DEARNESS-ALLOWANCE THRU IT-AND-PF-DEDUCTIONS RENAMES PF-DEDUCT THRU PIC PIC PIC PIC PIC PIC PIC 9(6)V99. 10 BASIC-PAY 10 DEARNESS-ALLOWANCE 05 ADDITIONAL-PAY.106 - . MNTHLY-INCENTIVE IT-DEDUCT.66. 10 HOUSE-RENT 10 MNTHLY-INCENTIVE 05 DEDUCTIONS. . 9(3)V99. PIC 9(4)V99.77 or 88 4) Neither data-name-2 nor data-name-3 can have an OCCURS clause in its description entry. 9(3)V99. Alternatively. 10 IT-AND-PF-DEDUCTIONS. part of FIXED-PAY and the entire ADDITIONAL-PAY. This new group is formed out of the original group DEDUCTIONS. 9(6)V99. nor can they be subordinate to an item that has an occurs clause in its data description entry data-name-1 RENAMES data-name-2 THRU data-name-3 An Introduction to Mainframes . . PAY-OTHER-THAN-BASIC will become a new group consisting of DEARNESS-ALLOWANCE. 9(3)V99. 9(3)V99. 05 FIXED-PAY. Note that the new group overlaps on two original groups. Such overlapping is allowed provided the elementary items are all contiguous.COBL – Tips and Tricks 01 66 66 PAY-REC. namely. Syntax 66 Rules 1) All RENAMES entries must be written only after the last record description entry 2) The RENAMES clause must be used only with the special level number 66 3) Data-name-2 and data-name-3 can be the names of elementary items or group items. In a similar way IT-AND-PF-DEDUCTIONS has two elementary items PFDEDUCT and IT-DEDUCT. 9(4)V99. 9(4)V99. HOUSE-RENT and MNTHLY-INCENTIVE. the same thing can also be done in the original group description by placing like this . In the above example. They however can’t be items of levels 01.

COBOL 85 permits the USAGE IS BINARY clause as well to specifically represent data in binary form A few notes to remember: while allocating the space. in the record and must not be one of its sub fields. it can be specified with a usage clause in addition to the PIC clause 1. an item specified as computational can take part in arithmetic operations more efficiently. for COMP fields. The item must be an integer (no assumed decimal point is allowed). USAGE Clause Normally.1. One can specify the usage as DISPLAY. 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. 1. Only numeric data items can be displayed as computational.5. a computer can store data in more than one internal form. USAGE IS COMPUTATIONAL / COMP / BINARY This usage stores data in the form in which the computer actually does its computation.5. This allocation depends on the length of the maximum number that you can represent with this specification. if mentioned. the compiler will allocate space in multiples of word. This number can be easily represented by 2 bytes. USAGE IS DISPLAY This is the most common form of internal data. and as the name suggests. Whether a data item is computational or display. On the other hand. With 2 bytes you can represent up to 65535 An Introduction to Mainframes . the max number that you can represent is 9999. 9(2) COMP. double word (8 bytes) like that So if the PIC specified is 9(1) COMP. This form is suitable for input/output and character manipulations.5.107 - . must follow data-name-2.2. 1. it is also the default.COBL – Tips and Tricks 5) Data-name-3. In COBOL. Each character of the data is represented in one byte and a data item is stored in a couple of contiguous bytes. there are only two general forms of internal representation – computational and display. full word or word (4 bytes). Usually this form is binary. it can be half word (2 bytes). That is if you specify 9(4). However. 9(3) COMP OR 9(4) COMP. Thus defining WORKING-STORAGE SECTION entries in binary format is desirable when many repetitive arithmetic computations must be performed. The number of bytes required is equal to the size of the data item. that is. Broadly. any data item can be specified as display. the space allocated by the compiler will be half word (2 bytes).

4. The sign is stored separately as the rightmost half-abyte regardless of whether S is specified in the PIC or not. USAGE IS COMP-1 If the usage of a numeric data item is specified as COMP-1. The number is actually represented in hexadecimal. the space allocated by the compiler will be one word (4 bytes). The PIC clause can’t be specified for COMP-1 items 1.COBL – Tips and Tricks If you specify 9(5) COMP. 9(7) COMP OR 9(8) COMP. and a word can represent up to 4294967295 If you specify a PIC more than 9(8).5. it will be represented in one word (4 bytes) in the floating point form (single precision floating point form).5. this is possible with a word.108 - .5. an item that is declared as COMP) Use COMP if the data item is a a) b) c) A numeric field in a record input from a tape or disk file whether it was already COMP Numeric. it will allocate a double word (8 bytes). is used in calculations. An Introduction to Mainframes . you can’t accept from user. Points to keep in mind while you declare an item as COMP 1) Don’t use COMP if the data item is a) b) c) 2) Properly DISPLAY Nonnumeric or edited A field associated with a unit record device or terminal (this means. except for the rightmost position. which holds the sign. That is with 9(8). you can represent a maximum of 99999999. 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 In WORKING-STORAGE. USAGE IS COMP-3 COMP-3 enables the computer to store two digits in each storage position. Such representation is suitable for arithmetic operations. The PIC clause can’t be specified for COMP-2 items 1.5.3. USAGE IS COMP-2 This usage is the same as COMP-1 except that the data is represented internally in two words (8 bytes). 9(6) COMP. and is numeric and not edited and used in calculations 1. The advantage is that this increases the precision of the data (double precision) which means that more significant digits can be available for the item.

Different forms of EVALUATE statements are a) EVALUATE WHEN A=B AND C=D Imperative stmt WHEN (D+X)/Y = Imperative stmt WHEN OTHER Imperative stmt END-EVALUATE b) EVALUATE SQLCODE ALSO FILE-STATUS WHEN 100 ALSO ‘00’ Imperative stmt WHEN -305 ALSO ‘32’ Imperative stmt WHEN OTHER Imperative stmt END-EVALUATE c) EVALUATE SQLCODE ALSO A=B WHEN 100 ALSO TRUE Imperative stmt WHEN -305 ALSO FALSE Imperative stmt END-EVALUATE An Introduction to Mainframes .109 - . Different forms of EVALUATE Statement Evaluate is like a case statement and can be used to replace nested Ifs.COBL – Tips and Tricks The hexadecimal number C or F denotes a positive sign and the hexadecimal number D denotes a negative sign. it will however use only four positions 12 34 56 7+ We can save a significant amount of storage by using the USAGE-COMP-3 1. this field will use 7 storage positions.6. Suppose if you move 1234567 into a field defined 9(7). If you define the field with PIC 9(7) COMP-3. which is default. In DISPLAY mode. control comes out of the EVALUATE as soon as one match is made. The difference between EVALUATE and case is that no ‘break’ is required for EVALUATE i.e.

7. There is no need of any extra code. the subject – object comparison results in TRUE. if all the corresponding subject – object comparisons result in true Note that the values of the subjects need not be of the same class. go for SEARCH (Sequential Search) For a table with more than 50 entries go for SEARCH ALL (Binary Search) An Introduction to Mainframes . Performance Considerations for Indexes VS Subscripts • • • Using COMP to address a table is 30% slower than using indexes! Using COMP-3 to address a table is 300% slower than using indexes!! Using DISPLAY data item to address a table is 450% slower than using indexes!!! 1. Rule of the Thumb for SEARCH and SEARCH ALL • • For a table with less than 50 entries. the control is automatically passed on to the next sentence after the EVALUATE statement. the subject-object comparison always results in TRUE The list of subjects is said to “match” with the list of object.110 - .7.1. the subject – object comparison results in TRUE. 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. 1. if the value of the subject falls within the range In the case of conditional values. For example one can be numeric and the other can be alpha numeric After the execution of one of the when clauses. Do you know? 1. If ANY is specified for an object. the subject – object comparison is done in the usual way When a range of values is specified for the object. if both evaluate to the same value (that is if both are TRUE or both are FALSE).7.2. • • • • • • • The value of a subject is compared with the value/range of values of the object in the corresponding ordinal position In the case of a single valued (numeric/non numeric) object.COBL – Tips and Tricks d) EVALUATE SQLCODE ALSO TRUE WHEN 100 ALSO A=B Imperative stmt WHEN -305 ALSO (A/C=4) Imperative stmt END-EVALUATE During the execution of an EVALUATE statement.

8. 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! 1. Meaning of Device Name in SELECT Clause INFILE ASSIGN TO UT-S-INFILE SELECT OR SELECT INFILE ASSIGN TO DA-S-INFILE What they mean actually is First Part in DDNAME: Device Class UT stands for utility (Tape or sequential disk) DA stands for direct access (Disk) Second Part in DDNAMAE: Method of Organization S – Sequential (Printer. PARA1. NEXT SENTENCE and CONTINUE There is a big difference between NEXT SENTENCE & CONTINUE. 01 SAMPLE2 PIC X(2) VALUE 'CD'. Disk or Tape) I. 01 SAMPLE PIC X(2) VALUE 'AB'.COBL – Tips and Tricks 1.3. An Introduction to Mainframes . PROCEDURE DIVISION.7. PERFORM PARA2. D – Disk files to be accessed randomly 1. Terminal.111 - . STOP RUN. IF SAMPLE = 'AB' NEXT SENTENCE ELSE DISPLAY 'SAMPLE IS NOT AB' END-IF IF SAMPLE2 = 'CD' DISPLAY 'SAMPLE 2 IS CD' ELSE NEXT SENTENCE END-IF . Please refer the test program given below WORKING-STORAGE SECTION. R. PARA2.9.

we may assume that ‘SAMPLE 2 IS CD’ will get displayed but since SAMPLE is ‘AB’. PARA1. 01 SAMPLE PIC X(2) VALUE 'AB'.COBL – Tips and Tricks In this case. 01 SAMPLE PIC X(2) VALUE 'AB'. PARA2. PERFORM PARA2. end of the statement may not be a period). PROCEDURE DIVISION. STOP RUN. 01 SAMPLE3 PIC X(2) VALUE 'EF'. IF SAMPLE = 'AB' IF SAMPLE3 = 'EF' NEXT SENTENCE END-IF ELSE DISPLAY 'SAMPLE IS NOT AB' END-IF IF SAMPLE2 = 'CD' DISPLAY 'SAMPLE 2 IS CD' ELSE NEXT SENTENCE END-IF . for the following program ' SAMPLE 2 IS CD' be printed in SYSOUT will WORKING-STORAGE SECTION. PROCEDURE DIVISION. END-IF won’t act here as a statement terminator. It doesn’t matter whether NEXT SENTENCE is nested inside an IF statement. PARA1. 01 SAMPLE2 PIC X(2) VALUE 'CD'. SYSOUT will be empty in this case. CONTINUE will transfer control to the end of the statement that contains ‘CONTINUE’ (remember. SYSOUT will be empty in the following program also. STOP RUN. An Introduction to Mainframes . IF SAMPLE = 'AB' CONTINUE ELSE DISPLAY 'SAMPLE IS NOT AB' END-IF IF SAMPLE2 = 'CD' DISPLAY 'SAMPLE 2 IS CD' ELSE CONTINUE END-IF . WORKING-STORAGE SECTION. PARA2. NEXT SENTENCE will get executed and this will transfer control to the statement following the period so the program will move to STOP RUN. So. PERFORM PARA2. 01 SAMPLE2 PIC X(2) VALUE 'CD'.112 - .

10. The following is the EBCDIC representation. This is an 8 byte extension to the ASCII representation. Let us look into the internal details. The representation scheme that we use is EBCDIC.113 - . S0C7 Abend S0C7 abend occurs when an invalid character is present in COMP/COMP-3 /numeric field and you tried to manipulate that field by some arithmetic expressions. Dec Hex ASCII 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 NUL Null SOH Start of Heading (CC) STX Start of Text (CC) ETX End of Text (CC) EOT End of Transmission (CC) ENQ Enquiry (CC) ACK Acknowledge (CC) BEL Bell BS HT LF VT FF CR SO SI Backspace (FE) Horizontal Tabulation (FE) Line Feed (FE) Vertical Tabulation (FE) Form Feed (FE) Carriage Return (FE) Shift Out Shift In SMM Start of Manual Message VT FF CR SO SI DLE Vertical Tab Form Feed Carriage Return Shift Out Shift In Data Link Escape EBCDIC NUL Null SOH Start of Heading STX ETX PF HT LC DEL Start of Text End of Text Punch Off Horizontal Tab Lower Case Delete DLE Data Link Escape (CC) DC1 Device Control 1 DC2 Device Control 2 DC3 Device Control 3 DC4 Device Control 4 NAK Negative Acknowledge (CC) SYN Synchronous Idle (CC) ETB End of Transmission Block (CC) DC1 Device Control 1 DC2 Device Control 2 TM NL BS IL Tape Mark New Line Backspace Idle RES Restore An Introduction to Mainframes .COBL – Tips and Tricks 1.

. Decimal Point. "pound" Dollar Sign Percent Ampersand Apostrophe. "star" Plus Sign Comma Hyphen. / 0 1 2 3 4 5 6 7 8 File Separator (IS) Group Separator (IS) Record Separator (IS) Unit Separator (IS) Space Exclamation Point Quotation Mark Number Sign. Octothorpe. "dot" Slash. Virgule 0 1 2 3 4 5 6 7 8 PN RS UC Punch On Reader Stop Upper Case SYN Synchronous Idle ENQ Enquiry ACK Acknowledge BEL Bell SM Set Mode CU2 Customer Use 2 BYP Bypass LF ETB Line Feed End of Transmission Block CAN Cancel EM CC IFS IGS IRS IUS DS FS End of Medium Cursor Control Interchange File Separator Interchange Group Separator Interchange Separator Digit Select Field Separator Record CU1 Customer Use 1 Interchange Unit Separator SOS Start of Significance ESC Escape EOT End of Transmission An Introduction to Mainframes . Prime Left Parenthesis Right Parenthesis Asterisk. Minus Sign Period.COBL – Tips and Tricks 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 CAN Cancel EM End of Medium SUB Substitute ESC Escape FS GS RS US SP ! " # $ % & ' ( ) * + .114 - .

COBL – Tips and Tricks
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 9 Colon Semicolon Less-than Sign Equal Sign Greater-than Sign Question Mark At Sign A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ! Exclamation Point ¢ . < ( + | & Cent Sign Period, Decimal Point, "dot" Less-than Sign Left Parenthesis Plus Sign Logical OR Ampersand SUB Substitute SP Space CU3 Customer Use 3 DC4 Device Control 4 NAK Negative Acknowledge

An Introduction to Mainframes

- 115 -

COBL – Tips and Tricks
91 92 93 94 95 96 97 98 99 5B 5C 5D 5E 5F 60 61 62 63 [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { Opening Bracket Reverse Slant Closing Bracket Circumflex, Caret Underline, Underscore Grave Accent a b c d e f g h i j k l m n o p q r s t u v w x y z Opening Brace : # Colon Number "pound" Sign, Octothorp, , % _ > ? Comma Percent Underline, Underscore Greater-than Sign Question Mark $ * ) ; ¬ / Dollar Sign Asterisk, "star" Right Parenthesis Semicolon Logical NOT Hyphen, Minus Sign Slash, Virgule

100 64 101 65 102 66 103 67 104 68 105 69 106 6A 107 6B 108 6C 109 6D 110 6E 111 6F 112 70 113 71 114 72 115 73 116 74 117 75 118 76 119 77 120 78 121 79 122 7A 123 7B

An Introduction to Mainframes

- 116 -

COBL – Tips and Tricks
124 7C 125 7D 126 7E 127 7F 128 80 129 81 130 82 131 83 132 84 133 85 134 86 135 87 136 88 137 89 138 8A 139 8B 140 8C 141 8D 142 8E 143 8F 144 90 145 91 146 92 147 93 148 94 149 95 150 96 151 97 152 98 153 99 154 9A 155 9B 156 9C CSI ST IND | } ~ Vertical Line Closing Brace Tilde Reserved Reserved Reserved Reserved Index (FE) NEL Next Line (FE) SSA Start of Selected Area ESA End of Selected Area HTS Horizontal Tabulation Set (FE) HTJ Horizontal Tabulation Justification (FE) with a b c d e f g h i a b c d e f g h i @ ' = " At Sign Apostrophe, Prime Equal Sign Quotation Mark

DEL Delete

VTS Vertical Tabulation Set (FE) PLD Partial Line Down (FE) PLU Partial Line Up (FE) RI Reverse Index (FE) SS2 Single Shift Two (1) SS3 Single Shift Three (1) DCS Device Control String (2) PU1 Private Use One PU2 Private Use Two STS Set Transmit State CCH Cancel Character MW Message Waiting SPA Start of Protected Area EPA End of Protected Area Reserved Reserved Reserved Control Sequence Introducer (1) String Terminator (2) j k l m n o p q r j k l m n o p q r

An Introduction to Mainframes

- 117 -

COBL – Tips and Tricks
157 9D 158 9E 159 9F 160 A0 161 A1 162 A2 163 A3 164 A4 165 A5 166 A6 167 A7 168 A8 169 A9 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 185 B9 186 BA 187 BB 188 BC 189 BD 190 BE ` Grave Accent s t u v w x y z s t u v w x y z OSC Operating System Command (2) PM Privacy Message (2) APC Application Program Command (2)

An Introduction to Mainframes

- 118 -

119 - .COBL – Tips and Tricks 191 BF 192 C0 193 C1 194 C2 195 C3 196 C4 197 C5 198 C6 199 C7 200 C8 201 C9 202 CA 203 CB 204 CC 205 CD 206 CE 207 CF 208 D0 209 D1 210 D2 211 D3 212 D4 213 D5 214 D6 215 D7 216 D8 217 D9 218 DA 219 DB 220 DC 221 DD 222 DE 223 DF 224 E0 J K L M N O P Q R J K L M N O P Q R A B C D E F G H I A B C D E F G H I An Introduction to Mainframes .

So. For calculation. S0C7 will occur only when an invalid value is present An Introduction to Mainframes . the system will take only the lower order nibbles. where numeric 1 is represented as F1 where F is actually the sequence used to represent the series.COBL – Tips and Tricks 225 E1 226 E2 227 E3 228 E4 229 E5 230 E6 231 E7 232 E8 233 E9 234 EA 235 EB 236 EC 237 ED 238 EE 239 EF 240 F0 241 F1 242 F2 243 F3 244 F4 245 F5 246 F6 247 F7 248 F8 249 F9 250 FA 251 FB 252 FC 253 FD 254 FE 255 FF 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 S T U V W X Y Z S T U V W X Y Z Look into the HEX column.120 - . In this case. it is 1.

if you try to move 1A to a numeric field. because it contains 11. 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. Suppose you are moving 9* to a numeric field.121 - . Where invalid value means not simply alphabetic characters stored in numeric field. the COBOL compiler will do an automatic data conversion. it won’t cause a S0C7 . PROCEDURE DIVISION. 01 SAMPLE1 PIC 9(2) COMP-3. 01 SAMPLE PIC X(2) VALUE '9*'. This is a possible cause of S0C7 error. Look at the following program and its output DATA DIVISION. For more information on the causes of this error. if you try to manipulate this field. the lower order nibbles contain an invalid character C. see the description of S0C7 in QW. WORKING-STORAGE SECTION. An Introduction to Mainframes . 01 SAMPLE2 PIC 9(2). This is because. Its output is 9Ü IS SAMPLE 1:COMP-3:BEFORE COMPUTATION 9Ü IS SAMPLE 2:9(2):MOVED FROM COMP-3 Note that DISPLAY SAMPLE1 ' IS SAMPLE 1:COMP-3:AFTER COMPUTATION' DISPLAY SAMPLE ' IS SAMPLE: PIC X' and Are not executed because just before that the program abended. That will be represented internally as 9* F5 9C Now. it would cause a S0C7 abend.COBL – Tips and Tricks in the lower order nibble. MOVE SAMPLE TO SAMPLE1 DISPLAY SAMPLE1 ' IS SAMPLE 1:COMP-3:BEFORE COMPUTATION' MOVE SAMPLE1 TO SAMPLE2 DISPLAY SAMPLE2 ' IS SAMPLE 2:9(2):MOVED FROM COMP-3' *********THIS LINE WILL CAUSE A S0C7 ABEND************ ADD 1 TO SAMPLE1 ****************************************************** DISPLAY SAMPLE1 ' IS SAMPLE 1:COMP-3:AFTER COMPUTATION' DISPLAY SAMPLE ' IS SAMPLE: PIC X' STOP RUN This program will cause a S0C7 abend.

then while defining the array. the compiler can convert it to the dynamic form of CALL if you set (or don'set) t the correct compiler options. Compare the item to be searched with the item at the center. 1.g.122 - An Introduction to Mainframes . (You must load the table in the specified order). Searching order in the SEARCH ALL can be either ASCENDING or DESCENDING. it is in quotes. Therefore. and a couple of DLLs . This is the static form of a subroutine call. 1. Static CALLs In COBOL.1. you must also relink all of the executables that call "A". The compiler generates object code for this which will cause the linker to copy the object module a.1. because the each of the executables contains its own copy of "A".11.12. you should give DESCENDING KEY clause. it stops the search else repeat the process with the left half or the right half depending on where the item lies. (ASCENDING/DESCEDING KEY clause is to be used and the data must be loaded in this order) Binary Search is search on a sorted array.obj into your executable when it is linked.. If it matches. you normally call a subroutine like this: CALL ' A' USING arguments The static form of the CALL statement specifies the name of the subroutine as a literal. ASCENDING is default.1. 1. even if your program is coded to call a program statically. Such compiler options are discussed at the end of this document. So. e.COBL – Tips and Tricks 1. Static and Dynamic Subroutine CALLs Keep in mind as you read this that some compilers let you set options that will override the calling mechanisms shown below. or perhaps an EXE for your main.12. If you want the search to be done on an array sorted in descending order. SEARCH and SEARCH ALL SEARCH is a serial search SEARCH ALL is a binary search and the table must be sorted before using SEARCH ALL. if you modify "A" and recompile it.12. • Good things about Static CALLs Fewer files are needed to distribute your application because your application can be built into a single EXE file.

As a result. • No risk of mixing/matching different versions of your called subroutines. s • 1. but it' definitely a trap for the unwary. each DLL will have its own copy of the subroutine.2. An Introduction to Mainframes . the dynamic form of a subroutine call is coded like this: SUBROUTINE-A PIC X(8) VALUE ' . your application uses more storage than necessary. CALL SUBROUTINE-A USING arguments The dynamic form of the CALL statement specifies the name of the subroutine using a variable. The difference is that the name of the subroutine is found in the variable SUBROUTINE-A. 1.COBL – Tips and Tricks for subordinate modules.1. If your application has multiple DLLs that use the same statically named subroutine. the variable contains the name of the subroutine to be invoked. The compiled code will cause the operating system to load the subroutine when it is required instead of incorporating it into the executable. because they are bundled into your main program. This generally makes it simpler to distribute and/or upgrade your end users. Therefore. • • Bad things about Static CALLs 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. This can be either a Good Thing or a Bad Thing. A' . each DLL has its own copy of that subroutine and its storage. if you set a value in the subroutine in one of the DLLs.12. of course.12. including the storage defined in the subroutine.2. . The copy linked to s the other DLLs will not know about this. it' local to that DLL. Dynamic CALLs In COBOL. . Note: A dynamic-link library (DLL) is a module that contains functions and data that can be used by another module (application or DLL).123 - . If your application contains DLLs that call a subroutine statically.

1. Since your application only loads one copy of a dynamically called subroutine.2. Changes in values contained within the dynamically called subroutine are available to all the DLLs that use it.2. because your application can be built into a single EXE file. Which is Better Static or Dynamic? The answer is. 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.2.12. it uses less memory. then CALL it again.3. All executables that call this subroutine will share the same DLL. Static subroutines are nice. At that point. you will need re to distribute hundreds of DLLs. you incur more I/O because the routine needs to be reloaded if you CANCEL it.124 - .12. or perhaps an EXE for your main. it depends. your application will terminate abnormally unless you handle this situation. if you application consists of hundreds of subroutines and they' all called dynamically. and a couple of DLLs for subordinate modules. An Introduction to Mainframes . • • Good things about Dynamic CALLs You don'need to relink your application if you change something in your subroutine. you may not know about it until the user exercises some facility that tries to call that DLL. because they all share the same copy of the subroutine. t only the subroutine DLL needs to be relinked. It' possible to mix versions of your DLLs. If one of your DLLs is missing. both the code and data.COBL – Tips and Tricks Note that you can also load a module dynamically by including it in a DLL and then linking it using the import library for that DLL! 1.12. If you CALL a DLL. This can be a problem both with s distributing your application and with end-users installing updates improperly. • Bad things about Dynamic CALLs Every dynamically called subroutine must be linked as a DLL (unless you use an import library to expose other entry points in a DLL). Guess how much fun it will be trying to debug THAT mess? • • • • 1. • 1. Therefore. your software might have several different versions in memory at once. CANCEL it.

1.15. RETURN CODE of Internal SORT (Internal – In a COBOL Program) The return code or completion code is stored in a SORT-RETURN special register. Efficient COBOL Coding Techniques 1. BINARY (COMP OR COMP-4) When using binary (COMP) data items.COBL – Tips and Tricks 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. a CALL identifier (as opposed to a CALL literal). will translate to a DYNAMIC call).1. Data Types Using the proper data types is an important factor in determining the performance characteristic of an application. (Even if you choose NODYNAM.15. full word or double word boundaries. the use of the SYNCHRONIZED clause specifies that the binary data items will be properly aligned on half word. Why READ FILE and WRITE RECORD? You READ FILE because you don’t know in advance • • Whether there actually a record to read or not For variable or undefined length files.14. IF SORT-RETURN = 0 (Successful completion of SORT/MERGE) IF SORT-RETURN = 16 (Unsuccessful completion of SORT/MERGE) 1. Some of these are discussed below 1. This may enhance the performance of certain operations on some machines. 1. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. A dynamically called routine will always be in its initial state. 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.15. 1. how long the next record will be if there is one.125 - .13. An Introduction to Mainframes .1. You WRITE RECORD because you know in advance the answer to both of the above questions.

Performance Considerations for PACKED DECIMAL Using an odd number of digits is 6% faster than using the next lower even number of digits. 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 (Please refer the Tips and Tricks doc on COMP-3). An Introduction to Mainframes . using signed data items with eight or fewer digits produces the best code for binary items.1. PACKED DECIMAL (COMP-3) 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. 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 For n from 1 to 4. arithmetic is done in full word instructions where possible n is from 10 to 17 Arithmetic is done in double word format n is 9 Full word values are converted to double word format and then double word arithmetic is used (this is slower than any of the above) 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 binary data items) Note: using 9 digits is slower than using 10 digits. Performance considerations for BINARY Using 1 to 8 digits is the fastest Using 10 to 17 digits is 20% to 30% slower than using 1 to 8 digits Using 9 digits is 50% slower than using 1 to 8 digits Using 18 digits is 1150% slower than using 1 to 8 digits 1. Additionally.15. A call to the library routine is expensive compared to the calculation in-line.2. arithmetic is done half word instructions where possible For n from 5 to 8.126 - .COBL – Tips and Tricks Additionally.

Comparing Data Types Performance Considerations for comparing Data Types Packed decimal (COMP-3) compared to Binary (COMP or COMP-4) • • • • Using 1 to 5 digits: packed decimal is 150% to 210% slower than binary Using 6 to 8 digits: packed decimal is 220% to 260% slower than binary Using 9 to 17 digits: packed decimal is 100% to 240% slower than binary Using 18 digits: packed decimal is 65% faster than binary DISPLAY compared to Packed Decimal • • Using 1 to 9 digits: DISPLAY is 60% to 95% slower than packed decimal Using 10 to 18 digits: DISPLAY is 100% to 180% slower than packed decimal DISPLAY compared to Binary • • • • Using 1 to 5 digits: DISPLAY is 350% to 480% slower than binary Using 6 to 8 digits: DISPLAY is 500% to 570% slower than binary Using 9 to 17 digits: DISPLAY is 300% to 725% slower than binary Using 18 digits: DISPLAY is 10% faster than binary 1.15. which can be expensive compared to using the proper data type that does not require any conversion An Introduction to Mainframes .127 - . This results in additional processing time and storage for these conversions. 1. When a USAGE DISPLAY data item is used.2. it is important to understand the performance 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. In some cases. DISPLAY Avoid using USAGE DISPLAY data items for computations (especially in areas that are heavily used for computation). the conversion is done by a call to a library routine. it is recommended that the following guidelines should be followed.COBL – Tips and Tricks Using the fewest odd number of digits as possible may result in an additional 5% to 15% savings compared to using the next larger number of odd digits. additional overhead is required to convert the data item to the proper type both before and after the computation. When selecting your data types. In order to minimize this overhead.15. Data Conversions Conversion to a common format is necessary for certain types of numeric operations when mixed data types are involved in the computation.3.

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. Performance Consideration using AWO One program using variable length files and AWO was 10% faster than NOAWO An Introduction to Mainframes . AWO or NOAWO The AWO compiler option causes the APPLY WRITE ONLY clause to be in effect for all physical sequential.128 - .15. This will allow full word arithmetic to be used during the calculations.16. using four or fewer digits for the data item may also offer some added reduction in CPU time since half word arithmetic can be used Performance Considerations for Indexes Vs Subscripts (PIC S9(8)) 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 1.16. Without APPLY WRITE ONLY. variable length. Additionally in some cases.1. the file buffer is written to the output device when there is not enough space in the buffer for the maximum size record. Compiler options that affect run time performance 1. use a binary signed data item with eight or fewer digits (for example. using PICTURE S9(8) COMP) for the data item). the file buffer is written to the output device when there is not enough space in the buffer for the next record. even if the APPLY WRITE ONLY clause is not specified in the program. using APPLY WRITE ONLY can result in a performance savings since this will generally result in fewer calls to Data Management Services to handle the I/Os. 1.4. If the application has a large variation in the size of records to be written.COBL – Tips and Tricks Performance considerations for DISPLAY Using 1 to 5 digits is the fastest Using 6 to 9 digits is 15% slower than using 1 to 5 digits Using 10 to 13 digits is 50% slower than using 1 to 5 digits Using 14 to 16 digits is 65% slower than using 1 to 5 digits Using 17 to 18 digits is 120% slower than using 1 to 5 digits. blocked files. INDEXES Vs SUBSCRIPTS 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. With APPLY WRITE ONLY in effect. When using subscripts to address a table.

16. coding your own checks may be faster than using the SSRANGE option. OPTIMIZE(FULL) OR NOOPTIMIZE To assist in the optimization of the code. where possible Simplifying the code for a CALL to a contained (nested) program. to verify that all subscripts. and it can result in some degradation at run time. but generally produces more efficient run time code.16. with a range of 17% faster to equivalent. NOOPTIMIZE is required when using the TEST compiler option with a value other than TEST(NONE).COBL – Tips and Tricks 1. you may receive optimizations that include • • • • • • • • Eliminating unnecessary branches Simplifying inefficient branches Simplifying the code for the out-of-line PERFORM statement . In general if you need to verify the subscripts only a few times in the application instead of at every reference.3. NOOPTIMIZE also makes it easier to debug a program since code is not moved. Performance Considerations using OPTIMIZE • • On the average. This inline code occurs at every reference to a subscripted or variable length data item. For performance sensitive applications. equal sized items into a single move Deleting unreachable code Additionally with the OPTIMIZE(FULL) option in effect. With the OPTIMIZE(STD) or OPTIMIZE(FULL) options in effect. where possible Eliminating duplicate computations Eliminating constant computations Aggregating moves of contiguous. OPTIMIZE(STD) was 4% faster than NOOPTIMIZE. you should use the OPTIMIZE compiler option. An Introduction to Mainframes . moving the performed paragraphs in-line. you may also receive these optimizations • Deleting unreferenced data items and the associated code to initialize their VALUE clauses NOOPTIMIZE is generally used while a program is being developed when frequent compiles are necessary. OPTIMIZE requires more CPU times for compiles than NOOPTIMIZE. NOSSRANGE is recommended. OPTIMIZE is recommended. as well as every reference modification expression. OPTIMIZE(STD). For production runs.129 - . On the average. moving the called statements in-line. indexes and reference modification expressions are within the proper bounds.2. SSRANGE or NOSSRANGE Using SSRANGE generates additional code. OPTIMIZE(FULL) was equivalent to OPTIMIZE(STD) 1.

5.COBL – Tips and Tricks Performance Considerations using SSRANGE with CHECK(ON) On the average. TRUNC(OPT) was 5% faster than TRUNC(STD) 1. TRUNC – BIN. It also avoids the generation of extra code that NUMPROC(NOPFD) or NUMPROC(MIG) generates for most references to COMP-3 and DISPLAY numeric data items to ensure a correct sign is being used. and code is generated to truncate all binary receiving fields to the corresponding half word. With NUMPROC(NOPFD). the compiler assumes that the data has the correct sign and bypasses the sign fix-up processing An Introduction to Mainframes . TRUNC(OPT) was 27% faster than TRUNC(BIN) On the average. SSRANGE was 4% slower than NOSSRANGE 1.16.4. all binary (COMP) sending fields are treated as half word. With NUMPROC(MIG). depending on the PICTURE clause. TRUNC(STD) was 26% faster than TRUNC(BIN) On the average. the final or intermediate result of an arithmetic expression. or the sending field in the MOVE statement. full word or double word values.130 - . STD OR OPT When using the TRUNC(BIN) compiler option. A divide instruction is one of the most expensive instructions. sign fix-up processing is done for all references to these numeric data items. This can add significant amount of degradation since typically some data conversion must be done. MIG OR PFD Using the NUMPROC(PFD) compiler option generates significantly more efficient code for numeric comparisons. full word or double word boundary (base 2 truncation). With TRUNC(OPT). sign fix-up processing is done only for receiving fields (and not for sending fields) of arithmetic and move statements With NUMPROC(PFD). NUMPROC – NOPFD. This too can add significant amount of degradation since typically the number is divided by some power of 10 (depending on the number of digits in the PICTURE clause) and the remainder is used. full word or double word) Performance Considerations for TRUNC • • • On the average. When using the TRUNC(STD) compiler option. the compiler assumes that the data conforms to the PICTURE and USAGE specifications and manipulates the result based on the size of the field in storage (half word. BIN is usually the slowest of the three sub options for TRUNC. is truncated to the number of digits in the PICTURE clause of the binary (COMP) receiving field (base 10 truncation). which may require the use of some library routines.16.

An Introduction to Mainframes . NUMPROC(MIG) was equivalent to NUMPROC(NOPFD) 1. NUMPROC(PFD) was 1% faster than NUMPROC(NOPFD) On the average.16. whereas with the NODYNAM option.6. This allows you to share common subprograms among several different applications. Also the RENT option will allow the program to run above the 16 MB line on MVS.131 - . the overhead associated with the CALL using DYNAM ranged from 80% slower to 350% slower than NODYNAM 1. However not all external data files contain the proper sign for COMP-3 or DISPLAY signed numeric data. DYNAM Or NODYNAM The DYNAM compiler option specifies that all subprograms invoked through the CALL literal statement will be loaded dynamically at run time. RENT or NORENT Using the RENT compiler option causes the compiler to generate some additional code to ensure that the program is reentrant.COBL – Tips and Tricks Using NUMPROC(NOPFD) or NUMPROC(MIG) may also inhibit some other types of optimization. Reentrant programs can be placed in shared storage like Link Pack Area (LPA) or the Extended Link Pack Area (ELPA) on MVS. Performance Considerations using NUMPROC On the average. for a CALL intensive application.7. Producing the reentrant code may increase the execution time path length slightly. allowing for easier maintenance of these subprograms since the application will not have to be re-link-edited if the subprogram is changed. you pay a performance penalty since the call must go through a library routine. For performance sensitive applications. Performance Considerations Using DYNAM with CALL (Measuring CALL overhead only) On the average. Performance considerations using RENT On the average RENT was equivalent to NORENT with a range of equivalent to 1% slower.16. the call goes directly to the subprogram. and hence using NUMPROC(PFD) may not be applicable for all application programs. However when using the DYNAM option. NUMPROC(PFD) is recommended when possible. Hence the path length is longer with DYNAM than with NODYNAM. NUMPROC(PFD) was 1% faster than NUMPROC(MIG) On the average. DYNAM also allows you to control 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.

132 - . This can help to improve the performance for an all AMODE(31) application because Linkage Editor can minimize the amount of mode switching across calls to common run time library routines.1. which requires more CPU time resources for the verification of the subscripts.17. Using the CHECK(OFF) run time option deactivates this code but still requires some additional CPU time resources at every use of a subscript.2. 1. Run Time Options that Affect Run Time Performance Selecting the proper run time options is another factor that affects the performance of a COBOL application. Performance Considerations using ALL31 (Measuring CALL overhead only) On the average. indexes and reference modification expressions. This options has an effect only on a program that has been compiled with the SSRANGE compiler option Performance Considerations using CHECK On the average. CHECK The CHECK option activates the additional code generated by the SSRANGE compiler option. ALL 31 The ALL31 option allows LE to take advantage of knowing that there are no AMODE(24) routines in the application. ALL31(ON) was 1% faster than ALL31(OFF) 1. CHECK(ON) with SSRANGE was 2% slower than CHECK(OFF) with SSRANGE An Introduction to Mainframes . index or reference modification expression to determine that this check is not desired during the particular run of the program.COBL – Tips and Tricks 1.17. It specifies that the entire application will run in AMODE(31).17.

18. it reserves only the required storage space as specified by Q-MAX-ENTRY at the run time An Introduction to Mainframes .COBL – Tips and Tricks 1. the OCCURS DEPENDING ON clause may be used Example 01 WS4-T-TABLE-FIELDS. Here. depending on the value of the data name Q-MAX-ENTRY. 03 WS4-T-TABLE OCCURS 1 TO 5000 TIMES DEPENING ON Q-MAX-ENTRY INDEXED BY WS4-Y-INDX.133 - . instead of reserving 5000 entries. the size of WS4-T-TABLE will be decided. It can be anything between 1 and 5000 This saves space. Dynamic Array When a table of variable size is required. PIC X (02). 05 I-RATE-SHT 05 C-CALC-DEM-USGE PIC S9(03).

DB2 – Tips and Tricks Chapter 2 DB2 – Tips and Tricks An Introduction to Mainframes .134 - .

The next time the plan is invoked. DBRM Data Base Request Module. Syntax: INTO :HOSTVAR:NULLIND The picture clause that should be used for the null indicator is S9(4) COMP Meaning: -1 0 -2 : the field is null : the field is not null : the field value is truncated Inserting a record with a nullable column To insert a NULL. DB2 – Tips and Tricks Null Indicator To retrieve data from a nullable column.DB2 – Tips and Tricks 2.3. private name for a table or view.2. Plan A result of the BIND process .135 - . move -1 to the null indicator To insert a valid value. Synonym is dropped when the table or tablespace is dropped An Introduction to Mainframes .4. it is recreated. 2.1. A synonym is accessible only by the creator. use null indicators. 2. Synonym Synonym is an alternate. move 0 to the null indicator 2. has the SQL statements extracted from the host language program by the SQL pre-compiler. 2.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.

For example CREATE VIEW GOOD_SUPPLIERES AS SELECT S#. not only by their creator (as is the case with synonyms) 2. single table view with all the fields or mandatory fields. Examples of non-updatable views are views which are joins. Alias Alias is a locally defined name for a table or view in the same local DB2 subsystem or in a remote DB2 subsystem.g. CITY FROM S WHERE STATUS > 15.5. The system handles such an operation by converting it into an equivalent operation on the underlying base table(s). changes to GOOD_SUPPLIERS will automatically and instantaneously be applied to the real table S. distinguishable stored data. SELECT FROM WHERE * GOOD_SUPPLIERS CITY = ‘LONDON’ . Instead. Some views are updatable e. STATUS. In this example. Aliases give DB2 location independence because an alias can be created for a table at a remote site. thereby freeing the user from specifying the site that contains the data. the sub query following the AS is not executed. under the specified view name (GOODSUPPLIERS) GOOD_SUPPLIERS is in effect a “window” into the real table S. physically separate. the equivalent operation is SELECT FROM WHERE AND S#. This is so because they can be accessed by anyone. views that contain aggregate functions(such as MIN this is obvious). Aliases can be used also as a type of global synonym. Views View is nothing but a stored query.DB2 – Tips and Tricks 2. Furthermore that window is dynamic: changes to S will be automatically and instantaneously visible through that window. ARE THE VIEWS UPDATABLE ? Not all of them. An Introduction to Mainframes . instead it is simply saved in the catalog. their definition in terms of other tables is stored in the catalog table (SYSVIEWS). STATUS. CITY S CITY = ‘LONDON’ STATUS > 15.6.136 - . When this CREATE VIEW is executed. Likewise. Consider a retrieval operation. Views are not supported by their own.

DB2 – Tips and Tricks

2.7.

How to Run a DB2 Batch Program

Use DSN utility to run a DB2 batch program. An example is shown:
DSN SYSTEM(DSP3) RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB('EDGS01T.OBJ.LOADLIB') END

Use IKJEFT01 utility program to run this command in a JCL.

2.8.

Why SELECT * is not preferred in embedded SQL programs?

For three reasons: • 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. • The chance of an index only scan is lost.

2.9.

How does DB2 store NULL physically?

High Values

2.10. Concatenate
To concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name, we can use the following syntax
SELECT FIRSTNAME || ‘ ‘ || LASTNAME FROM EMP;

2.11. COALESCE Function in DB2
The COALESCE function avoids the use of nulls in the result column of OUTER JOIN statements. Consider the following query
SELECT EMP.EMPNO, EMP.WORKDEPT, DEPT.DEPTNAME FROM EMP FULL OUTER JOIN DEPT ON EMP.WORKDEPT = DEPT.DEPTNO;

An Introduction to Mainframes

- 137 -

DB2 – Tips and Tricks Let us say the result of this query looks as follows: EMPNO 3089 7654 .... WORKDEPT S12 A09 ... DEPTNAME SOFTWARE QUALITY CORPORATE ADMIN TRAINING DEPT

It can be seen that the TRAINING DEPT' WORKDEPT is not shown in the table because s 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 following example depicts the use of COALESCE
SELECT EMP.EMPNO COALESCE(EMP.WORKDEPT, DEPT.DEPTNO) AS DEPTNUM, DEPT.DEPTNAME FROM EMP FULL OUTER JOIN DEPT ON EMP.WORKDEPT = DEPT.DEPTNO;

The O/P for the above query would be now shown as follows... EMPNO 3089 7654 .... DEPTNUM S12 A09 T01 DEPTNAME SOFTWARE QUALITY CORPORATE ADMIN TRAINING DEPT

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 no corresponding WORKDEPT number.

2.12. DCLGEN
DeCLarations GENerator: used to create the host language copy books for the table definitions. Also creates the DECLARE table. It is not mandatory to use DCLGEN. Using DCLGEN, helps detect wrongly spelt column names etc. during the precompile stage itself (because of the DECLARE TABLE). DCLGEN being a tool would generate accurate host variable definitions for the table reducing chances of error. It not necessary to have DECLARE TABLE statement in DCLGEN - This is used by the precompiler to validate the table-name, view-name, column name etc.

An Introduction to Mainframes

- 138 -

DB2 – Tips and Tricks

2.13. EXPLAIN
EXPLAIN allows the user to obtain information regarding the optimizer’s choice of access strategy for a specified SQL statement. The information provided includes the indexes used, details of any sorts that will be needed, and (if the specified statement involves any joins) the order in which tables will be joined and the methods by which the individual joins will be performed. Such information can be useful for tuning existing applications, also for determining how projected applications will perform... Syntax EXPLAIN type FOR statement Here type is PLAN or ALL, and statement is the SQL statement to be EXPLAINEd. The output from the execution of the EXPLAIN statement is placed into a table called xyz.PLAN_TABLE, which must already exist (xyz here is the authorization ID of the user issuing the EXPLAIN). Here is an example.
EXPLAIN PLAN FOR SELECT S.S#, P.P# FROM S, P WHERE S.CITY = P.CITY;

When the EXPLAIN is executed, DB2 will place information regarding its implementation of the specified SELECT statement into the PLAN_TABLE of the user issuing the EXPLAIN. The user can then interrogate that table by means of ordinary select statements in order to discover, for example whether a particular index is being used or whether creating a new index might obviate the need for a sort. Before you can use EXPLAIN, a PLAN_TABLE must be created to hold the results of EXPLAIN

2.14. FETCH FIRST n ROWS ONLY
Fetching a limited number of rows: FETCH FIRST n ROWS ONLY 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 those 20 employees, you can write a query like this:

An Introduction to Mainframes

- 139 -

DB2 – Tips and Tricks
SELECT FROM ORDER FETCH LASTNAME, FIRSTNAME, EMPNO, SALARY EMP BY SALARY DESC FIRST 20 ROWS ONLY;

2.15. OPTIMIZE FOR n ROWS
Minimizing overhead for retrieving few rows: OPTIMIZE FOR n ROWS 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 environments. However, for interactive SQL applications, such as SPUFI, it is common 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 application declare its intent to do either of these things: • • Retrieve only a subset of the result set Give priority to the retrieval of the first few rows

DB2 uses the OPTIMIZE FOR n ROWS clause to choose access paths that minimize the response time for retrieving the first few rows. 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 is anything but 1, DB2 chooses an access path based on cost, and you won'necessarily avoid sorts. t 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. When OPTIMIZE FOR n ROWS is effective: OPTIMIZE FOR n ROWS is effective 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 ROWS clause, as in the following situations: • • • • The query uses SELECT DISTINCT or a set function distinct, such as 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. The query uses UNION.

An Introduction to Mainframes

- 140 -

so employee records are ordered by EMPNO.FIRSTNAME. If you have also defined a descending index on column SALARY. 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. To avoid many random. Example: The following statement uses that strategy to avoid a costly sort operation: SELECT LASTNAME. An index that matches the ORDER BY clause is more likely to be picked. because it has low overhead cost and appears to be more efficient if you want to retrieve only one row. DB2 would most likely use a table space scan. Effects of using OPTIMIZE FOR n ROWS: • • • • • The join method could change.SALARY FROM EMP ORDER BY SALARY DESC OPTIMIZE FOR 20 ROWS. 2. DB2 will probably use the SALARY index directly because you have indicated that you expect to retrieve the salaries of only the 20 most highly paid employees. then sort the rows on SALARY. FIRSTNAME. This is because no sort would be needed for the ORDER BY. You might use a query like this: SELECT LASTNAME. These statistics are stored in DB2 catalog tables and is critical in determining access paths for an SQL statement. In a join query. This technique can cause a delay before the first qualifying rows can be returned to the application.141 - . synchronous I/O operations. If you add the OPTIMIZE FOR n ROWS clause to the statement. Sequential prefetch is less likely to be requested by DB2 because it infers that you only want to see a small number of rows. An Introduction to Mainframes . An index is defined on column EMPNO. EMPNO. Nested loop join is the most likely choice. 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 needed for the ORDER BY clause.EMPNO. List prefetch is less likely to be picked. that index is likely to be very poorly clustered. SALARY FROM EMP ORDER BY SALARY DESC.16.DB2 – Tips and Tricks Example: Suppose that you query the employee table regularly to determine the employees with the highest salaries.

Every column defined to a DB2 table must be designated as either allowing or disallowing nulls. The indicator variable is transparent to the end user but must be provided for when programming in a host language. An indicator variable is defined to DB2 for each column that can accept nulls. DB2 represents null in a special hidden column known as indicator variable. Indicator Variable and -305 ABEND DB2 doesn’t differentiate between nulls that signify unknown data and those that signify inapplicable data.SAMPLE S# = 1234 What if the SELECT statement selects exactly one record but the status value in that record happens to be null? With this select statement.m) For SQL declaration of DECIMAL(n.19.18. Suppose we have the following SELECT statement EXEC SQL SELECT .m). The default definition for columns in a DB2 table is to allow nulls. 2. we will receive -305 SQLCODE An Introduction to Mainframes .: FROM WHERE END-SQL STATUS CITY WS-STATUS WS-CITY XXXX.DB2 – Tips and Tricks 2. Nulls can be prohibited for a column by specifying the NOT NULL or NOT NULL WITH DEFAULT option in the CREATE TABLE statement. DECIMAL(n.17. This distinction must be made by the program logic of each application. IMAGECOPY IMAGECOPY is a full backup of a DB2 table which can be used in recovery. the COBOL equivalent generated is PIC S9(n-m)V9(m) COMP-3 2.142 - . INTO : .

20. the user should include an indicator variable in the INTO clause in addition to the normal target variable as shown below EXEC SQL SELECT . then that indicator variable will be set to the value -1 and the ordinary target variable will remain unchanged. If the field to be retrieved is null and an indicator variable has been specified.: FROM WHERE END-SQL STATUS CITY WS-STATUS:WS-STATUS-IND WS-CITY XXXX. is similar to CASE statements used by many popular programming languages. DB2 will generate a null if an error ( for example division by zero or a data type conversion error) occurs in computing the value of some expression to be retrieved. for example SELECT CREATOR.SYSTABLES WHERE TYPE = ‘T’ UNION ALL SELECT CREATOR. A common application of the CASE statement will be to eliminate a multi table UNION statement.SYSTABLES WHERE TYPE = ‘V’ An Introduction to Mainframes . .e. ‘TABLE’ FROM SYSIBM.DB2 – Tips and Tricks If there is a chance that the source of a retrieval operation might be null. NAME.143 - . ‘VIEW’ FROM SYSIBM. not null). CASE Expressions The CASE Expression. We can solve -305 in two ways • • Change the program to handle indicator variables Correct the db field in error 2. The indicator variable will be set to -2 if the null is not directly derived from a database field but is instead generated by DB2. A CASE statement uses the value of a specified expression to select one statement among several for execution. NAME. The indicator variable will be zero otherwise (i. introduced to DB2 in V5.SAMPLE S# = 1234 IF WS-STATUS-ID = -1 . INTO : .

When CASE is used in place of multiple UNIONs. In the second kind. In the first kind. CASE C_CUST_BILL_STA WHEN 'PDF' THEN 'PAST DUE FINAL' WHEN 'CAN' THEN 'CANCELLED' WHEN 'COA' THEN 'CHARGED OFF' WHEN 'ACT' THEN 'ACTIVE' ELSE 'OTHER STATUS' END AS BILL_STATUS_DESC FROM DB2W1P. all of the WHEN conditions do similar "equal" checks against a common reference expression. NAME. The sequence of the CASE conditions can affect the answer. In the preceding example. each WHEN statement does its own independent check. performance most likely will be improved because DB2 will make fewer passes against the data to return a result set. The first WHEN check that matches is the one used. Can be coded more simply as SELECT CREATOR. There are two general flavors of the CASE expression.DB2 – Tips and Tricks UNION ALL SELECT CREATOR.VCSS_CUST ORDER BY 1 Result set I ACCT CA --------1002539 1603295 2302772 BILL STATUS -----ACT ACT ACT BILL STATUS DESC -------------ACTIVE ACTIVE ACTIVE An Introduction to Mainframes . CASE expressions enable one to do if-then-else type processing inside of SQL statements.SYSTABLES.144 - . ‘ALIAS’ FROM SYSIBM. First type SELECT I_ACCT_CA. CASE TYPE WHEN ‘T’ THEN ‘TABLE’ WHEN ‘V’ THEN ‘VIEW’ WHEN ‘A’ THEN ‘ALIAS’ END FROM SYSIBM. only one pass is required instead of three.SYSTABLES WHERE TYPE = ‘A’. NAME. C_CUST_BILL_STA AS BILL_STATUS.

145 - .VCSS_CUST ORDER BY 1 THEN THEN THEN THEN 'PAST DUE FINAL' 'CANCELLED' 'CHARGED OFF' 'ACTIVE' 'OTHER STATUS' Result set I ACCT CA --------1002539 1603295 2302772 2402770 2402770 2402770 2502623 2702608 3002996 5102952 5102952 5102952 5102952 5102952 5102952 5102952 5102952 5102952 5303050 5303050 BILL STATUS -----ACT ACT ACT ACT FIN COA ACT ACT ACT ACT PDF CAN FIN FIN FIN FIN FIN FIN FIN ACT BILL STATUS DESC -------------ACTIVE ACTIVE ACTIVE ACTIVE OTHER STATUS CHARGED OFF ACTIVE ACTIVE ACTIVE ACTIVE PAST DUE FINAL CANCELLED OTHER STATUS OTHER STATUS OTHER STATUS OTHER STATUS OTHER STATUS OTHER STATUS OTHER STATUS ACTIVE An Introduction to Mainframes . CASE WHEN C_CUST_BILL_STA = 'PDF' WHEN C_CUST_BILL_STA = 'CAN' WHEN C_CUST_BILL_STA = 'COA' WHEN C_CUST_BILL_STA = 'ACT' ELSE END AS BILL_STATUS_DESC FROM DB2W1P.DB2 – Tips and Tricks 2402770 2402770 2402770 2502623 2702608 3002996 5102952 5102952 5102952 5102952 5102952 ACT FIN COA ACT ACT ACT ACT PDF CAN FIN FIN ACTIVE OTHER STATUS CHARGED OFF ACTIVE ACTIVE ACTIVE ACTIVE PAST DUE FINAL CANCELLED OTHER STATUS OTHER STATUS Second type SELECT I_ACCT_CA. C_CUST_BILL_STA AS BILL_STATUS.

the result is NULL. If no WHEN matches and there is no ELSE clause. SUM(CASE C_CUST_BILL_STA WHEN 'CAN' THEN 1 ELSE 0 END) AS CAN_COUNT FROM DB2W1P. All result values must be of the same type. RAND) can not be used in the expression part of a CASE statement.2 WHEN 38 THEN CASE An Introduction to Mainframes . To count the total number of rows those are PDF (Past Due Final) and CAN (Cancelled) SELECT COUNT(*) AS TOTAL_COUNT. Functions that have an external action (e.VCSS_CUST WHERE C_CUST_BILL_STA = 'PDF' PDF COUNT ------35 The CASE expression can also be used in an UPDATE statement to do any one of several alternative updates to a particular field in a single pass of the data: UPDATE STAFF SET COMM = CASE DEPT WHEN 15 THEN COMM * 1.DB2 – Tips and Tricks Note • • • • • If more than one WHEN condition is true.1 WHEN 20 THEN COMM * 1. one of the NULL results must be inside of a CAST expression. If no WHEN matches. There must be at least one non-null result in a CASE statement. the first one processed that matches is used. see the below query SELECT COUNT(*) AS PDF_COUNT FROM DB2W1P.VCSS_CUST ORDER BY 1 Result set TOTAL COUNT -----402 PDF COUNT ----------35 CAN COUNT ----------18 To verify this result. Failing that.146 - . the value in the ELSE clause applies.g. SUM(CASE C_CUST_BILL_STA WHEN 'PDF' THEN 1 ELSE 0 END) AS PDF_COUNT.

21. 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).147 - • • • . you can issue the command LIST QUERIES (OWNER = <your id>). For example. you will be directly accessing production data (that is by default. the query will be available to other users also. To View the query you have just saved. if you set it to YES. That is if you access DB2 through TSOB. issue the save query as command.4 ELSE NULL END ELSE COMM END WHERE COMM IS NOT NULL AND DEPT < 50 2.You can save a query for future reference by the option SAVE QUERY AS <query name>. o Use DIS option to display a query o Run option to run the query o ERASE option to erase the query from the system An Introduction to Mainframes . To insert a new line (for example to add where clause) you can place the cursor at the bottom of the query and press PF 10. the system will be pointing to production databases) • You can set the profile by selecting PF 11 from the QMF main panel. If you use this option. Space (the name of DB2 DATABASE or TABLESPACE in which tables will be saved by the SAVE DATA command –explained later) etc. One important setting is the CONFIRM. Save Query As . Once you have saved the query.CUSTOMER_INFO in the command line and press the PF 6 option. To do this. if you enter the table name ABCD. you can do so by selecting the line and by pressing PF 11. 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).. If you want to delete a line from the listing thus obtained. This will list all the queries under your id. Query Management Facility You can access QMF either through TSOA or TSOB. Other options include Upper/Lower case. Another option with saving a query is SAVE QUERY AS <query name> (SHARE = ALL).DB2 – Tips and Tricks WHEN YEARS < 5 THEN COMM * 1. This option is useful when you don’t know the fields in the table. TSOA is test/development region and TSOB is production region. you can retrieve using LIST QUERIES (OWNER = <your id>) from the QMF main panel. it will list a SELECT statement with all the fields in the table without a where clause. after typing the query.3 WHEN YEARS >= 5 THEN COMM * 1.

While selecting the query to run. FORM is displayed.------. Where you can change the form and use this while running your query.----.DB2 – Tips and Tricks • Forms to format the output of a query We can use the FORM option to format the output of a QMF Query. A sample form is given below FORM.-----. Press PF 9 after a query has run.----. The modified form can be saved by using the SAVE option. you can specify the form option in the command line to get your display formatted according to your form (as shown below) An Introduction to Mainframes .---------------------------------------.148 - . Later you can use the LIST ALL option to get this form and modify it according to your requirement. COMMAND ===> SAVE FORM AS DSCRP_FORM Here also you can use the SHARE=Y option to make it available for all the users.MAIN COLUMNS: Total Width of Report Columns: 346 NUM COLUMN HEADING USAGE INDENT WIDTH EDIT SEQ --.--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 *** END *** PAGE: HEADING FOOTING FINAL: TEXT BREAK1: NEW PAGE FOOTING BREAK2: NEW PAGE FOOTING OPTIONS: OUTLINE? ===> ===> ===> FOR BREAK? ===> NO ===> FOR BREAK? ===> NO ===> ===> YES DEFAULT BREAK TEXT? ===> YES 5=Chart 11=Delete 6=Query 12=Report SCROLL ===> PAGE 1=Help 2=Check 3=End 4=Show 7=Backward 8=Forward 9= 10=Insert OK. This will show the default form for that query.

T_DSCRP_ABBR_DESC.149 - .DSCRP is displayed. N_EMPL_LST_RSLV.DB2 – Tips and Tricks SQL QUERY T30831.DSCRP LINE 1 SELECT N_EMPL_INIT_TEST. COMMAND ===> (F=DSCRP_FORM) 4=Print 10=Insert 5=Chart 11=Delete 6=Draw 12=Report SCROLL ===> PAGE You can change the width. T_DSCRP_DESC FROM DB27.TCSS_DSCRP *** END *** 1=Help 2=Run 3=End 7=Backward 8=Forward 9=Form OK.D_EST_DLVRY. C_DSCRP_PRTY_TEST. N_TEST_CASE_NO. T30831. indent etc… with Forms More on FORMS See the output display in QMF An Introduction to Mainframes . I_DSCRP.

there is a break on the N_TEST_CASE_NO and a count on N_EMPL_LST_RSLV. FORWARD performed.DB2 – Tips and Tricks REPORT LINE 73370 POS 1 79 N N C N T EMPL EMPL DSCRP TEST D DSCRP INIT LST I PRTY CASE EST ABBR TEST RSLV DSCRP TEST NO DLVRY DESC +----+--------------+----------+-----+-------+----------+---------------------* 1 G -------------* 1 G CLARK -------------* 1 ESTIMATED -------------* 1 SGRIMES -------------* 1 BRYAN -------------* 1 28446 2 R2 02/28/2006 J MEMBER/C MEMBER DON' 28445 1 PRODX P35A697R-MISSING A COD J 28447 1 EMER - CHNG WRKF DEST TABLE F C 28448 1 R15 - STL EQPT CHG S 28449 3 EMER 03/02/2006 CODE TABLE REQUEST M J * -------------2 ============== 28.449 28450 2 28451 2 PRODX - PSI RATE REFUND PROCES ELEC PMCHG CD CHKER NE *** END *** 1=Help 2= 3=End 7=Backward 8=Forward 9=Form OK. Please proceed. COMMAND ===> 4=Print 10=Left 5=Chart 11=Right 6=Query 12= SCROLL ===> PAGE Here.150 - . This can be obtained by specifying a form shown in the next page An Introduction to Mainframes .

To list all the forms.DSCRP_FORM is displayed.DSCRP_FORM COLUMNS: Total Width of Report Columns: 338 NUM COLUMN HEADING USAGE INDENT WIDTH EDIT SEQ --. You can use ERASE option to delete it. COMMAND ===> You can also change the width of a field to format the display.-----. AVERAGE also can be used to format the output for numeric items. you can use the option LIST TABLES option from the QMF main panel. T30831.------.--1 N_EMPL_INIT_TEST 1 4 C 1 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 *** END *** PAGE: HEADING FOOTING FINAL: TEXT BREAK1: NEW PAGE FOOTING BREAK2: NEW PAGE FOOTING OPTIONS: OUTLINE? ===> ===> ===> FOR BREAK? ===> NO ===> FOR BREAK? ===> NO ===> ===> YES DEFAULT BREAK TEXT? ===> YES 5=Chart 11=Delete 6=Query 12=Report SCROLL ===> PAGE 1=Help 2=Check 3=End 4=Show 7=Backward 8=Forward 9= 10=Insert OK.DB2 – Tips and Tricks FORM.---------------------------------------.----. Saving the output of a Query The output of a query can be saved as a table name and you can use the same in another query instead of a table. SUM. you can use LIST FORMS or LIST FORMS (OWNER = <your id>). To view all the tables that you have saved.----.151 - . This can be done by using the option SAVE DATA AS <table name>. An Introduction to Mainframes .MAIN T30831.

you can access the production version of the data by using the CONNECT TO <db name> command in the query panel. In the QMF query panel. you can use the CONNECT to make it point to the production version. TSOA will point to the test region databases. You can give a comment with the query by prefixing it with – You can use the short for O instead of OWNER in LIST command • • • • • • • • • An Introduction to Mainframes . You can’t use (SHARE = Y) option with SAVE DATA AS. For example you can use LIST QUERIES (NAME = %WEST%). By default. You can use more than one question mark at the same time to skip that many commands. Where you can use all the line commands to edit the queries.DB2 – Tips and Tricks Additional Information • You can use wild card characters while using the LIST option. 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 the reset option to clear out the queries/results in the QMF query panel You can use PF 6 to refresh the LIST Object panel Even if you have logged on to TSOA. From the QMF main panel. you can issue the EDIT command in the command line to open up a TSO/ISPF like editor.152 - . This will list all queries with ‘WEST’ in their name. If a query is running for a long time and to cancel the same you can use Shift + Esc key twice. you can issue PF 7 to retrieve the previous commands.

153 - .JCL – Tips and Tricks Chapter 3 JCL – Tips and Tricks An Introduction to Mainframes .

JCL – Tips and Tricks 3.RIJO. // DCB=(RECFM=FB. // SPACE=(CYL.RIJO.REGION=0M.JCLTEST. loaded or unloaded Rename selected members of a PDS or PDSE when copied Exclude members from a data set to be copied.MSGCLASS=Z. the PDS .DISP=SHR //SYSUT2 DD DSN=XXXX. unloaded or loaded Compress a PDS in place Convert a PDS to a PDSE or a PDSE to a PDS… Examples 3. 3.OUTDD=SYSUT2 /* Here. // UNIT=TESTDA.JCLTEST.1.JCLS.40)).JCLS will be copied to XXXX. JCL – Tips and Tricks IEBCOPY With IEBCOPY.BKUP.CATLG.'RIJO JOSEPH'. Copy an entire PDS to another PDS //RQRIJOJB JOB (RQRIJOJ.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1.(10.154 - . A sequential file that can be restored by IEBCOPY to create a PDS) into a PDS or PDSE Select specific members of a PDS or PDSE to be copied.XXXX.JCLS.DELETE).JCLTEST.JCLTEST.JCLS.10.LRECL=80.1. // DISP=(NEW. you are able to perform any of the following • • • • • • • • • Make a copy of a PDS or PDSE (PDSE is explained in the next section) Merge partitioned data sets (except when unloading) Create a sequential form of PDS or PDSE for backup or transport Reload one or more members from a PDSU (Partitioned Data Set Unloaded – An IEBCOPY unload data set.RIJO.1.BKUP An Introduction to Mainframes . // CLASS=A.RIJO.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //********************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.SAMPLE).

JCLTEST. //SYSUT2 DD DSN=XXXX.JCLTEST.JCLS.XXXX.PDSE.WORK.SRTINPUT.RIJO.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //******************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.WORK. You will get error if you try the following JCL //RQRIJOJB JOB (RQRIJOJ.'RIJO JOSEPH'.2.DISP=SHR.SRTINPUT. // UNIT=TESTDA.JCLS.JCLS where the latter will be created as a PDSE 3.LRECL=80.SRTINPUT.1.WORK.(10.BKUP are sequential data sets.10)).SRTINPUT and XXXX. // UNIT=TESTDA.MSGCLASS=Z.RIJO.MSGCLASS=Z. // DSORG=PO.3.JCLTEST.JCLTEST. An Introduction to Mainframes .1.RIJO.JCLTEST.JCLTEST. // DISP=(NEW.RIJO.RIJO.DELETE). // CLASS=A.OUTDD=SYSUT2 /* Here. The errors that are displayed are E1 E2 8 8 DSS20026E DSS11046E DATA SET 'XXXX.WORK.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1.1)).WORK.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //********************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.JCLTEST.LRECL=80.SRTINPUT' IS NOT AN UNLOADED DATA SET. // DCB=(RECFM=FB.SAMPLE).DISP=SHR //SYSUT2 DD DSN=XXXX.JCLTEST.DELETE).RIJO.CATLG.REGION=0M.RIJO.PDSE.BKUP.JCLTEST.BKUP' MUST BE A PDS.WORK.'RIJO JOSEPH'.CATLG.JCLTEST. // DSNTYPE=LIBRARY. // DCB=(RECFM=FB.SRTINPUT.155 - .JCL – Tips and Tricks 3.SAMPLE). // CLASS=A. XXXX. the PDS .(1.OUTDD=SYSUT2 /* Where. Convert a PDS to a PDSE //RQRIJOJB JOB (RQRIJOJ.REGION=0M. // SPACE=(CYL.RIJO.RIJO.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1. // SPACE=(CYL. // DISP=(NEW.JCLS will be copied to XXXX. DATA SET 'XXXX.RIJO.

5.REGION=0M.RIJO. // CLASS=J.SAMPLE).UNLOAD. // DISP=(NEW.RIJO.1.RLSE). // UNIT=CART. // DISP=(NEW.156 - . // DCB=(LRECL=80.BLKSIZE=0) //SYSIN DD * COPY INDD=SYSUT1.40).JCLTEST.BLKSIZE=0) //SYSIN DD * COPY INDD=SYSUT1. // DCB=(LRECL=80.RECFM=FB.'RIJO JOSEPH'.OUTDD=SYSUT2 /* An Introduction to Mainframes .REGION=0M. Unloading Copy an entire PDS to a sequential tape data set (Unloading) //RQRIJOJB JOB (RQRIJOJ.CATLG). // SPACE=(CYL.JCLTEST.4.MSGCLASS=Z.CATLG). // CLASS=J.JCLTEST.JCLS.JCLTEST.JCL – Tips and Tricks 3.UNLOAD.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //********************************************************* //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.JCLS.JCLS.SAMPLE).OUTDD=SYSUT2 /* 3.10.DISP=SHR //SYSUT2 DD DSN=XXXX.LOADED.'RIJO JOSEPH'.(10.RIJO. Loading Restoring unloaded copy from tape to DASD (Loading) //RQRIJOJB JOB (RQRIJOJ.DISP=SHR //SYSUT2 DD DSN=XXXX.RECFM=FB.RIJO.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //******************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX. // UNIT=TESTDA.JCLS.MSGCLASS=Z.1.

// SPACE=(CYL.JCLTEST.7. // DCB=(LRECL=80. // CLASS=J.SAMPLE).5).6.RIJO.1.JCLS.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1.REGION=0M.IEBCOPY.5.DISP=SHR //SYSIN DD * COPY INDD=SYSUT1.RIJO. IEBCOPY5.JCLTEST.RECFM=FB.'RIJO JOSEPH'.IEBCOPY4.JCLTEST.157 - .JCLS. // CLASS=J.REGION=0M.IEBCOPY3.'RIJO JOSEPH'.RLSE). SELECT SELECT lets you copy only selected members //RQRIJOJB JOB (RQRIJOJ.RIJO.OUTDD=SYSUT2 SELECT MEMBER=(IEBCOPY1.DELETE).JCLS.JCL – Tips and Tricks 3.PDSE.OUTDD=SYSUT1 /* You need not have to worry about compressing if you are using a PDSE (please refer the section on PDSE) 3.DISP=SHR //SYSUT2 DD DSN=XXXX. // DISP=(NEW.SAMPLE).MSGCLASS=Z.CATLG.IEBCOPY2.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //****************************************************************** **** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.IEBCOPY6) /* // An Introduction to Mainframes . Compressing Compressing is used to make use of the fragmented space in a PDS //RQRIJOJB JOB (RQRIJOJ.MSGCLASS=Z.1.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //********************************************************* //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.(5.

JCLS. // SPACE=(CYL.(IEBCOPY6.JCLTEST. IEBCOPY5.XXXX. // DCB=(LRECL=80.5.REGION=0M.9.PDSE.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1.SAMPLE).DELETE).JCLTEST.JCL – Tips and Tricks 3.RIJO. EXCLUDE Exclude lets you exclude few members while copying //RQRIJOJB JOB (RQRIJOJ.JCLTEST.JCLTEST. see this example.1.MSGCLASS=Z.DELETE).OUTDD=SYSUT2 SELECT MEMBER=(IEBCOPY1.IEBCOPY2.CATLG.8.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //****************************************************************** **** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.CATLG.RIJO.IEBCOPY3.RIJO.40).RECFM=FB. // DISP=(NEW.REGION=0M.158 - .RIJO.IEBCOPY.10.RLSE).(5. // DISP=(NEW.RECFM=FB.(10.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //**************************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.SAMPLE).NEWIEBC6)) /* // An Introduction to Mainframes .1.IEBCOPY3. IEBCOPY5.'RIJO JOSEPH'.OUTDD=SYSUT2 EXCLUDE MEMBER=(IEBCOPY1.JCLS.DISP=SHR //SYSUT2 DD DSN=XXXX.IEBCOPY6) /* // 3.IEBCOPY4.OTHERS. // DCB=(LRECL=80.JCLTEST. // SPACE=(CYL. Rename IEBCOPY lets you rename a member while copying.PDSE.IEBCOPY4. // CLASS=A.'RIJO JOSEPH'. // CLASS=J.BLKSIZE=800) //SYSIN DD * COPY INDD=SYSUT1.JCLS.JCLS.IEBCOPY2.DISP=SHR //SYSUT2 DD DSN=XXXX. IEBCOPY6 will be renamed in the new PDS .MSGCLASS=Z.5).JCLS.RLSE).RIJO.IEBCOPY as NEWIEBC6 //RQRIJOJB JOB (RQRIJOJ.

2.JCL – Tips and Tricks 3.RIJO.10.JCLTEST.JCLS.DELETE). XXXX.OUTDD=SYSUT3 /* // Here.DISP=… *SEQUENTIAL INPUT FILE //SYSUT2 DD DSN=….OTHERS.RLSE).JCLTEST.ALL.DISP=SHR //SYSUT2 DD DSN=XXXX. // CLASS=A.RIJO.JCLS.REGION=0M.JCLS.RIJO. // SPACE=(CYL.40).JCLTEST.SYSUT2).(10.JCLTEST.1.JCLS.'RIJO JOSEPH'.JCLS.CATLG.JCLS.DISP=SHR //SYSUT3 DD DSN=XXXX.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBCOPY //********************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.IEBCOPY and XXXX.RIJO.SAMPLE).OTHERS will be merged to a new PDS . etc… Sample IEBGENER JCL //JS10 EXEC PGM=IEBGENER.RIJO. Merging PDSs //RQRIJOJB JOB (RQRIJOJ.DISP=… *OUTPUT FILE //SYSIN DD * CONTROL STATEMENTS /* An Introduction to Mainframes .RIJO.IEBCOPY.XXXX.MSGCLASS=Z. or a member of either.ALL 3.10. IEBGENER IEBGENER is a generalized copy utility used to perform the following tasks • • • • Produce a backup copy of a sequential data set or a member of a PDS or PDSE Produce a PDS or PDSE.BLKSIZE=800) //SYSIN DD * COPY INDD=(SYSUT1. // DCB=(LRECL=80.RECFM=FB. from a sequential file Produce a printed list of either sequential data sets or PDS/PDSE members Reblock a data set or change its logical record length.JCLTEST. // DISP=(NEW.JCLTEST.159 - .REGION=1024K //SYSPRINT DD SYSOUT=* *MESSAGES //SYSUT1 DD DSN=….

// DISP=SHR.PDSE.1).WORK. Backup of a PDS/PDSE member to another PDS/PDSE This JCL lets you create a backup of a PDS/PDSE member to another PDS/PDSE //RQRIJOJB JOB (RQRIJOJ. // CLASS=A.PDSE.160 - .'RIJO JOSEPH'.JCLTEST. // UNIT=TESTDA.BLKSIZE=800) // 3. // DISP=SHR //SYSUT2 DD DSN=XXXX.(1.JCLS(IEBGEN3).RIJO.SAMPLE).BLKSIZE=800) //SYSIN DD DUMMY //SYSUDUMP DD SYSOUT=* An Introduction to Mainframes . // DCB=(RECFM=FB. // SPACE=(CYL.JCL – Tips and Tricks Examples 3.DELETE).RLSE). // SPACE=(CYL.JCLTEST. // DCB=(RECFM=FB.LRECL=80. Create a data set from in stream data //RQRIJOJB JOB (RQRIJOJ.RIJO.SAMPLE). // UNIT=TESTDA.JCLTEST.2.REGION=0M.LRECL=80.CATLG.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //******************************************************************** //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //SYSUT1 DD * AJITH TVM MCA 15000 12345678 AJAY TVM MCA 18000 11111111 ANIL TVM BTECH 15000 22222222 SAJAN TVM MCA 18000 12121212 KIRAN TVM MCA 15000 33333333 THOMAS TVM BTECH 18000 13131313 PHILIP TVM MCA 15000 21212121 MANU TVM MCA 18000 34343434 JAYA CHANDRAN TVM BTECH 15000 45544554 ARUN TVM BTECH 18000 78654321 //SYSUT2 DD DSN=XXXX.1.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //************************************************************* //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.'RIJO JOSEPH'.(1. // CLASS=A.RIJO.1).RLSE).2.SRTINPUT.MSGCLASS=Z.MSGCLASS=Z. // DISP=(NEW.REGION=0M.2.JCLS(IEBGEN2).

4.BLKSIZE=800) //SYSIN DD DUMMY //SYSUDUMP DD SYSOUT=* An Introduction to Mainframes .1).JCLTEST.RLSE).MSGCLASS=Z.JCLTEST. // SPACE=(CYL.WORK(SRTINBK).SAMPLE).LRECL=80.2.RIJO.WORK.DELETE).RIJO. // CLASS=A. // CLASS=A. // DCB=(RECFM=FB.'RIJO JOSEPH'.RLSE).2.WORK.CATLG.MSGCLASS=Z. // DCB=(RECFM=FB. Backup of a sequential data set to a member of a PDS/PDSE //RQRIJOJB JOB (RQRIJOJ.WORK.REGION=0M.REGION=0M. // DISP=SHR. // DISP=SHR //SYSUT2 DD DSN=XXXX. // DISP=(NEW.'RIJO JOSEPH'.SRTINPUT.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //********************************************************* //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.BLKSIZE=800) //SYSIN DD DUMMY //SYSUDUMP DD SYSOUT=* 3.RIJO.LRECL=80.1). // UNIT=TESTDA.161 - . // UNIT=TESTDA.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //******************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.SAMPLE).(1.SRTINPUT.(1. // SPACE=(CYL.JCL – Tips and Tricks 3.SRTINBK. // DISP=SHR //SYSUT2 DD DSN=XXXX. Backup of a sequential data set to another sequential data set This JCL lets you copy a sequential data set to another sequential data set //RQRIJOJB JOB (RQRIJOJ.JCLTEST.3.RIJO.JCLTEST.

JCLTEST.BLKSIZE=800) //SYSIN DD DUMMY //SYSUDUMP DD SYSOUT=* Here.JCLTEST. // DISP=SHR //SYSUT2 DD DSN=XXXX.REGION=0M. // DISP=(NEW.RLSE). // UNIT=TESTDA.5. // DSORG=PO.LRECL=80.JCL – Tips and Tricks 3.2.PDSE. Back up copy of a PDS/PDSE member to a sequential data set //RQRIJOJB JOB (RQRIJOJ. // DCB=(RECFM=FB.WORK(SRTINBK) will be copied to XXXX.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //********************************************************* //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX. // DCB=(RECFM=FB. // DISP=(NEW.NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //*********************************************************** //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=XXXX.162 - .JCLTEST.BLKSIZE=800) //SYSIN DD DUMMY //SYSUDUMP DD SYSOUT=* 3. // DSNTYPE=LIBRARY.6.WORK(SRTINBK).RIJO. // CLASS=A.MSGCLASS=Z.RLSE).REGION=0M.(1. An Introduction to Mainframes .'RIJO JOSEPH'.DELETE). // DISP=SHR //SYSUT2 DD DSN=XXXX.RIJO.RIJO.JCLTEST.DELETE).LRECL=80.CATLG.RIJO.RIJO.SAMPLE).1).WORK.SAMPLE). // SPACE=(CYL.MSGCLASS=Z. // SPACE=(CYL.JCLTEST.PDSE. // CLASS=A. // UNIT=TESTDA.(1.1).JCLTEST.WORK(SRTINBK) where the latter is a new PDS and will be created as a PDSE.WORK(SRTINBK).RIJO. To produce PDSE from a PDS member //RQRIJOJB JOB (RQRIJOJ.WORK(SRTINBK). the PDS member XXXX.CATLG.SRTBKUP.'RIJO JOSEPH'.2.

JCL – Tips and Tricks

3.2.7. To change the block size
//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH', // CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //************************************************************ //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=*

3.2.8. You will get error if you try the following JCL
//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH', // CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEBGENER //********************************************************* //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=*

Where, XXXX.JCLTEST.RIJO.WORK and XXXX.JCLTEST.RIJO.WORK.BKUP are PDS You will get errors like this.
E1 8 DSS20027E DDNAME 'SYSUT1', DSN 'XXXX.JCLTEST.RIJO.WORK' SHOULD HAVE BEEN A PHYSICAL SEQUENTIAL DATA SET. ACTUAL DSORG IS PO. DDNAME 'SYSUT2', DSN 'XXXX.JCLTEST.RIJO.WORK.BKUP' SHOULD HAVE BEEN A PHYSICAL SEQUENTIAL DATA SET. ACTUAL DSORG IS PO.

E2

8

DSS20027E

An Introduction to Mainframes

- 163 -

JCL – Tips and Tricks

3.3.

PDSE

A PDSE is a Partitioned Data Set Extended. It consists of a directory and zero or more members, just like a PDS. It can be created with JCL, TSO/E and ISPF just like a PDS and can be processed with the same access methods. 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 have up to 15,728,639 records Allocating a PDSE

3.3.1. Batch Allocation
The DSNTYPE JCL Keyword specifies that a data set should be a PDSE or PDS. If DSNTYPE=LIBRARY is specified, the data set is a PDSE. If DSNTYPE=PDS is specified, the data set is a PDS
//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH', // CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID //* //STEP1 EXEC PGM=IEFBR14 //********************************************************* //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) //

When directory blocks are not specified, DSORG=PO must be included to identify the data set as partitioned
//SYSIN // // // // // DD DSN=XXXX.JCLTEST.RIJO.PDSE2, DISP=(NEW,CATLG,DELETE), DSNTYPE=LIBRARY, DSORG=PO, UNIT=TESTDA, SPACE=(CYL,(10,10)),

An Introduction to Mainframes

- 164 -

JCL – Tips and Tricks

3.3.2. 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 attributes to the new PDSE
ALLOC DS(‘XXXX.JCLTEST.RIJO.PDSE2’) LIKE(‘XXXX.JCLTEST.RIJO.PDSE’)

The example below shows an example of allocating a PDSE using the LIKE parameter to copy the attributes of an existing PDS. Adding the DSNTYPE(LIBRARY) parameter to the allocation makes the data set PDSE.
ALLOC DS(‘XXXX.JCLTEST.RIJO.PDSE3’) LIKE(XXXX.JCLTEST.RIJO.PDSE’) DSNTYPE(LIBRARY)

3.3.3. ISPF Allocation
We can use the 3.2 option
Data Set Name . . . : XXXX.JCLTEST.RIJO.PDSE6 . . . MCTSL . . . SCSMS . . . TSLB90 . . . . . . DCPOTSL . . . TRACK . 1 1 . 0 . FB . 80 . 800 : LIBRARY (Blank for default management (Blank for default storage class) (Blank for system default volume) (Generic unit or device address) (Blank for default data class) (BLKS, TRKS, CYLS, KB, MB, BYTES or RECORDS) (M, K, or U) (In above units) (In above units) (Zero for sequential data set) *

Management class class) Storage class . Volume serial . ** Device type . . ** Data class . . . Space units . .

Average record unit Primary quantity . Secondary quantity Directory blocks . Record format . . . Record length . . . Block size . . . . Data set name type

(LIBRARY, HFS, PDS, or blank) (YY/MM/DD, YYYY/MM/DD

*

An Introduction to Mainframes

- 165 -

JCL – Tips and Tricks 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. With a PDSE allocation, the Directory blocks field is optional. Creating PDSE Members Member creation for PDSE is functionally same as for a PDS. There is no functional difference between the two formats Deleting PDSE Members 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 deleted. This is the same as for a PDS.

3.3.4. IEBCOPY TO CONVERT A PDS TO PDSE
Here is an example of using IEBCOPY to convert a PDS to a PDSE. In this example, 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 parameter to get the DCB information form a PDS or PDSE
//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH', // 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.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

3.3.5. When to use a PDSE
A data set should be considered for PDSE allocation or conversion when one or more of these characteristics apply • • Frequent compresses are needed for the data set Out of space abends occur often - 166 -

An Introduction to Mainframes

D35A65A. . (NEW.P35CR118. It was like this . The operations restarted the job at the abended step and it again abended with JCL ERR.4.PLAN=$CSD18. // LRECL=213.(&LG)) Initially the Job abended with S0C3 in step JS010DB2 and the data set ‘TEMP. An Introduction to Mainframes .LT) //*BSD //******************************************************************* //* * //*---------------------.STEP: JS010DB2 ---------------------------* //* * //* PROGRAM-NUMBER : P35CR118 * //* * //* DESCRIPTION : CREATE EXTRACT FILE FOR INPUT TO DNP REPORT * //* PROGRAM P35CR121 * //* * //******************************************************************* //*ESD //OD35234O DD SYSOUT=&BUND //D35A65AO DD DSN=TEMP. // DSORG=PS. // COND=(0. CATLG.CATLG.&HINODE. // DISP=(NEW. I analyzed the abend and found that the problem was with the restart step.DNPFILE.P35CR118. // SPACE=(213.D35A65A. This job was running successfully for years and how can it end with JCL ERR? The answer I found was very interesting.. //JS010DB2 EXEC DB2QBTCH.CATLG). CATLG. // RECFM=FB. CATLG) and a production ABEND I was surprised to see one Job abended with JCL ERR in production.DNPFILE’ got created and catalogued and remained in the catalogue even after the job abended because of the (NEW. The Job abended initially with S0C3 – The return code was -911 (Deadlock or Timeout).PROG=P35CR118.167 - .&HINODE..JCL – Tips and Tricks • • • • • • A large directory leads to lengthy directory searches (PDS directory searches are sequential while PDSE searches are indexed) The directory size is unknown at allocation time The directory size will grow considerably The data set is shared for output Members will be shared and reused many times Protection is needed to prevent users from overwriting the directory or changing the DCB attributes for members 3.REGION=8M.

where every day the Job B completes the processing done by Job A.&HINODE.. the data set already exists in the catalogue’ So the right disposition of this data set is (NEW. I looked at the Job listing and found that the Job B completed successfully and it deleted the data set too. and then the only reason can be the job A might have been submitted more than twice the day before… that also did not happen. I started cursing the machines… I started thinking that these stupid machines will behave differently at different times… After some time. Job A abended with JCL ERR.D35A65A. Since Job B reads. CATLG) in a scenario where we want to retain the datasets even if the job is abnormally terminated..5.168 - . 3. processes and then deletes the file produced by Job A. This is a daily sequence.P35CR118. I took a backup copy of this dataset and I manually deleted the same and restarted the job and send across a mail to the distribution list…. which is read by Job B. the day before for testing purpose…without changing the production data set name that caused the creation of the production data set (the output file from A) and hence the abend… I scratched my head and this time my thought was different… that the problem was not with the machines…but with… An Introduction to Mainframes . I became confused. CATLG. So when the operations restarted the job from the abended step. processes it and then deletes the original input file. Job B is the successor of Job A.DNPFILE.! Albeit reluctantly.JCL – Tips and Tricks CATLG) disposition. I got a mail from one developer… He submitted Job A. I thought that the Job B might not have run the day before and caused the abend. Another Production ABEND – JCL ERR I had another interesting analysis with a job flow. DELETE). We can use (NEW. CATLG. it was trying to allocate the output file (this is the file that is read by the Job B and then after processing subsequently deletes it) and found that the data set is already existing. there were no IEFBR14 steps to clear out the data sets in Job A. it ended with ‘Unable to allocate the data set TEMP. where Job A creates an output file.

JCL – Tips and Tricks

3.6.

ICETOOL

ICETOOL is built on top of DFSORT. It comes up with lots of processing options. One sample JCL is shown below.
//TEXTR001 JOB 00124,'TEST', // CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID //TOOLS1 EXEC PGM=ICETOOL, // COND=(0,NE) //************************************************************ //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD DSN=ABCD.TEST.INPUT(0), // DISP=SHR //OUT1 DD DSN=ABCD.TEST.TEXTRACT.V001, // DISP=(,CATLG,DELETE), // UNIT=TESTDA, // SPACE=(CYL,(10,10),RLSE), // DCB=(RECFM=FB,LRECL=2700) //OUT2 DD DSN=ABCD.TEST.TEXTRACT.V002, // DISP=(,CATLG,DELETE), // UNIT=TESTDA, // SPACE=(CYL,(10,10),RLSE), // DCB=(RECFM=FB,LRECL=2700) //OUT3 DD DSN=ABCD.TEST.TEXTRACT.V003, // DISP=(,CATLG,DELETE), // UNIT=TESTDA, // SPACE=(CYL,(10,10),RLSE), // DCB=(RECFM=FB,LRECL=2700) //TOOLIN DD * COPY FROM(IN) TO(OUT1) USING(CTL1) COPY FROM(IN) TO(OUT2) USING(CTL2) COPY FROM(IN) TO(OUT3) USING(CTL3) /* //CTL1CNTL DD * INCLUDE COND=(415,3,ZD,EQ,301,AND, 418,2,ZD,EQ,03,AND, 469,2,CH,EQ,C' ',AND, 1702,22,CH,EQ,C' ') OPTION STOPAFT=100 /* //CTL2CNTL DD * INCLUDE COND=(415,3,ZD,EQ,800,AND, 418,2,ZD,EQ,26,AND, 469,2,CH,EQ,C'C2',AND, 1702,22,CH,EQ,C' OPTION STOPAFT=100 /*

')

An Introduction to Mainframes

- 169 -

JCL – Tips and Tricks
//CTL3CNTL DD * INCLUDE COND=(415,3,ZD,EQ,301,AND, 418,2,ZD,EQ,03,AND, 469,2,CH,EQ,C' ',AND, 1702,22,CH,EQ,C' OPTION STOPAFT=100 /* //SYSOUT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //*

')

This JCL copies records from ABCD.TEST.INPUT to the three OUT datasets as shown in the JCL based on the control card as specified in the COPY statement. It also does the additional processing of copying only the first 100 records satisfied by the INCLUDE COND statement

3.7.

ICETOOL - count the records

I had another requirement – to check whether the file contains any records. If the file is empty, I shouldn’t print that file (even if the file is empty, the printer interface will print few pages to align the printer, we wanted to avoid that), otherwise I can direct the output to the printer. The JCL will look like this
//JS020SRT //TOOLMSG //DFSMSG //IN //OUT1 // // // // // //OUT2 // // // // // //OUT3 // // // // // EXEC PGM=ICETOOL,COND=(0,LT) DD SYSOUT=* DD SYSOUT=* DD DISP=SHR,DSN=CY$$.P35AM084.OD35809.PRINT DD DSN=TEST.RIJO.P35AM084.FD35765.LABE001, DISP=(NEW,CATLG,DELETE), SPACE=(320,(30,10),RLSE), AVGREC=&SIZE, RECFM=FB, LRECL=320 DD DSN=TEST.RIJO.P35AM084.FD35765.LABE002, DISP=(NEW,CATLG,DELETE), SPACE=(320,(30,10),RLSE), AVGREC=&SIZE, RECFM=FB, LRECL=320 DD DSN=TEST.RIJO.P35AM084.FD35765.LABE003, DISP=(NEW,CATLG,DELETE), SPACE=(320,(30,10),RLSE), AVGREC=&SIZE, RECFM=FB, LRECL=320

An Introduction to Mainframes

- 170 -

JCL – Tips and Tricks
//OUT4 DD DSN=TEST.RIJO.P35AM084.FD35765.LABE004, // DISP=(NEW,CATLG,DELETE), // SPACE=(320,(30,10),RLSE), // AVGREC=&SIZE, // RECFM=FB, // LRECL=320 //TOOLIN DD * COPY FROM(IN) TO(OUT1) USING(CTL1) COPY FROM(IN) TO(OUT2) USING(CTL2) COPY FROM(IN) TO(OUT3) USING(CTL3) COPY FROM(IN) TO(OUT4) USING(CTL4) /* //CTL1CNTL DD * OPTION STOPAFT=2500 /* //CTL2CNTL DD * SKIPREC=2500 OPTION STOPAFT=2500 /* //CTL3CNTL DD * SKIPREC=5000 OPTION STOPAFT=2500 /* //CTL4CNTL DD * SKIPREC=7500 /* //JS030SRT EXEC PGM=ICETOOL,COND=(0,LT) //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN1 DD DISP=SHR,DSN=TEST.RIJO.P35AM084.FD35765.LABE001 //TOOLIN DD * COUNT FROM(IN1) EMPTY /* /*JOBPARM LINECT=0 //JS040DB2 EXEC DB2UBTCH,PROG=P35AM042,PLAN=DB2W1CB,COND=(0,LT) //*BSD

Lots of processing is happening here, the input file CY$$.P35AM084.OD35809.PRINT will be copied to the 4 OUT files with 2500 records each and the last file will contain the left over records. That is it can contain more than 2500 records. There can be a case that the output files are empty. The COUNT option will help us to set the return code depending on the number of records in the file given in the FROM control parameter. If the file is empty, it will set the return code to 12, the next step is coded with COND=(0,LT) and it will avoid processing the empty file

3.8.

SORT – modify the output record

If you want to copy only a selected range of fields from the input record to the output record, you can use the following format. In this case, the output record will contain the 1:288 of the input record and the rest of the space will be blanked out

An Introduction to Mainframes

- 171 -

JCL – Tips and Tricks
//JS010SRT EXEC SORTD,COND=(0,LT) //SYSOUT DD SYSOUT=* //SORTMSG DD SYSOUT=* //* //SORTIN DD DSN=CY035.P35MR113.FD35765.LABEL,DISP=SHR //* //SORTOUT DD DSN=CY$$.T30831.FD35765.LABEL.SRT, // DISP=(NEW,CATLG,CATLG), // SPACE=(320,(30,10),RLSE), // AVGREC=K, // RECFM=FB, // LRECL=320 //SYSIN DD * SORT FIELDS=COPY OUTREC FIELDS=(1:1,288,C' END /*

')

An Introduction to Mainframes

- 172 -

173 - .DFSORT – Tips and Tricks Chapter 4 DFSORT – Tips and Tricks An Introduction to Mainframes .

In addition to the three basic functions. • You can control which record to keep in the final output data set of a DFSORT run by using INCLUDE and OMIT statements in your application. testing each record against the criteria that you supply and retaining only the ones you want for the output data set You can edit and reformat your records before or after other processing by using INREC and OUTREC statements. When you copy records. copy or merge application from a single pass over one or more input data sets by using OUTFIL control statements.DFSORT – Tips and Tricks 4. 4. you can perform other processing simultaneously. with each statement specifying the OUTFIL processing to be performed for one or more output data sets. You can sum numeric information from many records into one record with the SUM statement. These statements work like filters. Merging records first requires that the input data sets are identically sorted for the information you will use to merge them and they are in the same order required for output. You can use multiple OUTFIL statements. choosing an order more useful to you than the original one When you merge records. merge and copy information • • • When you sort records. OUTFIL processing begins after all other processing ends • • • An Introduction to Mainframes .174 - . You can merge up to 100 different data items at a time. For example. INREC and OUTREC statements support a wide variety of reformatting tasks. DFSORT – Tips and Tricks DFSORT Unleashed DFSORT is a program you use to sort. if you want to know the total amount of a yearly payroll. you arrange them in a particular sequence. you combine the contents of two or more previously sorted data sets into one. you make an exact duplicate of each record in your data set. you can add the values for a field containing salaries from the records of all your employees You can create one or more output datasets for a sort.1.

RIJO. // DCB=(RECFM=FB.REGION=0M. // DISP=SHR //SORTOUT DD DSN=HINODE.2.CATLG.(1.DELETE). // CLASS=A.NOTIFY=&SYSUID //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SORTIN DD DSN=HINODE.175 - .BLKSIZE=800) //SYSIN DD * SORT FIELDS=(1.WORK.SRTOUT.SRTINPUT.SAMPLE). Input A simple JCL for SORT AJITH AJAY ZARIN SAJAN KIRAN THOMAS PHILIP MANU JAYA CHANDRAN ARUN TVM TVM TVM TVM TVM TVM TVM TVM TVM TVM MCA MCA BTECH MCA MCA BTECH MCA MCA BTECH BTECH 15000 18000 15000 18000 15000 18000 15000 18000 15000 18000 12345678 11111111 22222222 12121212 33333333 13131313 21212121 34343434 45544554 78654321 JCL //ABCDEFGX JOB (A123.20. // SPACE=(CYL. An Introduction to Mainframes .DFSORT – Tips and Tricks 4. // DISP=(NEW.MSGCLASS=Z.RIJO.FORMAT=CH /* Output AJAY AJITH ARUN JAYA CHANDRAN KIRAN MANU PHILIP SAJAN THOMAS ZARIN TVM TVM TVM TVM TVM TVM TVM TVM TVM TVM MCA MCA BTECH BTECH MCA MCA MCA MCA BTECH BTECH 18000 15000 18000 15000 15000 18000 15000 18000 18000 15000 11111111 12345678 78654321 45544554 33333333 34343434 21212121 12121212 13131313 22222222 The same JCL can also be written with a control card (control statements embedded in a dataset) containing sort control statements. // UNIT=TESTDA.RLSE).A).LRECL=80.WORK.'RIJO JOSEPH'.1).

NOTIFY=&SYSUID EXEC PGM=SORT DD SYSOUT=* DD SYSOUT=* DD DSN=HINODE.'RIJO JOSEPH'.20.BLKSIZE=800) DD DSN=HINODE.LRECL=80.DFSORT – Tips and Tricks JCL //ABCDEFGX // //STEP1 //SYSOUT //SYSPRINT //SORTIN // //SORTOUT // // // // //SYSIN // JOB A123.RIJO. and can be represented at a high level as follows An Introduction to Mainframes .1).RIJO.RIJO.(1.REGION=0M. DISP=(NEW.SRTOUT3. but not both. DISP=SHR Control Card SORT FIELDS=(1. CLASS=A.CATLG.DELETE).JCLS(SRT2CTC).RLSE). DISP=SHR DD DSN=HINODE.3. The INCLUDE statement selects the records you want to include. SPACE=(CYL. we will use control card instead of inline control statement 4.FORMAT=CH From hereafter. DCB=(RECFM=FB.SRTINPUT. You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run.WORK. A logical expression is one or more relational conditions logically combined. UNIT=TESTDA. INCLUDE Control Statement Use an INCLUDE statement if you want only certain records to appear in the output data set. based on fields in the input record.176 - .WORK.A).MSGCLASS=Z.

• Bit Logic Tests Test the state (on or off) of selected bits in a binary field using a bit or hexadecimal mask or a bit constant. the current two digit year date or another two digit year date field. you can compare the first 6 bytes of each record with its last 6 bytes. hexadecimal.DFSORT – Tips and Tricks If the logical expression is true for a particular record. Or you can include only those records which have bits 3 and 12 on and bits 6 and 8 off in a 2 byte field • Date Comparisons Compare a two digit year date field to a two digit year date constant. you can search the value in a six byte field for the character constant ‘OK’ and include only those records for which ‘OK’ is found somewhere in the field or you can search for the character constant J69 or L92 or J82 for the value in a 3 byte field. For example. character or current date constant For example. you can include only those records which have bits 0 and 2 on in a one byte field. and include only those records in which those fields are identical or you can compare a field with today’s date and include only those records for future events • Substring comparison tests Search for a constant within a field value or a field value within a constant For example. the record is included in the output data set Four types of relational conditions can be used as follows • Comparisons Compare two compare fields or a compare field and a decimal. using the century window in effect.177 - . and include only those records for which J69 or J92 or J82 appears in the field. COND An Introduction to Mainframes .

Relational conditions can be logically combined.) The symbols & (AND) and | (OR) can be used instead of the words Comparisons Relational Condition Format Two formats for the relational condition can be used. the following rules apply • • AND statements are evaluated before OR statements unless parentheses are used to change the order of evaluation.DFSORT – Tips and Tricks Logical expression: specifies one or more relational conditions logically combined. expressions inside parentheses are always evaluated first (Nesting of parentheses is limited only by the amount of storage available. ALL or (ALL): Specifies that all of the input records are to be included in the output data sets. Please see the picture below An Introduction to Mainframes . the record is included in the output data set. FORMAT FORMAT=F can be used to specify a particular format for one or more compare fields Relational Condition The relational condition specifies that a comparison or bit logic test be performed. based on fields in the input record. If the logical expression is true for a given record. NONE or (NONE): Specifies that none of the input records are to be included in the output data sets.178 - . If they are combined. with AND or OR to form a logical expression.

Equal to Greater than Less than NE GE LE Not equal to Greater than or equal to Less than or equal to • • An Introduction to Mainframes .DFSORT – Tips and Tricks Comparison Operators are follows EQ GT LT Fields p1. m1: specifies the length of the compare field. The first data byte of a variable length record (VLR) has position 5 (because the first 4 bytes contain the record descriptor word).179 - . Acceptable lengths for different formats are given below. The first data byte of a fixed length record (FLR) has relative position 1. f1: specifies the format of the data in the compare field. Permissible formats are given below. m1. All compare fields must start on a byte boundary and no compare field can extend beyond byte 32752. f1: These variables specify a field in the input record to be compared either to another field in the input record or to a constant • p1: specifies the first byte of the compare field relative to the beginning of the input record.

m1. character string (C’xx…xx’).f1 field will be compared. or hexadecimal string (X’yy…yy’).180 - . Constants A constant can be a decimal number (n. -n).DFSORT – Tips and Tricks p2. f2: these variables specify another field in the input record with which the p1. +n. An Introduction to Mainframes . m2.

DATE1(C). An Introduction to Mainframes . If you want to include a single apostrophe in the character string. DDD represents the day of the year (001-366). YYYY represents the year. DD represents the day (01-31). DATE3.DFSORT – Tips and Tricks Decimal Number Format The format for coding decimal constant is Current Date as decimal number DATE1P. YYYY represents the year. You can specify up to 256 characters. The table below shows the decimal number generated for each current date operand along with an example. DATE2. DD represents the date (01-31) and DDD represents the day of the year (001-366) Operand DATE1P DATE2P DATE3P Character String Format The format for coding a character string constant is Constant +YYYYMMDD +YYYYMM +YYYYDDD April 19. DATE2(C). Thus Required: O’NEILL Specify: C’O’’NEILL’ Current Date as Character String DATE1. DATE2P or DATE3P can be used to generate a decimal number for the date of the run. you must specify it as two single apostrophes. MM represents the month (01-12).181 - . mm represents the month (01-12). HH represents the hour (00-23) . The figure below shows the character string generated for each current date operand along with an example using (/) for (c) where relevant. DATE3(C) and DATE4 can be used to generate a character string for the date of the run. 2001 +20010419 +200104 +2001109 The value x may be any EBCDIC character.

In a field to constant comparison.52.DATE4) Would compare the field in positions 1-13 to the truncated DATE4 constant C’YYYY-MMDD-HH’ Hexadecimal String Format The value yy represents any pair of hexadecimal digits.45’ Tip: When a field is shorter than the character string it is compared to.MM. For example. You can take advantage of this to compare a field to only part of the DATE4 timestamp when appropriate. 04:52:45 PM C’20010419’ C’2001/04/19’ C’200104’ C’2001/04’ C’2001109’ C’2001/109’ C’2001-04-19-16. the shorter compare field is padded appropriately. Padding and Truncation In a field to field comparison. you should not include the first digit or sign in a hexadecimal constant to be compared to a PD0 field. DFSORT truncates the string on the right. Operand DATE1 DATE1(C) DATE2 DATE2(C) DATE3 DATE3(C) DATE4 Constant C’YYYYMMDD’ C’YYYYCMMCDD’ C’YYYYMM’ C’YYYYCMM’ C’YYYYDDD’ C’YYYYCDDD’ C’YYYY-MM-DDHH. Character and hexadecimal strings are padded and truncated on the right The padding characters are • X’40’ for character string • X’00’ for hexadecimal string Decimal constants are padded and truncated on the left.GT. 3 byte PD0 values like X’01234C’ and X’01234D’ would be equal to a hexadecimal constant of X’1234’. For example. An Introduction to Mainframes . SS represents the seconds (00-59) and c can be any character except a blank.13.SS’ April 19. You can specify up to 256 pairs of hexadecimal digits. the constant is padded or truncated to the length of the compare field. Padding is done with zeros in the proper format.DFSORT – Tips and Tricks MM (for time) represents the minute (00-59).CH. INCLUDE COND=(1. Because the first digit and sign are ignored in a PD0 field.182 - . 2001.

we have an example to select only members who have the degree MCA Input AJITH AJAY ZARIN SAJAN KIRAN THOMAS PHILIP MANU JAYA CHANDRAN ARUN EKM TVM TVM TVM TVM TVM EKM TVM EKM TVM MCA MCA BTECH MCA MCA BTECH MCA MCA BTECH BTECH 15000 18000 15000 18000 15000 18000 15000 18000 15000 18000 12345678 11111111 22222222 12121212 33333333 13131313 21212121 34343434 45544554 78654321 An Introduction to Mainframes .183 - .DFSORT – Tips and Tricks Including Records in the Output Data Set – Comparison Examples Example 1 This example illustrates how to only include records in which • OR • The floating sign number in bytes 105 through 108 is less than or equal to 1000 The floating sign number in bytes 5 through 12 is greater than the floating sign number in bytes 13 to 20 Example 2 This example illustrates how to only include records in which • The first 10 bytes contain STOCKHOLM (This 9 character string was padded on the right with a blank) and the zoned decimal number in bytes 21 through 28 is greater than 50000 OR • Bytes 31 through 34 do not contain HERR Here.

A).JCLS(SRT2CTC).SRTOUT2.CATLG. if the field value is C’**ERR*’.MSGCLASS=Z.DELETE). If the field value is.WORK.C'MCA') SORT FIELDS=(1.EQ.CH.1).5.LRECL=80. SPACE=(CYL. Substring Comparison Tests Two types of substring comparison tests are offered.FORMAT=CH Output AJAY AJITH KIRAN MANU PHILIP SAJAN TVM EKM TVM TVM EKM TVM MCA MCA MCA MCA MCA MCA 18000 15000 15000 18000 15000 18000 11111111 12345678 33333333 34343434 21212121 12121212 Example 3 This example illustrates how to include records in which a zoned decimal date of the form Z’yyyymmdd’ in bytes 21-28 is greater than today’s date . for example.RIJO. C’**OK**’ or C’****OK’. the relational condition is false An Introduction to Mainframes . the relational condition is true.REGION=0M. For example you can search the value in a 6 byte field for the character constant C’OK’.NOTIFY=&SYSUID EXEC PGM=SORT DD SYSOUT=* DD SYSOUT=* DD DSN=HINODE. DCB=(RECFM=FB.RIJO. DATE1P generates a decimal number for the current date in the form +yyyymmdd. as follows: • Find a constant within a field value.WORK. UNIT=TESTDA. DISP=SHR Sort Card INCLUDE COND=(38.'RIJO JOSEPH'.BLKSIZE=800) DD DSN=HINODE.RIJO. DISP=(NEW.SRTINPUT.RLSE). DISP=SHR DD DSN=HINODE. CLASS=A.(1.DFSORT – Tips and Tricks JCL //ABCDEFGX // //STEP1 //SYSOUT //SYSPRINT //SORTIN // //SORTOUT // // // // //SYSIN // JOB A123.184 - .20.

The first data byte of a variable length record has relative position 5 (because the first 4 bytes contain the record descriptor word). If the field value is C’J69’.m1: These variables specify the character field in the input record for the substring test • p1 specifies the first byte of the character input field for the substring test. you can search the character constant C’J69.L92. All fields to be tested must start on a byte boundary and must not extend beyond byte 32752 m1 specifies the length of the field to be tested. The length can be 1 to 32752 bytes. The first data byte of a fixed length record has relative position 1. Equal to Not Equal to • Constant The constant can be a character string or a hexadecimal string An Introduction to Mainframes .185 - .DFSORT – Tips and Tricks • Find a field value within a constant.J82’ for the value in a 3 byte field. C’L92’ or C’J82’. the relational condition is true. For example. Note that the comma is used within the constant to separate the valid 3-character values. Relational Condition Format Two formats for the relational condition can be used: Substring comparison operators are as follows EQ NE Fields: p1. if the field value is C’X24’. the relational condition is false. any character that will not appear in the field value can be used as a separator in the constant. relative to the beginning of the input record.

NOTIFY=&SYSUID EXEC PGM=SORT DD SYSOUT=* DD SYSOUT=* DD DSN=HINODE.WORK.SRTOUT3. Substring comparison example This example illustrates how to include only records in which • OR • Bytes 5 through 7 contain J69.RIJO. CLASS=A.186 - . If m1 is smaller than the length of the constant.WORK. DISP=SHR DD DSN=HINODE.'RIJO JOSEPH'. the field value will be searched for the constant and the condition will be true if a match is found when the EQ comparison operator is specified or if a match is not found when the NE comparison operator is specified.MSGCLASS=Z. L92 or J82 OK is found somewhere within bytes 11 through 6010 Here is an example to include only records that contain ALP or EKM or KLM in the byte positions 21 through 23 Input AJITH AJAY ZARIN SAJAN KIRAN THOMAS PHILIP MANU JAYA CHANDRAN ARUN EKM ALP TVM KLM TVM KLM EKM TVM KLM TVM MCA MCA BTECH MCA MCA BTECH MCA MCA BTECH BTECH 15000 18000 15000 18000 15000 18000 15000 18000 15000 18000 12345678 11111111 22222222 12121212 33333333 13131313 21212121 34343434 45544554 78654321 JCL //ABCDEFGX // //STEP1 //SYSOUT //SYSPRINT //SORTIN // //SORTOUT JOB A123.SRTINPUT.REGION=0M. the constant will be searched for the field value and the condition will be true if a match is found when the EQ comparison operator is specified or if a match is not found when the NE comparison operator is specified.DFSORT – Tips and Tricks If m1 is greater than the length of the constant. An Introduction to Mainframes .RIJO.

UNIT=TESTDA. each of them offers unique advantages not found with the other.ALP.187 - .4.CATLG.RLSE).C'KLM. DISP=SHR Sort Card INCLUDE FORMAT=SS.20.COND=(21. DCB=(RECFM=FB.EQ. SPACE=(CYL. all off.FORMAT=CH Output AJAY AJITH JAYA CHANDRAN PHILIP SAJAN THOMAS ALP EKM KLM EKM KLM KLM MCA MCA BTECH MCA MCA BTECH 18000 15000 15000 15000 18000 18000 11111111 12345678 45544554 21212121 12121212 13131313 4.JCLS(SRT2CTC). it is less suited to determine if a field contains exactly one particular combination of on and off bits than method 2 (described below) Relational Condition Format Two formats for the relational condition can be used: An Introduction to Mainframes .LRECL=80.EKM') SORT FIELDS=(1.BLKSIZE=800) DD DSN=HINODE. Bit Logic Tests Two methods for bit logic testing are offered as follows • • Bit operator with hexadecimal or bit mask Bit comparison tests While any bit logic test can be specified using either of the two methods.3.(1.DFSORT – Tips and Tricks // // // // //SYSIN // DISP=(NEW.RIJO. in a mixed on-off state.1). or in selected combination of these states.A). Bit Operator Tests This method of bit logic testing allows you to test whether selected bits in a binary field are all on.DELETE). While this method allows you to test many different possible bit combinations with a single operation.

if the FORMAT=BI operand is used: An Introduction to Mainframes .188 - .DFSORT – Tips and Tricks Or.

The total number of bits in the mask must be a multiple of 8. You can specify up to 256 pairs of hexadecimal digits.DFSORT – Tips and Tricks Fields: p1. A bit mask string can only be used with a bit operator Padding and Truncation The hexadecimal or bit mask is truncated or padded on the right to the byte length of the binary field. If a mask bit is on (1). All fields to be tested must start on a byte boundary and must not extend beyond byte 32752 m1 specifies the length of the field to be tested. Hexadecimal String Format The format for coding hexadecimal string mask is The value yy represents any pair of hexadecimal digits that constitute a byte. relative to the beginning of the input record.m1: These variables specify the character field in the input record for the substring test • p1 specifies the first byte of the character input field for the substring test. Each bit must be 1 (test bit) or 0 (ignore bit). The padding character is X’00’ (all bits off and thus not tested) Examples An Introduction to Mainframes . the corresponding bit in the field is tested. The first data byte of a variable length record has relative position 5 (because the first 4 bytes contain the record descriptor word). Each bit must be 1 (test bit) or 0 (ignore bit). If a mask bit is off (0). The first data byte of a fixed length record has relative position 1.189 - . You can specify up to 256 groups of 8 bits. Bit String Format The format for coding bit string mask is The value bbbbbbbb represents 8 bits that constitutes a byte. the corresponding bit in the field is ignored. The length can be 1 to 256 bytes. • Mask A hexadecimal string or bit string that indicates the bits in the field selected for testing.

190 - . 5 and 7 on SORT – RECORD PROCESSING ORDER An Introduction to Mainframes .DFSORT – Tips and Tricks This example illustrates how to only include records in which Byte 27 contains ‘D’ and Byte 18 has bit 0 on This example illustrates how to only include records in which byte 11 has some. but not all of bits 0.

191 - .TSO/ISPF – Tips and Tricks Chapter 5 TSO/ISPF – Tips and Tricks An Introduction to Mainframes .

=IOF’.1 provides other options also.1. 5. TSO SEND/TRANSMIT To send short messages. say TSO SEND ‘message’ U(userid) LOGON. Save a sequence of commands The commands you use regularly can be saved as a function key. look at the first line of your compilation listing.TSO/ISPF – Tips and Tricks 5.2. TSO/ISPF – Tips and Tricks COBOL Compiler Version To know which version of COBOL compiler you are using.4.3. HRECALL To recall a dataset that has been migrated without freezing your screen. If the person is not logged on but you want to send a message which he/she can read when he logs on .5. To send large information. Information about your DS To know the percentage free space and other statistics of your data set. 5. type HRECALL next to the dataset name in 3.6. To do this . use TSO SEND ‘message’ U(userid). For example if you often change a JCL. you could save a PF key as ‘SAVE. 3.SUB. save it . 5.4 5.192 - . Tape Datasets You can’t Rename/Delete a tape dataset. 5.1 and select I. An Introduction to Mainframes . Only you can uncatalog it. use TSO TRANSMIT. submit it and then go to the job spool. 5. go to option 3. type KEYS on command line and make the necessary entries.

from beginning to end.ZF .9. you can use CREATE or REPLACE. you can use the system defined labels .9.8. Each directory block can hold at least 4 members. The said example is just an instance and you can use CREATE/REPLACE for a variety of needs 5. which means your PDS can no longer accommodate more members in it. Start another session. you can give CREATE . or you can label the lines according to your needs or you can use CC/MM to select the lines. All X37 abends are out of space situations.ZL and press enter.1. CREATE/REPLACE Suppose that you are editing your component in View mode and you want to save the changes. you will get the edit entry panel and you can specify the DSN.ZF and . CREATE CREATE creates a member of a PDS or a sequential dataset from the data you are editing Simplified syntax is CREATE {member} {range} Where member is the name of the new member and range is two labels that specify the group of lines. 5.TSO/ISPF – Tips and Tricks 5. In such a case.4 and type Z next to it. it will compress your PDS. If you want to use the entire data you are editing. No space in directory If you get the above error message while creating a member in a PDS. Note: CREATE adds a member to a PDS only if a member of the same name doesn’t already exist. But please note the difference between CC/MM. You have to specify a range of lines from the data you are editing. which are added to the new member. SB37 on Saving a DS Your PDS is out of space.ZL (stands for the first and last line) . You can specify the member in the command line or you can give CREATE .ZF . 5.ZL NEWCMPNM An Introduction to Mainframes .7. If you want to create a member in the same PDS in which the component you are editing resides. You need to increase the directory blocks. open this PDS in 3.193 - .

you might have opened the DS in view mode. the editor creates it.ZL (or the range that you wish).XXX. CUT/PASTE I know you are good at it.9. An Introduction to Mainframes . If the member you want to replace doesn’t exist. REPLACE The REPLACE primary command replaces a sequential data set or a member of a PDS with the data you are editing.YYY(ABC)’ Or CREATE .ZF . If you have made changes to the member in view mode.194 - . you can use REPLACE . made lot of changes and when you tried to save it. The syntax of the CUT command is CUT {line pointer range} {DEFAULT | Clipboard name} {REPLACE | APPEND} {DISPLAY} Where. It is possible in a different way. you might have got the error.9.3. you can give a command like CREATE . Saving a DS in view mode You might have come across this problem several times. The lines can be appended to the lines already saved by a previous CUT command or can replace existing lines in a clipboard.10.ZF . ZF .This will replace the original member with the changes that you made to the member in view mode.ZL ‘IPHT. and press enter.TSO/ISPF – Tips and Tricks If it is in another PDS .2. Simplified Syntax is REPLACE {member} {range} The rules for REPLACE are same as that of CREATE 5. specify the DSN in the edit entry panel 5. but still The CUT primary command saves lines to one of eleven named clipboards for later retrieval by the PASTE command. As good as saving from view mode 5.ZL <Original Member Name> .

195 - . edit … 5. The default action depends on the setting specified in the panel displayed by the EDITSET. You can define up to ten additional clipboards. From this list you can browse. A line pointer can be a label or relative line number. ISPF EDITOR COMMANDS • To search for a value say ‘0980312’ stored in COMP-3 format. clear.a . or rename the clipboards. all lines in the edit session are copied to the clipboard. You must specify both a starting and ending line pointer. If you do not specify a range of lines.g. use this method.: CUT . E. If you omit this parameter. An Introduction to Mainframes . DISPLAY is Show a list of existing clipboards. E.b Clipboard name is The name of the clipboard to use. the ISPF default clipboard (named DEFAULT) is used. Clipboard manager will pop up and will give the options to view.g. you can use this method F X ‘0980312’ • To do a case sensitive search for a given search string. edit. The size of the clipboards and number of clipboards might be limited by installation defaults.: CUT DISPLAY.11. You can select REPLACE or APPEND as the default by entering the EDITSET command on the editor command line. E.TSO/ISPF – Tips and Tricks Line pointer range is 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. Specify APPEND to add the data to the clipboard.: CUT CUT1 PASTE CUT1 CUT CUT2 PASTE CUT2 REPLACE | APPEND is Specify REPLACE to replace existing data in the clipboard.g.

Count of all ALL F ‘job’ ALL finds the first instance instances in file of sting ‘job’ in the file and gives total-no-of-instances of sting ‘job’ in the file. E. how to search for a string in the backward/ forward direction (with respect to your current cursor position)? Direction Backward Example F ‘job’ PREV finds for string ‘job’ in backward direction Forward No need to mention F ‘job’ finds for string ‘job’ in any keyword. Keyword PREV • To search for a string that is not prefix/suffix of another word. reset and then again X LL <text-1> 5. instead of giving. It’s forward direction. default direction From the beginning FIRST F ‘job’ FIRST finds the first instance of the file of sting ‘job’ in the file.e. Try the following.g.13. F ALL <text-1> frequently . To do this. • • 5. we can use the following command L ‘search string’. you can use the command FLIP. This is the Label command. Use the keyword ‘word’ at the end of the find command. That is to find for an instance of a search string that is whole word by itself.196 - . • • Go to ISPF 3. Auto complete We can have auto complete feature in ISPF like that we have while browsing the internet.and it will hide all the lines except the lines with text-1.TSO/ISPF – Tips and Tricks Just enclose the search string within quotes and have the letter C in front of the string itself. If you want to see all those hidden lines. The KEYS window will pop up. F C ‘FindMe’ will find all the ‘FindMe’ strings only if the case matches • To specify the direction of search i.4 Enter KEYS in the command line and press enter..12. FLIP We use X ALL . you can use the following method. That is F job WORD will find for the whole word job To go to a particular line number. An Introduction to Mainframes .

You can use the assigned PF key to get the next match.14.TSO/ISPF – Tips and Tricks • • • Set any key to AUTOTYPE. save and exit. NOTE: It will not retrieve GDGs and VSAM files 5. the KEYS window will popup Set any key to NRETRIEV and exit. An Introduction to Mainframes . Pressing the assigned PF key will bring up one by one the last 30 accessed datasets from the REFLIST. Now type any dataset partially and press the assigned PF key. NRETRIEV This is a way of making the system remember previously typed dataset names.197 - .4 or which ever screen you have set the KEYS option. • • • • Enter KEYS in the command line. press the assigned PF keys. Now when you are in 3. For example set F4 as AUTOTYPE.

VSAM – Tips and Tricks Chapter 6 VSAM – Tips and Tricks An Introduction to Mainframes .198 - .

1.2. 6. The term virtual relates to the fact that VSAM was introduced at approximately the same time as the initial IBM virtual storage operating systems OS/VS1 and OS/VS2. VSAM doesn’t support data stored on tape. VSAM Overview In the early 1970s. but exactly how it works and why we use it instead of other access method may seem to be a mystery. indexed and direct access together with the access methods and utilities to be used on the Mainframe OS This collection of data set organizations is called the Virtual Storage Access Method (VSAM). VSAM data sets must be cataloged in an integrated catalog facility (ICF) structure.1. VSAM Basics 6. It is GET/PUT interface used to transfer data from a Direct Access Storage Device (DASD) to an application program. VSAM was developed to replace the Indexed Sequential Access Method (ISAM).1. ISAM has major processing overheads which IBM wanted to improve. VSAM is used to organize and access data.199 - .1. catalog management and record management An Introduction to Mainframes . which is a much older technology. and maintain information about this data which is stored or referenced in a catalog. VSAM – Tips and Tricks VSAM is one of the access method used to process data.VSAM – Tips and Tricks 6. We all have used VSAM and may work with VSAM datasets daily. 6. VSAM uses direct or sequential processing of fixed and variable length records on DASD There are two major parts to VSAM: Catalog Management and Record Management … We discussed in the previous session that there are 2 Major parts to VSAM. What is VSAM? VSAM is one of several access methods that defines the technique by which data is stored and retrieved. IBM introduced a collection of three data set organizations – sequential. Records are arranged by an index key or by relative byte addressing.

1.VSAM – Tips and Tricks 6.1. 6. and one or more record definition fields (RDF) per logical record. one control interval definition field (CIDF) per CI. A CI is the unit of information that VSAM transfers between the storage device and processor. The fundamental building block of every component of VSAM is CI. which is made up of 2 types of fields. Control information. • • • Logical records stored from beginning to end Unused space. can be an ICF or a VSAM catalog. One CI can be made of one or more physical blocks of DASD.6.4. Catalog Management The catalog.5. All VSAM datasets must be defined in an ICF catalog.3. Control Interval Logical records are contained in a control interval. A CI consists of the following.1.200 - . referred to as free space for data records to be inserted into or lengthened. A physical record is device dependent and calculated by catalog at the time data is defined. which contains information about the data sets.1. Logical Record & Physical Record A logical record is a unit of information used to store data in a VSAM dataset. 6. An Introduction to Mainframes . Record Management The purpose of record management is to maintain records in a VSAM dataset for an application or a system program. Today VSAM supports five dataset organizations • • • • • Key-sequenced dataset (KSDS) Entry-sequenced dataset (ESDS) Fixed-length relative record dataset (RRDS) Variable-length relative record dataset (VRRDS) Linear dataset (LDS) The primary difference between the VSAM dataset organizations is the way in which their records are accessed and retrieved 6. DFSMS/MVS deals only with ICF catalogs.

RDF’s. More about VSAM VSAM is IBM’s latest and most advanced access method. All of the bytes in the LDS CI are data bytes. It may be noted that the CIDF. A COBOL application program processes records without knowledge of the CIDF. The Virtual Telecommunications Access Method (VTAM) uses some of the VSAM macros. it has proven to be more than just an access method. RDF’s. It makes efficient use of the virtual storage of MVS. VSAM catalogs support not only VSAM data sets. but as a result of continuing enhancements. VSAM software resides in virtual storage along with the program that needs its services for manipulation of data on a DASD An Introduction to Mainframes . VSAM is a high performance access method used in MVS.201 - .VSAM – Tips and Tricks CIDF is a 4 byte field It contains information about the length of data in CI and the amount and location of the free space RDF is a 3 byte field It describes the length of the records and how many adjacent records are of the same length The CI components and properties may vary depending on the data set organization. MVS/ESA and VSE/ESA operating systems. DB2 etc.7. VSAM is also used as an access method for database management systems such as IMS. an LDS doesn’t contain CIDF or RDFs in its CI. MVS/XA. 6.1. but also non VSAM data sets and generation data groups. For example. Paging data sets in the MVS system are also VSAM data sets. In the initial releases. or free space. hence the name ‘Virtual Storage Access Method”. it appeared to be only a replacement for the indexed sequential access method (ISAM). The system catalog of the MVS OS is a VSAM catalog (called the master catalog). and free space are transparent to the application program.

Records can be retrieved and inserted. both randomly and sequentially. IEBGENER. .2. It currently consists of one utility program called IDCAMS. you can randomly access the logical record. In a KSDS.g. records are stored in ascending collating sequence of the prime key field.202 - . including the key field. IEBCOPY. . and contains the key fields and pointers to the location of the record(s) to which that key field belongs Index component K1 Ptr Data component K1 <other Data Items > . the index component is a small. Therefore. compact entity. KSDS A key sequenced data set (KSDS) has a data set organization in which records are sequenced on a key field. and delete catalogs and data sets. It is short and can be searched quickly to find the physical location. contains the records that hold the user data. called the data component. etc) 6. the key field is small when compared to the whole record.VSAM – Tips and Tricks AMS (Access Method Services) is a service program that helps you to allocate.2. This utility program is used in a job step just like any other utility program of OS/VS (e. The second component is called the index component. A KSDS consists of two physical components on the DASD. VSAM Data Sets 6. The first one. maintain.1. Knowing the value of a key field. The index and data components of KSDS organized file are jointly called a base cluster. Free space for An Introduction to Mainframes . Base cluster Usually.

It is the responsibility of the application program to identify that record as deleted (invalid). This space is allocated at regular intervals and is left free at the time of initial loading of the data set As a result of excessive random insertions and deletions. you must either store it at the end of the data set as a new record or override an existing record of the same length that you have flagged as inactive. Records can be updated in place. the second record has an RBA equal to the length of the first record. Sequential processing can be started from the beginning or somewhere from the middle of the data set.VSAM – Tips and Tricks additional records is provided by the initial allocation of a KSDS. Keeping records in physical sequence permits more efficient sequential retrieval of records. although they are still in logical sequence when accessed through the index of the cluster. Existing records can never be deleted. If the application wants to delete a record. Remember that the key field of a KSDS must be unique and that. The first record in the VSAM data set has an RBA of zero. In the latter case. although they always remain in logical key sequence. positioning is necessary before sequential processing can be performed An Introduction to Mainframes . thus freeing space to be reused for other insertions. 6. The RBA is always expressed as a full word binary integer (4 bytes)) • Sequential Processing: VSAM automatically retrieves records in stored sequence. records can be physically deleted. Records can be updated but without length change. it must flag that record as inactive.203 - . A record can be accessed sequentially or directly by its RBA (Relative Byte Address – RBA is the physical location of the logical record contained in the data set. As far as VSAM is concerned. There could be fixed or variable length records. Also. ESDS The records in an ESDS (Entry Sequenced Data Set) are sequenced in the order in which they are entered in the data set. Such a key is called an alternate key and need not be unique. VSAM data sets do not have an overflow component. while updating a KSDS record. RBA is the offset of a logical record from the beginning of the data set. new insertions in an ESDS are always added to the end of the data set. key sequenced data sets require occasional reorganization to put the records back into physical key sequence. An ESDS is analogous to a physical sequential file. Records of a KSDS can be accessed in a key sequence other than that of the prime key field. Records in a KSDS may be of variable length.2. Unlike ISAM. To change the length of a record. The RBA of a logical record depends only on the record’s position in the sequence of records. they eventually become physically out of sequence.2. Therefore. that record is not deleted. and son on. As in a physical sequential file. its key field can’t be modified.

This is a result of CI internal fragmentation (spanned record is only for logical records that are greater than the CI size.2. the entire data set is a string of fixed length slots.204 - . The relative position of each slot is called the relative record number (RRN). An RRN is an integer that identifies the position of the slot. not the value of a particular field within the slot. An Introduction to Mainframes . Each slot occupies a fixed position and is identified by its position relative to the first slot of the data set. you must supply the RBA for the record as a search argument. Each slot of an RRDS may or may not contain a record. you can build an alternate index to keep track of these RBAs. RRDS In an RRDS (Relative Record Data Set). The figure below shows the format of an ESDS.3. we shall learn about this later) 6. Although an ESDS doesn’t contain an index component. To retrieve records directly. Empty spaces in the CI are referred to as unused space because they can never be used.VSAM – Tips and Tricks • Direct Processing: When a record is added or loaded. VSAM indicates its RBA.

Records in RRDS are always fixed in length. If we can develop an algorithm that establishes a relationship between a record and an RRN slot. Records in an RRDS may be inserted. Each CI can only be 4KB long. updated and deleted both sequentially and randomly.4. When a record is deleted from a particular slot. All the LDS records are considered to be a long string of characters. 6. LDS data organization is primarily used by DB2. Alternate indexes are not supported on RRDS.2. RRDS are maintenance free and do not require any reorganization. This makes it device independent. RRDS is the fastest access method.VSAM – Tips and Tricks RRN 1 Record 1 Empty Record 5 RRN 2 Record 2 Empty Empty Record 3 Record 4 Empty RRN 9 An RRDS has only a data component. RRDS is not dependent on the physical device on which it is stored.205 - . LDS is an ESDS without any VSAM required control fields. LDS An LDS is a data set which doesn’t contain control information (CIDF and RDF). Each record of LDS is contained in the CI. the slot remains in the same physical location although a record doesn’t exist in that slot anymore. retrieved. An Introduction to Mainframes .

The index component is further sub divided into two parts called the index set and the sequence set. There is always only one sequence set record for each data CA.VSAM – Tips and Tricks 6. Here we are respresenting a record by its key value. All the horizontal boxes represent control intervals of the index component and the vertical boxes represent control intervals within their respective control areas of the data component. To understand the concepts better. If the key is not less than or equal to the value in the index set. VSAM begins its search at the highest level of the index component. The sequence set is always at the lowermost level of the index and points to the control intevals of the data component. it makes a comparison with the next key. The different entries in a sequence set record point to the hightest key record in the data component control intervals. The index set consist of one to theree levels. let’s assume that it consists of only fixed length records. In the An Introduction to Mainframes . CA size and free space allocation. Accessing & Inserting VSAM Data I give below the composition of a typical key sequenced data set 25 p 95 p Index Set Index Component 7p 25 p 35 p 60 p 95 Sequence Set 1 2 4 Free space 10 15 18 22 25 Free 26 28 30 Free space 40 43 52 55 60 63 95 Data Component Free Space CI 7 35 CI1 CI2 CI3 CI4 CI5 CI6 CI7 CI8 CI9 Control Area 1 Control Area 2 Control Area 3 For simplicity. It starts the comparison from the left and compares the key (52) with the leftmost key value in the index set (25). These are different hierarchical levels of the index component. Further up in the index hierarchy. The number of index set levels depends on the size of the file and other factors such as CI size. each pointing to the next lower level until you reach the sequence set.3. let’s retrieve a record with key 52. different entries in the index set record point to the hightest key record in the sequence set control interval.206 - .

the record is moved to your program. the sequence set field that fulfills the search is 60. VSAM will determine that there is eneough free space to insert another record. I give below the composition of a typical key sequenced data set 25 p 95 p Index Set Index Component 7p 25 p 35 p 60 p 95 Sequence Set 1 2 4 Free space 10 15 18 22 25 Free 26 28 30 Free space 40 43 52 55 60 63 95 Data Component Free Space CI 7 35 CI1 CI2 CI3 CI4 CI5 CI6 CI7 CI8 CI9 Control Area 1 Control Area 2 Control Area 3 The free space given in CI may be used for the addition of records.VSAM – Tips and Tricks example.207 - . our key (52) is less than 95. Traversing the hierarchical chain. It also determines that there is not enough free space in that CI in which to place the record. so VSAM follows the pointer for the key 95 and reaches the appropriate sequence set record. The free CI will be used for CI split and free CA will be used if there is a CA split. Once it locates the recod ithin the CI. Record 5 logically fits between records 4 and 7. Suppose we want to insert a record with the key value 5. VSAM follows the pointer dwonward to find the control interval of the data component where the record with the key 52 can be found. It then An Introduction to Mainframes . It will then update the RDF and CIDF information to indicate theat there is no free space left in that CI Suppose we want to add a record whose key is 20 to the above layout. so VSAM will push record 7 down to free space and place record 5 in the location perviously occupied by record 7. VSAM makes the same kind o comparison within the sequence set until it finds the field in the sequence set that is greater than or equal to the key we are looking for. VSAM determines that this record belongs to CI2 between records 18 and 22. So VSAM locates a free CI (CI3) within that control area (we will see later what will happen if there is no free CI). as we did for accessing. In this case. VSAM finds the record with key value 5 logically belongs to the first CI (CI1) of first CA.

This process is called a CI Split.208 - . so that each key pointer pair points to the highest key element at the next lower level in the hierarchy. If you did not provide for secondary allocation when you defined your VSAM data set. VSAM will inform your program of the program of the problem. VSAM tries to find a free CI within CA2. It should logically be inserted between record keys 43 and 52 in CI5. Since there is no free CI in that CA as well. a free CA is available. In our case. and acquire a CA from the secondary allocation. our lay out will look like. The process is called CA Split After inserting 45. VSAM peforms a CA split. After records 5 & 20 are added. VSAM acquires it and moves approximately half of the records from the problem CA to the acquired CA. spreading them evenly over the new CI’s . However. our KSDS layout will look like the one given below.VSAM – Tips and Tricks moves approximately half of the records from CI2 to the newly acquired free CI. First it acquires a free CA within the data set. If there is no free CA available. if possible. we want to add a record with the key 45. VSAM also updates the information in sequence set 1 to reflect the new key pointer pairs. VSAM makes a secondary space allocation of the data set. ther is no free space in that CI. It also updates information at the different levels of the index component. An Introduction to Mainframes . or if a secondary allocaiton can’t be made because there is insufficient space. 25 p 95 p Index Set Index Component 7p 18 p 25 p 35 p 60 p 95 Sequence Set 1 2 4 5 7 10 15 Free space 20 22 Free space 26 28 30 Free space 40 43 52 55 60 63 95 Data Component Free Space 18 25 35 CI1 CI2 CI3 CI4 CI5 CI6 CI7 CI8 CI9 Control Area 1 Control Area 2 Control Area 3 Let’s see another insertion.

Where SSN is the key and an index has been made out of it.4. Once the record has been read into the I/O buffer.209 - . What happens if it is necessary to retrieve a record by Employee number (or by Employee name) rather than SSN Suppose we have a second KSDS and each record in this data set has only two useful fields. Alternate Index Alternate Indexes (AIX) lets us view the existing data layout in a different angle than the one provided by the unique key (unique index) Confused? We know that only if the record key (or RBA) is known can we randomly retrieve the data record. Employee name (which is not unique) and few other details. which is the other field in that record An Introduction to Mainframes . you will have access to the SSN. we will access the record in this data set whose key is Employee number. We will have as many records in our second data set as we have in our base cluster. because.VSAM – Tips and Tricks 25 p 43 p 95 p Index Set Index Component 7p 18 p 25 p 30 p 43 p 55 p 95 p Sequence Set 1 2 4 5 7 10 15 Free space 20 22 Free space 26 28 Free space 35 40 Free space 45 52 Free space 60 63 Free space 18 25 30 43 55 95 Data Component Free CI Free CI CI1 CI2 CI3 CI4 CI5 CI6 CI7 CI8 CI9 Control Area 1 Control Area 2 Control Area 3 6. One of the field is Employee number and the other one is SSN. Employee number (which is also a unique field). Let us also suppose that the record key in our second data set is Employee number. For example suppose we have a data layout with SSN. for each record in the base cluster there is a record in the second KSDS To access the record in the base cluster using Employee Number is a two step process The second data set is a KSDS.

VSAM – Tips and Tricks Read the employee record in the base cluster with the SSN The second data set in the above example is called an alternate index cluster.210 - . and the Employee number is called the alternate key Pictorial Representation Alternate Index Control information used by Employee Number VSAM Base Cluster SSN Employee Number Other Fields SSN Unique Alternate Key/Nonunique Alternate Key on KSDS Picture says it all. ! Base Cluster SSN Employee Number 111 222 333 444 555 Primary Key Employee Name 50 20 30 40 10 Alternate Key1 AAA BBB CCC AAA DDD Alternate Key2 Unique Alternate Index Cluster – based on Alternate Key1 (which is unique) VSAM control information Employee Number 10 20 30 40 50 SSN 555 222 333 444 111 Prime key pointers to Base Key of alternate key cluster An Introduction to Mainframes .

It will appear to your program as if the base cluster is sequnced on many different alternate key fields. The way to avoid all this extra coding is to use AMS to define a PATH between the base cluster and the associated AIX cluster. Then. finding the record in the alternate index cluster throught the alternate key. An Introduction to Mainframes . accessing the record in the base cluster once you know the prime key or RBA. as we have seen. You can have as many different paths as you have alternate index clusters.211 - .VSAM – Tips and Tricks Nonunique Alternate Index Cluster – based on Alternate Key2 (which is Nonunique) VSAM control information Employee Number AAA BBB CCC DDD Key of alternate key cluster SSN 111 222 333 555 444 Prime key pointers to Base 6. PATH and AIX We have seen that accessing a record in the base cluster of a KSDS or an ESDS can be done in one of the two ways • • The record can be accessed directly from the base cluster if you know the prime key value in a KSDS.5. second. It also requires two I/O areas defined in the DATA DIVISION of a COBOL program. two distinct elements are involved. one for accessing the alterante index cluster record and the other for accessing base cluster records. A PATH is an entry in the VSAM catalog that establishes a logical link between an AIX cluster and a base cluster. or with the RBA in an ESDS. You do not have to do any coding in your program to search for the corresponindg prime key – VSAM does all the processing for you. It doesn’t contain any records. it automatically finds the corresponding prime key in the alternate index. or The record can be accessed through an alternate index if you know the alternate key value In the second case. thus getting the corresponding prime key or RBA. if you want to read a record in the base cluster by using an alternate key value. PATH has a name like any other dataset name Opening a data set with the path name opens both the alternate index an its associated base cluster. it just establishes a relationship. It is clear that accessing a record through an alternate key involves more coding on the part of the programmer. first.

AIX1.KSDS.212 - .KSDS.CLUSTER and its base cluster EMPLOYEE.AIX1.KSDS.CLUSTER An Introduction to Mainframes .PATH1) PATHENTRY(EMPLOYEE.CLUSTER) UPDATE) /* // - This defines a PATH between EMPLOYEE.KSDS.VSAM – Tips and Tricks PATH 2 AIX 2 PATH 3 PATH 1 Base Cluster AIX 1 AIX 3 This is how you define a PATH //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=A //SYSIN DD * DEFINE PATH (NAME(EMPLOYEE.

213 - .General – Tips and Tricks Chapter 7 General – Tips and Tricks An Introduction to Mainframes .

Why do I get this error? For variable record format files you should add 4 bytes to record length in DCB An Introduction to Mainframes . S322 General – Tips and Tricks 10 Common Abends Timed out. Or you can give REGION=0M. 7. Increase the value you have specified in REGION parameter of JOB statement or in EXEC step. For example. and FD section JCL error File attributes don’t match. table definition.214 - . RECLEN is same as that specified in FD section.General – Tips and Tricks 7. try changing job class S806 Load module not found. in this case. Check library specified in JOBLIB S913 Insufficient authority . S0C4 Storage related problem. the system will allocate the maximum size available S522 Job cancelled by either user or operator.1. I have given RECFM=VB.Check if you have required access to dataset S878 Region size is not enough. Check your linkage section.

This will increase your Sysout limit to ‘150’ thousand lines. Comparing 2 files of different layouts If you want to compare 2 files of different layouts you can use this form of 3.RIJO.2 Chars) of the old file. // DISP=SHR //OLDDD DD DSN=ISPS. // ''.'SUPERC'). S013 A file open error S722 The Sysout or spool is full.2.General – Tips and Tricks S0C7 Invalid character in COMP/COMP-3 numeric field – check all COMP/COM-3 numeric fields and arithmetic operations. Increase job’s Sysout limit by specifying ‘LINES=(150. You program is writing too many things to Sysout.WARNING)’ option in job statement and then retry.RJOSEPH. 7.RJOSEPH. // DISP=SHR An Introduction to Mainframes . // CLASS=A.WORK(COMP2).NOTIFY=&SYSUID //SUPERC EXEC PGM=ISRSUPC.WORDCMP.13 Give new and old DSNs Point to the Options in the menu bar and press enter Select Edit Statements (1) option Give the options like this CMPCOLMN 2978:2979 CMPCOLMO 1565:1566 The resulting JCL will look like this //RQ123JOB JOB (00124.MSGCLASS=Z. then here is the option that you may use.WORK(COMP1). Select 3.215 - . // '') //NEWDD DD DSN=ISPS.REGION=0M.RIJO.RJOSEPH.13 Suppose you want to compare the 2978:2979 (start_column:stop_column) of the new file with the 1565:1566 (start_column:stop_column . // PARM=(CHNGL.

the last block may not be full.General – Tips and Tricks //OUTDD //SYSIN CMPCOLMN CMPCOLMO /* DD SYSOUT= * DD * 2978:2979 1565:1566 Note: While comparing using CMPCOLM/ CMPCOLMN / CMPCOLMO.3. Counting the number of records 7.1.8 option (file aid) Select V1. Note: To get the block count and all the details regarding the tape data set. DASD Data Set Suppose the allocation for a DASD data set is (TRK(10. if we have only 10 blocks. Give DSN in the option ‘Inquire/update TMC record by Data Set Name’ without quotes/Press enter. we can find the approximate number of records in the tape dataset by the following calculation Number of records = (Block size * Block count) / (Record size). you can give either line compare or word compare You can either submit the Comparison operation as online or batch. you can use the V1.3. 7. the block size is 1000 bytes then. you can’t give file compare.216 - . then Number of records = (1000* 10)/100 = 100 This is an approximate value because. This would work for data sets that are not archived. We have the following information An Introduction to Mainframes . 7. Tape Data Set Suppose that the LRECL is 100 bytes.8/Select option 1 and give password as user. In the above case. if we know the block count.2)).3.2.

specify the databases (one or more) a program can access.4. which is processed.General – Tips and Tricks 1 Cylinder 1 Track = 15 Tracks = 56. In this step. and the processing the program can do. the maximum number of records that can be stored is The total space allocation in the above case is 10+15*2 = 40 Tracks. and generating a PSB is called PSBGEN. An installation must create one DBD for each DL/I database Although each database has a single physical structure that’s defined by a DBD.664 bytes Suppose that the LRECL is 80 bytes. These views. Processing Options in IMS DB 7. one defines a Data Base Description (DBD). also called application data structures. An Introduction to Mainframes .1.664 bytes In the above case. This process is called control block generation. storing the resulting load module in a PDS. this takes the form of a Data Base Description (DBD) step. and the resulting information is maintained in an IMS library A DBD describes the complete structure of a database. then assembles and links them. That is 40 * 56.4. the data elements the program can “see” in those databases.217 - . generating a DBD is usually called a DBDGEN. Then the maximum number of records that can be stored is = (40 * 56664)/80 = 28332 7. the application programs that process it can have different views of it. DEFINING THE IMS DATABASE In the IMS. This information is specified in a PSB (Program Specification Block) The DBA codes the assembler language statements necessary to define a DBD or PSB.

START = 6. BYTES = 5. TYPE = C An Introduction to Mainframes .General – Tips and Tricks Let us consider an Inventory Database The structure of the database is VENDOR ITEM LOCATION DBD DBD * SEGM FIELD FIELD FIELD * SEGM FIELD FIELD FIELD * SEGM FIELD FIELD FIELD FIELD FIELD * NAME = INDBD NAME = INVENSEG. PARENT=INVENSEG. BYTES = 30. TYPE = P NAME = INLOCROP. BYTES = 4. PARENT=0. TYPE = P NAME = INLOCDAT. BYTES = 3. BYTES = 44 NAME = (INLOCLOC. TYPE = C NAME = INLOCONH. START = 4. START = 1. BYTES = 3. START = 8. TYPE = C NAME = INITMDES. TYPE = C NAME = INVENNAM. BYTES = 4. PARENT=INITMSEG. START = 12. SEQ). TYPE = C NAME = INVENADR. TYPE = P NAME = INLOCSEG. TYPE = C NAME = INITMPRC. START = 16. BYTES = 6. TYPE = P NAME = INLOCONO. BYTES = 4.218 - . BYTES = 44 NAME = (INITMNUM. BYTES = 35. TYPE = C NAME = INITMSEG. START = 4. SEQ). START = 1. SEQ). BYTES = 63 NAME = (INVENCOD. BYTES = 4. BYTES = 30. START = 41. START = 1. START = 34.

2. PROCOPT = LS NAME = INVENSEG NAME = INITMSEG. PARENT = INITMSEG. the database administrator (DBA) chooses the type of database to use for the IMS-DL/I databases. SENSEG PROCOPT overrides the PCB PROCOPT 7. The following is a list of database types that the DBA can use to define an IMS-DL/I database An Introduction to Mainframes .General – Tips and Tricks PSB The first macro in the PSBGEN job stream is PCB (Program Communication Block). A GN call with no SSAs can access only data sensitive segments. KEYLEN = 11 NAME = INVENSEG. 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. PARENT = INVENSEG. If there is a difference in the processing options specified on the PCB and SENSEG statements and the options are compatible. PARENT = INVENSEG NAME = INLOCSEG. PROCOPT = G This means that the user may not access the data within this segment but may use it only for traversal of the hierarchy. DBDNAME = INDBD.4. the segment is not moved to the user’s I/O area.219 - . If a key sensitive segment is designated for retrieval in an SSA. PROCOPT = K NAME = INLOCSEG. PROCOPT = K NAME = INITMSEG. A PROCOPT of K indicates that key sensitivity only. The key is placed at the appropriate offset in the key feedback area of the PCB. They indicate what processing the program is allowed to perform on the database LS indicate that the program can perform only load operations The DBA can code the PROCOPT parameter on the SENSEG macro to control access to the database more selectively than is possible at the database level PCB SENSEG SENSEG SENSEG TYPE = DB. KEYLEN = 11. DBDNAME = INDBD. A PSBGEN job contains one PCB macro for each database the application program can access A sample PSB for the above DBD is given below PCB SENSEG SENSEG SENSEG TYPE = DB. The PCB describes one database. IMS DL/I DATA BASE TYPES During installation. PARENT = INITMSEG The KEYLEN parameter specifies the length of the longest concatenated key the program can process in the database PROCOPT specifies the program’s processing options.

fields. A direct-access method allows DL/I to locate s any database record. Any records to be added are inserted at the end of the database. segments are s stored in a hierarchical sequence. DL/I retrieves data in the order that the data are physically stored in the database. HIDAM provides direct access to data through s an index. one segment after another. or hierarchical structure. Hierarchical Indexed Direct Access Method (HIDAM) It is one of DL/I' two direct-access methods. HDAM provides direct access to data through a randomizing routine. which can be accessed to a field level. Only two types of calls are valid with SHSAM databases: Get calls to read a database and Insert calls to load a database. GSAM does not allow you to update or delete records in the database. Main Storage Data Base (MSDB) It is a root-segment database. but you cannot update any of the data. An Introduction to Mainframes . You can access data in HSAM databases. by using a randomizing routine or an index. Sequentially accessing an HDAM database. Simple Hierarchical Sequential Access Method (SHSAM) It is an HSAM database that contains only one segment type. Hierarchical Direct Access Method (HDAM) It is one of DL/I' two direct-access methods. regardless of the record sequence in the database.General – Tips and Tricks Data Entry Data Base (DEDB) It is a direct-access database that consists of one or more areas.220 - . In a sequential-access database. Generalized Sequential Access Method (GSAM) It allows IMS/ESA batch application programs to access a sequential OS/390 data set record that is defined as a database record. a root segment. This database record is handled as one unit. Hierarchical Sequential Access Method (HSAM) It is one of DL/I' sequential-access methods. residing in main storage. The database is accessed using VSAM improved control interval processing (ICIP). HSAM provides sequential access to root segments and dependent segments. with no segments. but it has an index that enables you to directly access records in the database. with each area containing both root segments and dependent segments. You must reload a database in order to update it. Hierarchical Indexed Sequential Access Method (HISAM) You can processes data sequentially.

D Delete Function. IMS doesn’t check the ownership of the segments returned. 7. an invalid pointer to the data might exist.3. A GG status code An Introduction to Mainframes . If an invalid pointer is detected. Read only application programs can reference data being updated by another application program. the read only application program abends.221 - . If the updating program abends and backs out. a root segment. PROCOPT It is the parameter keyword for the processing options on sensitive segments declared in the PCB that you can use in an associated application program. Includes G. A All. Therefore. the read without integrity program will have a segment that doesn’t exist in the database and never did. G Get Function I Insert Function R Replace Function.4. N Reduces the number of abends that read only application programs are subject to. you avoid this. the read without integrity program might get a segment that has been updated by another program. When this happens. Includes G. By specifying N.General – Tips and Tricks Simple Hierarchical Indexed Sequential Access Method (SHISAM) It is a HISAM database with only one segment type. PROCOPT = A is the default setting P Required if command code D is to be used O If the O option is used for a PCB. includes the above four functions.

It must be used with other Fast Path Processing options A maximum of four PROCOPT options can be specified. only the processing options G and R are valid An Introduction to Mainframes . Because you must specify LS for HIDAM databases. This load option is required for HIDAM. HDAM). The program must determine whether to terminate processing. If the retry fails. 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. or access the data using a different path. 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.222 - . LS Segments loaded in ascending sequence only (HIDAM. If you specify GS for HSAM databases.General – Tips and Tricks is returned to the program instead. continue processing by reading a different segment. a GG status code is returned to the application program. E Enables exclusive use of the database or segment by online programs L Load function for database loading (except HIDAM) GS Get Segments in ascending sequence only (HSAM only). except that T causes DL/I to automatically retry the operation. it defaults to PROCOPT = A. including H It can only be specified for BMP s Only one PROCOPT = H PCB per database is allowed If you don’t specify the PROCOPT operand. The replace and delete functions also imply the get function * In a non-terminal related or fixed terminal related MSDB. The restrictions for using PROCOPT = H are It can be used for DEDBs only It is allowed on the PCB level and not on the segment level. T T is the same as the N operand.

A. the processing options G. O and H are valid An Introduction to Mainframes . the processing options G.General – Tips and Tricks In a dynamic terminal-related MSDB. I. R and D are valid In a DEDB. A or any combination of G. R. N. D. I. R. P.223 - . I. D. T.

224 - .ISPF Editor Commands Chapter 8 ISPF Editor Commands An Introduction to Mainframes .

2.C'AOS'. 37.3.C'OEC'.C'EDR'.EQ.3. 37.1. OR.ISPF Editor Commands 8. 37.OR. 37. 37.characters shifted past the current BOUNDS (we will see this later) are deleted 8.C'CVR'.CH.OR.4.CH.3. ((and )) can be used to move a block of lines To understand the difference. An Introduction to Mainframes .3.3.characters shifted past the current BOUNDS (we will see this later) are deleted Note: in all the above 4 cases.3.3. <<. This is not the complete list.EQ.CH.OR.EQ.Data Shift Left Moves the body of a program statement to the left without shifting the label or comments (from the first position to the position that contains more than one blank is treated as a block and only that block is moved. This is aimed at showing you few of the ISPF commands which are useful for your day to day activities. < .Column Shift Left Moves characters on a line to the left without altering their relative spacing.225 - . ISPF Editor Commands Though we are using ISPF editor everyday.CH. The portion beyond that blank area is not moved) 8. 37. OR.3.EQ.CH.C'MJC'. > .EQ. I ignored the most frequently used commands 8. OR. most of us don’t know many of the commands.EQ.EQ. OR. see the original position of the following 000028 000029 000030 000031 000032 000033 000034 37.Data Shift Right Moves the body of a program statement to the right without shifting the label or comments (from the first position to the position that contains more than one blank is treated as a block and only that block is moved. The portion beyond that blank area is not moved) 8.CH. ( .Column Shift Right Moves characters on a line to the right without altering their relative spacing. >>.C'BNK'.C'GC '.CH. ) .

C'AOS'.EQ.C'OEC'.EQ. AUTOSAVE ON OFF AUTOSAVE PROMPT NO PROMPT ON OFF PROMPT : When you enter END.3. OR.EQ.C'MJC'.CH. 37.CH.EQ.CH.CH. 37.3.EQ.CH.C'CVR'.6. When you use the AUTOSAVE PROMPT by itself it implies the OFF command : You are not notified and the data is not saved when you use an END command OFF NOPROMPT 8.CH. 37. BOUNDS The BOUNDS line command (line command is the one that is issued on the line itself as shown below) displays boundary definition line An Introduction to Mainframes . 37. OR.CH.OR.C'BNK'. 37.3. OR. 37.EQ.C'GC '. 37. OR.3.OR.C'BNK'. 37. OR.3. OR. 37. See.OR.3.3. OR.C'MJC'.CH. OR.3. 37. any changed data is saved : You are notified that changes have been made and that either the SAVE command or the CANCEL command must be used.OR.3.C'EDR'.CH.3.EQ.EQ.EQ.3.C'AOS'.C'GC '.EQ.ISPF Editor Commands I am applying the shift operators as shown below 0000(( 0000(( 0000<< 0000<< 000032 000033 000034 37.CH.3.EQ.C'CVR'.EQ.CH.CH.EQ.CH. After pressing enter 000028 000029 000030 000031 000032 000033 000034 37. the << command treated the sequence of characters till the position that contained more than one blank as a block and it ignored the area after that whereas the (( command moved the line to the left without altering the relative spacing 8.EQ. 37.3.C'OEC'.C'EDR'. 37.CH.5.OR.OR.226 - .3.

DISP=SHR The BOUNDS primary command (primary command is the one that is issued on the command line) sets the left and right boundaries and saves them in the edit profile BOUNDS left-column right-column EDIT CY$$. To exit from the browse session. enter the END command.LOADLIB.7.REGION=0M.T30831. MSGCLASS=X.'JOSEPH'.Q1.TEST.DSNLOAD.01 Command ===> BOUNDS 1 72 ****** ***************************** Top of Data ********* 000001 //T30831X JOB (624.JCLLIB(ARMSMTCH) .DISP=SHR You can’t specify the same column for both the boundaries.QSTART.DISP=SHR DSNAME=PRODLIB. An * can be used to represent the current value of the boundary If both the primary command and line command are used in the same interaction. 000002 // MSGCLASS=X.REGION=0M.01. the line command overrides the primary command BOUNDS 10 * This command will set the left boundary to 10 and leave the right boundary as it is You can use the BOUNDS command to limit editing (search/change/shifting) to a specified boundary in the editing area 8.TEST.ISPF Editor Commands 000001 000002 000003 =BNDS> 000004 000005 000006 000007 000008 //T30831X // //* < > //* //JOBLIB // // // JOB (624.DISP=SHR DSNAME=CY10.NOTIFY=&SYSUID DD DD DD DD DSNAME=TS06.BATCH. The current session resumes An Introduction to Mainframes .LOADLIB.DB2.227 - .'JOSEPH'. BROWSE This primary command allows you to browse a sequential dataset or partitioned dataset member during your current edit session.0001).0001).DISP=SHR DSNAME=CGE2.NOTIFY=&SYSUID 000003 //* 000004 //* 000005 //JOBLIB DD DSNAME=TS06.CLASS=Y.LOADLIB.QSTART.CLASS=Y.

Lines that are exists only in the file being edited are marked and the lines that exists only in the file being compared are inserted as information lines in the file being edited COMP command together with MD command can be used for retrofitting purpose I will explain this Suppose for example.228 - . EXIT. 2000-PROCESS-EXIT. And this is the code at time t1 000223 000224 000225 000226 000227 000228 000229 000230 000231 000232 000233 000234 000235 000236 000237 000238 000239 000240 000241 000242 000243 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. at time t1.9. I had taken code A from production and my intention is to make changes to 2000-PROCESS paragraph. An Introduction to Mainframes . COMPARE The COMPARE or COMP command compares the file you are editing with an external sequential data set or a member of a PDS. I give here only one specific case CHANGE String-1 String-2 X NX We use X ALL to hide the complete display and use F ALL String-3 to display only those lines which contains String-3.8. CHANGE We all use Change very frequently.ISPF Editor Commands 8. PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT . The above syntax is applicable in that scenario X NX : Scans only lines that are excluded from the display : Scans only lines that are not excluded from the display 8.

EXIT. after time t1 and moved back to production before time t2 and the production code now look like this. A new Para 2150-CHECK-PROCESSING has been added 000223 000224 000225 000226 000227 000228 000229 000230 000231 000232 000233 000234 000235 000236 000237 000238 000239 000240 000241 000242 000243 000244 000245 000246 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. 2000-PROCESS-EXIT.ISPF Editor Commands I made changes to 2000-PROCESS paragraph. I added a new Para. somebody else changed the code i. EXIT. An Introduction to Mainframes . Say.e. And this is the code at time t2. PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2150-CHECK-PROCESSING THRU 2150-CHECK-PROCESSING-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT .229 - . 2000-PROCESS-EXIT. 2250-PRINT-REPORT 000223 000224 000225 000226 000227 000228 000229 000230 000231 000232 000233 000234 000235 000236 000237 000238 000239 000240 000241 000242 000243 000244 000245 000246 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. After I took the code from production.. PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2250-PRINT-REPORT THRU 2250-PRINT-REPORT-EXIT PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT .

we can use MD command that will insert those lines into our code and MDD can be used to insert a block of command 000223 000224 000225 000226 000227 000228 000229 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. Let’s see how we can do it with COMP instruction Open our version of the code.source. the lines that are labeled (lines starting with . in the command line issue COMP Production. that means those are our changes and the lines coming with == display are unique to production that means those lines are in production and are not in our code.230 - .source. To make those code into our line. 2000-PROCESS-EXIT.OAAAC 000240 000241 000242 000243 000244 000245 000246 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. An Introduction to Mainframes . EXIT. I issued the first version of the command and it showed the following 000223 000224 000225 000226 000227 000228 000229 000230 000231 000232 000233 ====== ====== ====== 000234 000235 000236 . ).OAAAB .code-member Or COMP Production.ISPF Editor Commands Before I move my code back to production. I have to make sure that this change has been incorporated and this process is known as retrofitting. See. here in blue color are unique to our code.OAAAA .code-member X The first one will list the complete code and the second one will list only those area that have changes with the production. PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2150-CHECK-PROCESSING THRU 2150-CHECK-PROCESSING-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2250-PRINT-REPORT THRU 2250-PRINT-REPORT-EXIT PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT .

ISPF Editor Commands 000230 000231 000232 000233 =MDD== ====== =MDD== 000234 000235 000236 . It appears with labeled line because those lines are present only in your code.OAAAC 000240 000241 000242 000243 000244 000245 000246 PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2150-CHECK-PROCESSING THRU 2150-CHECK-PROCESSING-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2250-PRINT-REPORT THRU 2250-PRINT-REPORT-EXIT PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT . After pressing enter.OAAAC 000243 000244 000245 000246 000247 000248 000249 /*************************************************************** ** ** * THIS PARAGRAPH CONTROLS THE PROCESSING FLOW OF THE PROGRAM * ** ** **************************************************************** 2000-PROCESS. 2000-PROCESS-EXIT. 2000-PROCESS-EXIT.OAAAB . You can delete those lines from your code also. PERFORM 2100-OPEN-EBPP-TERM-CSR THRU 2100-OPEN-EBPP-TERM-CSR-EXIT PERFORM 2150-CHECK-PROCESSING THRU 2150-CHECK-PROCESSING-EXIT PERFORM 2200-PROCESS-EBPP-ROWS THRU 2200-PROCESS-EBPP-ROWS-EXIT UNTIL END-OF-EBPP-TERM-CSR PERFORM 2250-PRINT-REPORT THRU 2250-PRINT-REPORT-EXIT PERFORM 2300-CLOSE-EBPP-TERM-CSR THRU 2300-CLOSE-EBPP-TERM-CSR-EXIT .OAAAA .OAAAA . EXIT. the member will look like this 000223 000224 000225 000226 000227 000228 000229 000230 000231 000232 000233 000234 000235 000236 000237 000238 000239 . Suppose you are getting few labeled lines and if you are sure those lines were not inserted by you… that means those lines were deleted from production.OAAAB . Sounds cool? You have to make sure you are using an MDD on the new paragraphs that are written.231 - . EXIT. An Introduction to Mainframes .

and press enter. An Introduction to Mainframes .ZL and press enter. you will get the edit entry panel and you can specify the DSN. The said example is just an instance and you can use CREATE/REPLACE for a variety of needs 8.YYY(ABC)’ Or CREATE .232 - . If the member you want to replace doesn’t exist. In such a case.ZL NEWCMPNM If it is in another PDS . you can give a command like CREATE . If you want to create a member in the same PDS in which the component you are editing resides.ZL (or the range that you wish). the editor creates it. which are added to the new member. But please note the difference between CC/MM. from beginning to end.1.ISPF Editor Commands 8. You can specify the member in the command line or you can give CREATE . specify the DSN in the edit entry panel 8. you can use the system defined labels . CREATE/REPLACE Suppose that you are editing your component in View mode and you want to save the changes.ZF .10.ZF and . REPLACE The REPLACE primary command replaces a sequential data set or a member of a PDS with the data you are editing.XXX.ZL ‘IPHT.ZF . You have to specify a range of lines from the data you are editing. CREATE CREATE creates a member of a PDS or a sequential dataset from the data you are editing Simplified syntax is CREATE {member} {range} Where member is the name of the new member and range is two labels that specify the group of lines.10. If you want to use the entire data you are editing. you can use CREATE or REPLACE.10.ZF . or you can label the lines according to your needs or you can use CC/MM to select the lines.ZL (stands for the first and last line) . you can give CREATE . Note: CREATE adds a member to a PDS only if a member of the same name doesn’t already exist.2.ZF .

you can use REPLACE . all lines in the edit session are copied to the clipboard. The syntax of the CUT command is CUT {line pointer range} {DEFAULT | Clipboard name} {REPLACE | APPEND} {DISPLAY} Where. If you have made changes to the member in view mode. made lot of changes and when you tried to save it. You must specify both a starting and ending line pointer. As good as saving from view mode 8.g. If you omit this parameter. A line pointer can be a label or relative line number. Saving a DS in view mode You might have come across this problem several times. You can define up to ten additional clipboards.ISPF Editor Commands Simplified Syntax is REPLACE {member} {range} The rules for REPLACE are same as that of CREATE 8.a .ZL <Original Member Name> . It is possible in a different way. you might have opened the DS in view mode. E. The size of the clipboards and number of clipboards might be limited by installation defaults.3.g.: CUT CUT1 PASTE CUT1 An Introduction to Mainframes . Line pointer range is 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. the ISPF default clipboard (named DEFAULT) is used.11.10. CUT/PASTE The CUT primary command saves lines to one of eleven named clipboards for later retrieval by the PASTE command.b Clipboard name is The name of the clipboard to use.233 - .This will replace the original member with the changes that you made to the member in view mode. E.: CUT . The lines can be appended to the lines already saved by a previous CUT command or can replace existing lines in a clipboard. you might have got the error. If you do not specify a range of lines. ZF .

E. or rename the clipboards. From this list you can browse. clear. DISPLAY is Show a list of existing clipboards. Clipboard manager will pop up and will give the options to view. edit. Specify APPEND to add the data to the clipboard. DEFINE DEFINE name {ALIAS name-2} {NOP} {RESET} {DISABLED} This particular form of DEFINE can be used to assign an ALIAS to a macro or a built in function Open a member in EDIT mode Issue the following commands DEFINE A ALIAS SAVE Now you can use A instead of SAVE DEFINE A DISABLED Now if you issue A instead of SAVE.ISPF Editor Commands CUT CUT2 PASTE CUT2 REPLACE | APPEND is Specify REPLACE to replace existing data in the clipboard.234 - .g. you will get the error ‘DISABLED COMMAND’ DEFINE A NOP This let you to make A to have no effect An Introduction to Mainframes . edit … 8. The default action depends on the setting specified in the panel displayed by the EDITSET.12.: CUT DISPLAY. You can select REPLACE or APPEND as the default by entering the EDITSET command on the editor command line.

. EDIT If you use EDIT............. EDITSET or EDSET Causes the editor settings dialogue box to begin. I excluded all lines with the ‘DISPLAY’ String 000500 000501 . enabling you to modify the editor settings 8......000507 ...... enter an END or CANCEL command............ The current session resumes 8.... F Redisplays one or more lines at the beginning of a block of excluded lines F Or F {n} Here.......13.MOVE WS01-Q-EBPP-ROW-DEL-CNT TO WS01-Q-EBPP-ROW-DEL-CNT-Z . it allows you to edit a sequential data set or a PDS member during your current edit session To exit from a nested edit session.1 Line(s) not Displayed WS01-Q-EBPP-ROW-DEL-CNT-Z ELSE ........2 Line(s) not Displayed - - If I issue the following command 000500 000501 ..ISPF Editor Commands DEFINE A RESET To reset the definition of A 8..14....MOVE WS01-Q-EBPP-ROW-DEL-CNT TO WS01-Q-EBPP-ROW-DEL-CNT-Z .......-F4 000507 ...1 Line(s) not Displayed WS01-Q-EBPP-ROW-DEL-CNT-Z ELSE .....235 - ....000509 000510 ....5 Line(s) not Displayed WS01-Q-EBPP-TERM-ROW-CNT-Z .......000509 000510 ....15.2 Line(s) not Displayed - - An Introduction to Mainframes . from within an EDIT session.5 Line(s) not Displayed WS01-Q-EBPP-TERM-ROW-CNT-Z .

.236 - ......19..1 Line(s) not Displayed WS01-Q-EBPP-TERM-ROW-CNT-Z . reset and then again X LL <text-1> 8. four lines of DISPLY has been shown in response to F4 000500 000501 000502 000503 000504 000505 ....ISPF Editor Commands The display will be changed to this..... block can be converted by using LCC 8... L command can be used in the similar fashion – to redisplay the last line or lines of a block of excluded lines 8. The line then appears as the first line on the panel LOCATE {Label | Line number} You can label a line by issuing ‘..000507 .. instead of giving.2 Line(s) not Displayed - - 8. F ALL <text-1> frequently ....000509 000510 . you can use the command FLIP.. L Like the F command we see above..20.and it will hide all the lines except the lines with text-1.. O Overlay lines It is better explained through an example An Introduction to Mainframes .... LOCATE/L This primary command allows you to scroll up/down to a specified line..18.’ and then any alphabetic string 8......1 Line(s) not Displayed WS01-Q-EBPP-ROW-DEL-CNT-Z ELSE .17. If you want to see all those hidden lines. LC/LCC Type LC in a line to convert it to lower case. See.16..... FLIP We use X ALL .....MOVE WS01-Q-EBPP-ROW-DEL-CNT TO WS01-Q-EBPP-ROW-DEL-CNT-Z DISPLAY 'SUCCESSFULLY COMPLETED' DISPLAY '-------------------------------------------' DISPLAY 'TABLE DELETE STATISTICS' DISPLAY '-------------------------------------------' ..

OR 000019 37.CH.EQ.EQ.OR 000029 37.C'AR '.OR 000024 37.3.OR 000045 37.EQ.3.EQ.3.3.EQ.3.OR 37.EQ.EQ.3.CH.EQ.OR 000030 37.CH.EQ.C'TOS'.C'CFE'.EQ.C'CSS'.OR 000039 37.CH.OR 000042 37.OR 000023 37.EQ.OR 000022 37.3.C'TLT'.OR 000048 37.CH.CH.OR 000044 37.CH.CH.CH.3.3.EQ.EQ.3.C'AC '.OR 000050 37.EQ.C'MJC'.CH.3.EQ.OR 37.3.ISPF Editor Commands Please see the following portion of JCL 000016 SORT FIELDS=COPY 000017 OMIT COND=(37. had it been thousands of lines.EQ.C'IEA'.EQ.OR 000037 37.OR 000040 37. Let’s see how we can do this 000016 00001C 0000OO 000019 000020 000021 000022 000023 000024 000025 SORT FIELDS=COPY .C'OEC'.3.OR 000026 37.3.CH.EQ.EQ.C'LPS'.C'TLT'.C'CNT'. OMIT COND=(37.OR 000027 37.CH.OR 000032 37.’ after the OR.EQ.EQ.CH.C'EDR'.OR 000036 37.CH.C'SPL'.CH.CH.C'STL'.EQ.EQ.C'CFO'.CH.3.OR 000033 37.EQ.OR 000038 37.C'TOS'.CH.3.OR 000018 37.CH.C'VCR'.CH.3.C'H30'.CH.C'HEA'.3.CH.3.CH.C'CVR'.CH.3.CH.3.EQ.EQ.OR 000046 37.C'XCO'.EQ.3.C'STL'.CH.3.. Here the ‘O’ comes into picture.EQ.3.CH.EQ.OR 000031 37. NO…….EQ.C'AR '.OR 37.EQ.EQ.OR 000035 37. so how shall we fix it?.3.CH.C'G/L'.OR 000034 37.C'BNK'.3.CH.3.C'SPL'.OR 000020 37.OR 37.OR 000021 37.CH. after every OR? …….OR 000025 37.3.C'CSS'.CH.3.3.C'LED'.EQ.OR 37.C'CIS'.CH.C'AOS'.EQ.3.EQ.237 - . it would take long time to do that.3.3.CH.C'CSG'.OR 000043 37.CH.CH.CH.3.CH.EQ.3.C'MAR'.3.3.OR An Introduction to Mainframes .3.C'VCH'.OR 000047 37.C'GC '.OR 000049 37.C'CSE'.3.CH.C'CFG'.3.CH.3.CH.C'MAR'.C'AC '.C'CSO'.3.EQ.OR 37.OR 000041 37..EQ.EQ.EQ.C'HEL') 000051 /* You know this is wrong as we didn’t give a ‘.C'UIP'.CH.OR 000028 37.CH.OR 37.EQ. we will manually insert a .EQ.

C'VCR'.3.EQ.3.CH.EQ.OR.C'AOS'.EQ.3.3.EQ.CH.CH.EQ. OMIT COND=(37.OR.C'OEC'.EQ.OR 37.EQ.EQ.3.3.CH.C'GC '.CH.EQ.CH.EQ.3.OR 37.EQ. 37.3.3.’ and copied that line with ‘C’ 00001C .C'VCH'.3.3.3.EQ.3.EQ.CH.OR.CH.3.3.3.EQ. 37.CH.CH. 37.OR. I created a template line to insert those ‘. 37.OR 37.C'CSE'.OR 37. 37. 2.CH.C'LED'.3.C'CSO'.EQ.EQ.C'HEL') Three changes I have made 1.EQ. 37.OR 37.CH.CH.C'XCO'.CH.EQ.OR.ISPF Editor Commands 000026 000027 000028 000029 000030 000031 000032 000033 000034 000035 000036 000037 000038 000039 000040 000041 000042 000043 000044 000045 000046 000047 000048 000049 000050 0000OO 37.OR.OR 37.OR 37.3.C'UIP'.C'IEA'.OR 37.EQ.3.3.C'CVR'.CH.C'STL'.OR 37.OR 37.3.C'CIS'.C'CFE'.C'CFG'.EQ.3.C'G/L'.EQ.CH.CH. I blocked the start and beginning of the area to be changed with OO/OO Press Enter.C'CFO'.EQ.CH.3.EQ.CH.3.EQ.EQ.CH.3.C'MJC'.C'BNK'.OR.C'AOS'.CH. your changes are ready 000016 000017 000018 000019 000020 000021 000022 000023 000024 000025 000026 000027 000028 000029 000030 000031 SORT FIELDS=COPY .EQ. 37.OR 37.OR 37.C'TLT'.3.CH.OR 37.CH.OR 37.OR. 37.OR 37.CH.OR.CH.CH.OR 37.CH.C'EDR'.C'CSG'.EQ.C'VCH'.OR 37.CH. 37.OR 37.3.EQ.OR.OR.EQ.3.3.3.3.CH. 37.EQ.OR 37. 37.EQ.C'H30'.C'UIP'.C'AC '. 37.3.EQ.OR.3.C'AR '.OR 37.CH.CH.C'SPL'.CH. 37.3.238 - .CH.CH.OR.CH.OR 37.3.C'BNK'.EQ.C'TOS'.C'HEA'.C'CNT'.EQ.3.EQ.3.OR 37.EQ.OR 37.CH.EQ.C'MAR'.C'GC '.CH. An Introduction to Mainframes .OR 37.EQ.OR 37.CH.C'CSS'.EQ.3.C'LPS'.C'VCR'.3.OR.CH.3.CH.EQ.

3.22... =PROF> .3..TABS OFF.OR.CH...OR.OR.....3. 000046 37.ISPF Editor Commands 000032 37...CH.CH... 000043 37. 000036 37.EQ.. 000037 37..C'H30'....OR.. 000039 37.CH.CH.C'CSG'.3..CH.CH...C'MJC'.. 000041 37.OR.3..EQ..C'LED'.EQ. 000044 37.. 000047 37.....OR..NOTE ON.OR.C'LPS'...EQ..... 000035 37. 000051 37.C'CFO'..80).3..CH...3.3.EQ.... 000017 ..OR..C'IEA'...... =PROF> ...EQ.3.. RECOVERY Sets edit recovery mode. 000052 /* 000053 //SYSPRINT DD SYSOUT=* The only additional thing that you have to do is to remove the template line from the display.3..CH....C'CFG'...C'EDR'.OR.3.3.CH.3.....EQ......3..EQ..EQ.. 000042 37.CH.CH..CH.. 000050 37. 8.....CH.EQ..21..EQ.239 - .3. 000033 37.....OR. PROFILE If you type PROFILE primary command in your edit session.OR..CAPS ON..CH.CH.OR....PROFILE LOCK.AUTOLIST OFF.EQ.......C'CSO'... 000045 37. 000040 37......C'HEA'.PACK OFF.CH.AUTONUM OFF.OR.C'CNT'..C'CVR'..EQ. You should be careful designing the template line (or source line)...AUTOSAVE OFF NOPROMPT.......OR..EQ.OR..C'CFE'.EQ. 000048 37.JCLLIB (FIXED .. Only blank characters in the lines specified with O or OO are overlaid with the corresponding characters from the source lines 8.OR..3..HILITE OFF CURSOR FIND.CH......C'OEC'.....HEX OFF.. =PROF> .NULLS ON STD.3..NUMBER OFF.OR. =PROF> .C'G/L'.EQ.RECOVERY OFF WARN..C'CSE'.OR.OR...EQ..IMACRO NONE. it will display the edit profile – you can change it inline Command ===> Scroll ===> CSR 000016 SORT FIELDS=COPY =PROF> .C'HEL') ... 000038 37.CH.. 000049 37..EQ...3..C'XCO'...C'CIS'.3....EQ... which allows you to recover data after a system failure or power outage RECOVERY {ON/OFF} An Introduction to Mainframes .3..CH.STATS ON. 000034 37.EQ.

one at a time. in the order in which they have entered. the system creates and updates a recovery data set for each change and the editor begins recording an audit trail of your interactions 8. SORT SORT can be used to sort the formatted data in an edit window SORT {A/D} {Start-column {End-column}} You can specify 5 sort fields like this 8. TS If you want to split a line to two.24. it reverses edit interactions. It can UNDO only those changes made after RECOVERY or SETUNDO was turned on An Introduction to Mainframes .240 - . UC/UCC changes the selected line/lines to upper case 8.22. To use UNDO. UC Like LC. type TS in the line command section and place the cursor where you want the line to be split and press enter 8.25.ISPF Editor Commands If the ON is specified. SETUNDO SETUNDO {STORAGE|RECOVER|ON|OFF} STORAGE RECOVER ON OFF : Enables the saving of edit changes in storage : Enables the saving of edit changes through the recovery : Enables edit changes to be saved in storage : Disables 8.23. you must have either RECOVERY ON or SETUNDO ON. UNDO Each time you enter UNDO.26.

Leon Vikas Birchall. Computer Science C++. D. VSAM Concepts.J. INC. Saba. DB2 Developer’s Guide. Craig.Second Edition.K.Second Edition. Dhanpat Rai & Co. Ranade Hirday. INC An Introduction to Mainframes . Software Solutions Roy. Mc Graw-Hill. A Guide to DB2 – Third Edition. INC Brown. Mike.com Arellanes. http://nobelprize. Gary DeWard. Dastidar. White. Govt. Ranade. Programming. of India Ebbers. Wayne. Mainframe Handbook. Chander.S.Ghosh.com Arora. O’Brien. Schaum’s Outline Series. McGraw-Hill. Schaum’s outline of Theory and Problems of Programming with Modern Structured COBOL .com http://shop. Mullins. 1885-1969 Bell Labs – http://www.dell. The MVS JCL Primer Date. Pearson Education Ranade. C. Larry. Colin J.Bibliography Bibliography Leon. DB2 UDB V8. IBM COBOL for MVS & VM Version 1 Release 2 Performance Tuning – IBM Corporation. Bill. System/390 and zSeries IBM Archives – IBM Highlights.241 - . Manual for Investigation of Computer Related Crimes.org http://www.com/ibm/history/index. Yukihisa. Mc Graw-Hill. Ashok. Alexis. Ogden. Tata McGraw-Hill Publishing Company Limited Newcomer.J. System 370/390 Job Control Language . COBOL Programming Including MS COBOL and COBOL-85. Sumita.Third Edition. John Wiley & Sons.bell-labs.http://www-03. Graeme. and Design . M.lenovo. Introduction to the New Mainframe: z/OS Basics – IBM Redbooks Wikipedia IBM Archives . Jay.ibm. Addison-Wesley Publishing Company Kageyama.2 SQL Cookbook Dohare. CICS Handbook. Department of Information Technology. R.html IBM Archives – A Brief History of the IBM ES/9000. INC Zamir. MCIT.

com/ibm/history/exhibits/mainframe/mainframe_album.ca – Memorial University of Newfoundland – Department of Computer science Course: CS 3725 An Introduction to Mainframes . Dirk.ibm. Steve.html http://www.242 - .2007 http://www-03.boulder. Development of 360/370 Architecture .com/systems/z/ The Times of India – Capital Edition – Nov 14.britannica.html z/Architecture Principles of Operation.ibm.wss http://www-03. Mary.L. IBM Systems Software Development http://www.mapsofworld. Valeria.aig. Sokal. Partitioned Data Set Extended (PDSE) Usage Guide.Bibliography Eckols.A Plain Man' View. IBM Redbooks Morton.ibm. Dalisay. IBM Gribbin P. VSAM Demystified.html http://www-03.com/press/us/en/pressrelease/22579.cs.com http://www.com/ http://publib.ibm.ca/mvs/24to31.howstuffworks.qc. Gutschke.ibm. IBM Redbooks z/OS DFSORT Application Programming Guide – IBM Yaeger. Frank. Mike Murach & Associates Lovelace.mun.princeton.com/referrals/computers/types-of-computers/index. http://www. IMS for the COBOL Programmer. Rama. DFSORT Team. Alvaro.com http://www. Dawn.html http://www.ibm.J. Ayyar. Nigel.edu s http://computer.com/ http://www-03.com/ibm/history/exhibits/mainframe/mainframe_basinfo. DFSORT: ICETOOL Mini-User Guide.webopedia.com/systems/i http://www-03. Salla.

227 Compatibility -----------------------------.225 Auxiliary storage -------------------------.75 Channels-----------------------------------.142 CCW ---------------------------------------.208 Alias---------------------------------------.136 COBOL -----------------------------------. 225 BROWSE---------------------------------.63 abacist--------------------------------------.21 COALESCE------------------------------.101 byte index ---------------------------------.96 AUTOSAVE -----------------------------.107 COMP-3 ----------------------------------.17 BLOCK -----------------------------------.73 binary system -----------------------------.135 ALL 31 -----------------------------------.19 CHECK-----------------------------------.25 Batch Processing ---------------------.19 Digital Computers------------------------.76 channel subsystem -----------------------.51 Charles Babbage--------------------------.59 AI -------------------------------------------.31 DISPLAY --------------------------------.234 EDSAC ------------------------------------.199 control registers---------------------------. 232 DASD ----------------------------------.106 COMP-2 ----------------------------------. 73 CPW----------------------------------------.176 CONTINUE------------------------------. 56 BFP-----------------------------------------.74 COUNT-----------------------------------.80 Central Storage ---------------------------.74 actuator ------------------------------------.170 CPU -------------------------------.110 control blocks -----------------------------.44.131 Altair ---------------------------------------.227 channel paths------------------------------.45 Batch operating systems-----------------.53 Claude Shannon --------------------------.84 Address Space ----------------------------.43 CHANGE---------------------------------.53 address space------------------------------.29 AIX----------------------------------------.60 analog computers-------------------------.96 application programmer -----------------.226 buffer--------------------------------------. 53 DAT ------------------------------------.18 Bit Logic Tests---------------------------.200 CKD----------------------------------------.15 absolute address --------------------------.34 CREATE ---------------------------.243 - .43.98 CIDF --------------------------------------.43.107 COMPARE-------------------------------.20 Concatenate ------------------------------.233 Density-------------------------------------.234 EDITSET ---------------------------------.21 Computing Tabulating Recording------.INDEX INDEX 31 bit addressing--------------------------.15 abacus--------------------------------------.186 Blaise Pascal ------------------------------.84.39 BOUNDS---------------------------.173 Difference engine-------------------------. 87 DBD---------------------------------------.82 DYNAM----------------------------------.39 Analog Computers -----------------------.22 COMP-------------------------------------. 51.27 AMODE -----------------------------------.122 EDIT --------------------------------------.206 Cache Memory ---------------------------.216 DBRM ------------------------------------.101 blocking factor---------------------------.192.136 COND-------------------------------------.127 Batch Job ----------------------------------.24 .130 dynamic address translation-------------.84 Dynamic address translation ------------.87 Dynamic CALL--------------------------. 231 cryptographic facility --------------------.53 DFSORT----------------------------------.79 Availability--------------------------------.42 AWO --------------------------------------.101 Colossus -----------------------------------.207 CICS ---------------------------------------.131 An Introduction to Mainframes CI Split------------------------------------.224.86 CA split -----------------------------------.78 Control Interval--------------------------.137 DEFINE ----------------------------------.193.101 BlueGene ----------------------------------.126 DRAM -------------------------------------.31 Application Designers -------------------.134 DCLGEN ---------------------------------.81 access registers ---------------------------.75 CUT ---------------------------------.43 computer cluster --------------------------.82 CASE -------------------------------------.38 computer generation ---------------------.

235 LDS ---------------------------------------.127 NODYNAM -----------------------------.41 Mainframe-----------------------------. 65 ESDS--------------------------------------.26 multiprocessing ---------------------------.16 LPAR --------------------------------------.51.141 IMS-----------------------------------------.101 An Introduction to Mainframes iogen ---------------------------------------.148 Fourth Generation ------------------------.29 first generation----------------------------.110 NOAWO----------------------------------.141 Integral Boundaries ----------------------.38 multiprogramming -----------------------.130 NOSSRANGE ---------------------------.68 Jack Kilby ---------------------------------.138 FBA ----------------------------------------.73 HRECALL -------------------------------.20 HFP ----------------------------------------.98 IMS DB-----------------------------------.67 MIPS -----------------------------------.216 INCLUDE --------------------------.60 General Purpose Computer -------------.235 LCC ---------------------------------------.108 Expanded storage-------------------------. 77 MARK-1-----------------------------------.61 EXPLAIN --------------------------------.72 mainframe ---------------------------------.53 FICON ---------------------------------.127 Indicator Variable -----------------------.78 Multiprocessing---------------------------.78 Multiprogramming -----------------------.38 NUMPROC ------------------------------.128 NRETRIEV ------------------------------. 175 Indexes------------------------------.26 Jacquard loom ----------------------------.201 LC -----------------------------------------.56 MVS----------------------------------------.129 .229 microcomputer----------------------------.74 FORM ------------------------------------. 32 midrange systems-------------------------. 235 floating-point registers-------------------.195.26 IOCS --------------------------------------.39 Hybrid Computers------------------------.43.204 Leibniz -------------------------------------.51 multiprocessing computer ---------------.31 I/O Devices----------------------------.60.52 Main storage ------------------------------.39 ENIAC -------------------------------------.234 EDVAC------------------------------------.20 ICETOOL --------------------------------.23 MCM---------------------------------------.16 John von Neumann-----------------------.74 Herman Hollerith-------------------------.202 eServer zSeries 900 ----------------------.18 JCL error ---------------------------------. 92 Napier' Bones ----------------------------.16 s NEXT SENTENCE ---------------------.32 microprocessor------------------------.168 IDAW --------------------------------------.18 KSDS -------------------------------------.22 Joseph Marie Jacquard-------------------.235 Logarithms --------------------------------.24 EKA----------------------------------------.27.130 NOOPTIMIZE---------------------------.34.22 FLIP ---------------------------------.73 frame ---------------------------------------.128 NORENT ---------------------------------.74 FPS -----------------------------------------.27 FPC-----------------------------------------.90 Frame --------------------------------------.191 Hybrid computers ------------------------.17 LOCATE ---------------------------------.59 MVS/XA ------------------------------.32 MIP-----------------------------------------.109.158 IMAGECOPY ---------------------------.229 MDD --------------------------------------. 52 IBM ----------------------------------------.75 EVALUATE -----------------------------.73 Expanded Storage ------------------------.80 IEBCOPY --------------------------------.25 Intel ----------------------------------------.196 Null Indicator ----------------------------.244 - . 68 fifth generation ---------------------------.33 Minicomputers----------------------------.26.32 general registers --------------------------.173. 69 Monolithic---------------------------------.213 John Napier -------------------------------.63 IRD -----------------------------------------.67 MD ----------------------------------------.153 IEBGENER ------------------------------.23 ESCON --------------------------------. 127 INDEXES --------------------------------.68 ETR ----------------------------------------.66 eServer zSeries 990 ----------------------.49 MSI-----------------------------------------.INDEX EDSET------------------------------------.80 integrated circuit--------------------------.134 NUMA -------------------------------------.52.

36 Swapping ------------------------------.130 REPLACE--------------------------.60.25 Security ------------------------------------.214 S806 ---------------------------------------. 121 Second Generation -----------------------. 231 retrofitting --------------------------------.216 PROCOPT--------------------------------. 232 PATH -------------------------------------.128.45 OMIT -------------------------------------.216 PSW----------------------------------------.79 RECOVERY-----------------------------.37 SIMD---------------------------------------.87 region third index-------------------------.192.109.239 Special Purpose Computer --------------.192 Scalability ---------------------------------.61.112.213 S0C7 --------------------------------.47 SORT -------------------------------------.61 SSI------------------------------------------. 214 S322 ---------------------------------------.38 single chip ---------------------------------.56 SRAM--------------------------------------.26 SSL -----------------------------------------.173 operating system--------------------------.127 Super computers--------------------------.98 RDF ---------------------------------------.28 RMODE -----------------------------------.213 S722 ---------------------------------------.80 Stored program concept -----------------.86 SELECT ----------------------------------.109.128 Static CALL------------------------------.38 Solid Logic Technology -----------------.103 Region -------------------------------------.193.90 Slot -----------------------------------------. 86 page index ---------------------------------.238 REDEFINES -----------------------------.60 SMP ----------------------------------------.60 An Introduction to Mainframes Robert Noyce -----------------------------.104 RENT -------------------------------------.101 Plan----------------------------------------.229 RISC ---------------------------------------.42 SDSF ---------------------------------------.53 Processing Options----------------------.213 S522 ---------------------------------------.121 Storage Addressing-----------------------. 163 physical record---------------------------.68 SSRANGE -------------------------------.61 Paging----------------------------------.220 Production Control Analyst -------------.42 Segment------------------------------------.109.239 Seymour Cray-----------------------------.81 Printers-------------------------------------.82 SRM----------------------------------------.42 RENAMES-------------------------------.16 slot------------------------------------------.90 page-in -------------------------------------.86 segment index-----------------------------.153.146 QW ----------------------------------------.216 PSBGEN----------------------------------.32 Spooling -----------------------------------.120 RACF --------------------------------------.110 Serviceability -----------------------------.86 region first index -------------------------.213 SB37 --------------------------------------.245 - .134 PR/SM -------------------------------------.140 S013 ---------------------------------------.203 RUNSTATS------------------------------.213 S878 ---------------------------------------. 90 Synonym----------------------------------.17 PASTE ------------------------------.86 region second index ----------------------.61 page-out------------------------------------.26 RRDS -------------------------------------.60.42 SETUNDO -------------------------------. 85 Pascaline-----------------------------------.97 PROFILE ---------------------------------.98 SEARCH ---------------------------.INDEX OLTP --------------------------------------.63 .87 Reliability ---------------------------------.22 Subscripts---------------------------.238 PSB----------------------------------------. 121 SEARCH ALL---------------------.81 Real storage -------------------------------. 127 SUBSCRIPTS ---------------------------.200 real address--------------------------------.52 Prefixing -----------------------------------.87 region index -------------------------------.90 Page ------------------------------------.73 QMF --------------------------------------.76 OPTIMIZE -------------------------.86 Page Stealing------------------------------.213 S913 ---------------------------------------.210 PDSE--------------------------------.76 operator facilities -------------------------.32 slide rule -----------------------------------.134 sysgen --------------------------------------.61 paging --------------------------------------.214 S0C4 --------------------------------------. 139 page ----------------------------------------.

65 System Administrator--------------------.239 Unit Record Devices ---------------------.36 z/OS -------------------------------.60.82 Virtual Storage----------------------------.38 teraflop-------------------------------------.63 System Operator--------------------------.66. 84 z900 ----------------------------------------.27 VSAM ------------------------------------.55 VLSI ---------------------------------------. 64 z/Architecture -----------------------------.62 System Initialization ---------------------.57 TLB ----------------------------------------.64 Tabulating Machine Company ---------. 46 System/370--------------------------------.129 TS------------------------------------------.52 USAGE -----------------------------------.INDEX sysplex -------------------------------------.135 virtual address ----------------------------.69 An Introduction to Mainframes .88 transistor-----------------------------------. 77.246 - .25 Thomas J.106 Views -------------------------------------.95 System/360----------------------------.48 System/390--------------------------------.21 Time Sharing------------------------------. Watson Sr --------------------.20 TATA --------------------------------------.96 System Generation -----------------------.52 UNIVAC – I ------------------------------.39 Third Generation -------------------------.98 XA--------------------------------------.25 TRUNC -----------------------------------.239 UNDO ------------------------------------.81 Virtual Memory---------------------------.41.24 URD----------------------------------------.198 WAS ---------------------------------------.97 System Programmer ---------------------.239 UC -----------------------------------------.20 tabulator -----------------------------------.66 z990 ----------------------------------------.