Processing with VSAM Files Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
Advertisements

Final Total Lines in COBOL Please be sure you can see the speaker notes - they contain additional information!
Chapter 15 Indexed Sequential Files. Disk File Organization File is collection of records Three major ways records stored or organized on disk - Sequential.
Screen Section Please use speaker notes for additional information!
Any Questions!. Agenda Fun with Functions –how to get the system date Condition Names INDARA and SI Iteration Logical Files Positioning the file pointer.
VSAM KSDS and COBOL Department of Computer Science Northern Illinois University August 2005 Some of the illustrations are from VSAM: Access Method Services.
15-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
File Organization Techniques
Relative Files.. Creating a Relative File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateRelativeFromSeq. * Creates a Relative file.
4-1 Coding Complete COBOL Programs: The PROCEDURE DIVISION Chapter 4.
4-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Cursor and Exception Handling By Nidhi Bhatnagar.
4-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
1 Chapter 4. To familiarize you with methods used to 1. Access input and output files 2. Read data from an input file 3. Perform simple move operations.
Modifications to program Addda.cbl Please use speaker notes for additional information!
The Fun That Is File Structures Pages By: Christine Zeitschel.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
COBOL Cobol is one of the most robust language in the software field, so far Cobol turned 50, in 2009 Cobol has stood the test of time Common Business.
Programming in COBOL-85 For IBM Mainframe System 390 Jyothi Sridhar Kini E&R, Infosys Mail-id: Phone:
Totals on the Screen Please use speaker notes for additional information!
DATA STRUCTURE & ALGORITHMS (BCS 1223) CHAPTER 8 : SEARCHING.
Lecture 31 Numeric Edited Alphabetic (A) AlphaNumeric (X) Numeric (9, V, S) Numeric Edited (9, Z, comma, decimal point, minus sign) –Z = zero suppressed.
The DATA DIVISION Chapter 3. COBOL Data Organization Field - group of characters forming a meaningful unit or basic fact –Characters in a name or digits.
3-1 Chapter 3. To familiarize you with  Ways in which data is organized in COBOL  Rules for forming data-names  Defining input and output files in.
1 Interactive vs Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
Array - adding to array at run time Please see speaker notes for additional information!
Indexed Files continued. Figure 17.1 Sequential Update OLD MASTER TRANSACTION NEW MASTER ERROR MESSAGES UPDATE PROGRAM.
Chapter 7 File I/O 1. File, Record & Field 2 The file is just a chunk of disk space set aside for data and given a name. The computer has no idea what.
Indexed and Relative File Processing
Chapter 9 I/O Streams and Data Files
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
1 The Procedure Division Chapter 4. 2 Main Two Sections File Section –Used to define files and record formats –Field names within records Working Storage.
13-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Sequential Files Chapter 13. Master Files Set of files used to store companies data in areas like payroll, inventory Set of files used to store companies.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
VSAM Alternate Indexes Department of Computer Science Northern Illinois University August 2005.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
Explanation of SAMPLEIF (if88in1.cbl or if88in1.html) Please use speaker notes for additional information!
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
COBOL Screens Please use speaker notes for additional information!
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
Any Questions!. Agenda Fun with Functions –how to get the system date –How to get the next service date INDARA and SI Condition Names Iteration Logical.
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
This is It! It’s been a pleasure! Final Exam – format True / false 5 Multiple choice 5 Short answers10 Data manipulation10 SQL 3 Array’s12 File processing25.
Analysis of SAMPLE1.CBL Please check speaker notes for additional information!
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
Indexed Files.. Creating an Indexed File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateIndexedFromSeq. * Creates an indexed file.
Chapter 4 PROCEDURE DIVISION. Paragraphs PROCEDURE DIVISION divided into paragraphs Each is independent module or routine Made up of series of instructions.
Any Questions!. Agenda Fun with Functions Externally Described Files Condition Names Iteration Logical Files Random Reads.
VSAM ESDS and RRDS Department of Computer Science Northern Illinois University September 2005 Some of the illustrations are from VSAM: Access Method Services.
Random update Please use speaker notes for additional information!
Sequential Processing to Update a File Please use speaker notes for additional information!
Array Applications. Objectives Design an algorithm to load values into a table. Design an algorithm that searches a table using a sequential search. Design.
Introduction to Sequential Files. COBOL's forte  COBOL is generally used in situations where the volume of data to be processed is large.  These systems.
Designing and Debugging Batch and Interactive COBOL Programs
Any Questions?.
Chapter 3 The DATA DIVISION.
Agenda Test next Week! SI or no SI? File Update Techniques – Review.
Please use speaker notes for additional information!
Chapter 14 Sorting and Merging.
Programming in COBOL-85 For IBM Mainframe System 390
Searching an Array or Table
Please use speaker notes for additional information!
Using screens and adding two numbers - addda.cbl
2 file sequential matching with multiple records allowed on file 2
Presentation transcript:

Processing with VSAM Files Please use speaker notes for additional information!

Organization is sequential Access is sequential Organization is sequential Access is sequential SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS SEQUENTIAL ACCESS IS SEQUENTIAL. This code means that the file is organized without indexes and will be read sequentially one record at a time. Note that since sequential is the default for both organization and access, these clauses do not need to be specified. The organization of the tells how the data is organized. Organization sequential means that it is organized without indexes. Organization indexed means that it is an indexed file with a primary index and possible alternate indexes that can be used to access the records. Essentially that means that there will be a data file and an index file used to access the data. The third type of organization is relative which will be not be dealt with in this presentation. Once a file has been set up with indexes, other programs reading or updating this file must also specify the indexes. The indexes can then be used to access the records on the file. Today indexed files are VSAM (Virtual Storage Access Method). Access refers to how the records on the file will be accessed. The access method is directly related to the organization. For example if the organization is sequential, the records can only be accessed sequentially.

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) This file is an indexed VSAM file. That means that the records are stored on a disk using a methodology that includes indexes. This means that there will be two files: one containing the data and one containing the indexes. The index can be either numeric or alphanumeric. The index must be unique so frequently a field like social security number or some other identification number is used as the index. In this example, the file is organized so that it has indexes. The field that is the index is specified in the record key clause. The access on this select is sequential which means that the file will be read sequentially one record at a time. Note that the indexed field that is the record key must then be defined in the FILE- SECTION. Organization is indexed Access is sequential Organization is indexed Access is sequential

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) Organization is indexed Access is random Organization is indexed Access is random With random access, the indexed structure can be used to access a specific record based on the record key. The structure of the program usually involves reading a transaction that contains a particular identification number and then randomly finding a match to that identification number in the indexed file. (Note I used identification number because that is the record key in the example).

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS DYNAMIC RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) Organization is indexed Access is dynamic Organization is indexed Access is dynamic With indexed organization, you can also specify that ACCESS IS DYNAMIC. This means that the indexed file can be read both sequentially and dynamically in this program. For example, you might randomly access a particular record and then process the records after it in the file sequentially until a particular condition is met. As we will see, with dynamic access the programmer must write code to specify whether the read is random or sequential.

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO ALTERNATE RECORD KEY IS EMPNAME WITH DUPLICATES. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 EMPNAME PIC X(20). Alternate key SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS DYNAMIC RECORD KEY IS IDNO ALTERNATE RECORD KEY IS EMPNAME WITH DUPLICATES. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 EMPNAME PIC X(20). SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS IDNO ALTERNATE RECORD KEY IS EMPNAME WITH DUPLICAT3S. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 EMPNAME PIC X(20).

Creating a VSAM file SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) WRITE INDEXED-REC INVALID KEY PERFORM B-300-ERROR-WRITE. In this example, I am going to be creating a indexed sequential file with IDNO as the key. When dealing with indexes there is the possibility that I will encounter a situation where the write is invalid. In these cases, the invalid key clause on the write will be triggered. If the write is invalid, the write will not be executed. Instead processing will go to B-300- ERROR-WRITE.

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) Write an indexed file WRITE INDEXED-REC INVALID KEY PERFORM B-300-ERROR-WRITE NOT INVALID KEY PERFORM B-310-PAPER-TRAIL END-WRITE There is also a NOT INVALID KEY clause that allows the programmer to specify activity that is to take place if the WRITE was successful. For example, the programmer could have a routine that writes a report containing all of the records successfully written tot he file. Note that the END-WRITE clause can be used with the WRITE as well.

SELECT SEQ-PAY-FILE ASSIGN TO “A:\PAYORIG.DAT” ORGANIZATION IS SEQUENTIAL ACCESS IS SEQUENTIAL. SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO. DATA DIVISION. FILE SECTION. FD PAYORIG DATA RECORD IS PAYIN-REC. 01 PAYIN-REC. 05 ID-IN PIC 9(5). 05 REST-IN PIX X(100). FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 REST-DATA PIC X(100). Creating an indexed file B-200-LOOP. MOVE ID-IN TO IDNO. MOVE REST-IN TO REST-DATA. WRITE INDEXED-REC INVALID KEY PERFORM B-300-WRITE-ERR. READ PAYORIG AT END MOVE “NO “ TO MORE-RECS.

Reading an indexed file sequentially SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) READ INDEXED-FILE AT END MOVE “NO “ TO MORE-RECS. When an indexed file is being read sequentially the usual sequential read is used. Essentially, you can read the indexed file sequentially from record one until end of file has been reached. The processing will be the same as if the organization was sequential.

START verb EQUAL TO = GREATER THAN START filename KEY IS > NOT LESS THAN NOT < GREATER THAN OR EQUAL TO >= INVALID KEY… NOT INVALID KEY… END-START DISPLAY “ENTER START IDNO”. ACCEPT IDNO-ENTERED. MOVE IDNO-ENTERED TO IDNO START INDEXED-FILE KEY >= IDNO INVALID KEY DISPLAY “INVALID START POINT” MOVE “NO “ TO FOUND-IND NOT INVALID KEY MOVE “YES” TO FOUND-IND END-START IF FOUND-IND = “YES” READ INDEXED-FILE AT END MOVE “NO “ TO MORE-RECS. In this example, I have the user enter an identification number which is accepted to an area in working storage. The entered number is then moved to IDNO which is the RECORD KEY. I then look for a starting point based on the KEY >= to IDNO. If the user entered then processing would start with either or the first record larger than If no record was equal or greater than other processing needs to be coded. NOTE: The START positions, a READ is needed to actually read the record.

SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY IS IDNO ALTERNATE RECORD KEY IS EMPNAME WITH DUPLICATES. Sequentially reading using alternate key MOVE LOW-VALUES TO EMPNAME. START INDEXED-FILE KEY GREATER THAN EMPNAME INVALID KEY... READ INDEXED-FILE AT END MOVE “NO “ TO MORE-RECS. When you want to read sequentially along the alternate key path, you use the START verb to establish both the alternate key path and the starting point. In this example, I want to read the starting with the first record along the alternate key path. To do this, I move LOW-VALUES to the field defined as the ALTERNATE RECORD KEY and then in the KEY clause of the START, I again use the name of the ALTERNATE RECORD KEY. This not only locates the record but also establishes the path to be followed with the sequential READ. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 EMPNAME PIC X(20).

Random read - record/prime key SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS IDNO. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5) MOVE TRAN-ID TO IDNO. READ INDEXED-FILE INVALID KEY PERFORM B-310-PROBLEM NOT INVALID KEY PERFORM B-300-PROCESS END-READ OR MOVE TRAN-ID TO IDNO. READ INDEXED-FILE INVALID KEY PERFORM B-310-PROBLEM. MOVE TRAN-ID TO IDNO establishes the key. The READ that randomly reads the file looking for a record with that IDNO. If the read is not successful in finding a record with that IDNO, the INVALID KEY clause is executed.

Random read - alternate key SELECT INDEXED-FILE ASSIGN TO “A:\PAYROLL.DAT” ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS IDNO ALTERNATE RECORD KEY IS EMPNAME WITH DUPLICAT3S. FD INDEXED-FILE DATA RECORD IS INDEXED-REC. 01 INDEXED-REC. 05 IDNO PIC 9(5). 05 EMPNAME PIC X(20). MOVE EMP-NAME-TRAN TO EMPNAME. READ INDEXED-FILE KEY IS EMPNAME INVALID KEY PERFORM B-310-PROBLEM NOT INVALID KEY PERFORM B-300-PROCESS END-READ OR MOVE EMP-NAME-TRAN TO EMPNAME. READ INDEXED FILE KEY IS EMPNAME INVALID KEY PERFORM B-310-PROBLEM. The employee name from the transaction is move to the EMPNAME to establish the key. Since this READ is going to be using the ALTERNATE RECORD KEY the KEY clause has to be used in the READ to establish the fact that we are searching for a match in the alternate index, not the prime index.

SELECT MASTER-FILE ASSIGN TO "C:\PCOBWIN\VSAM\VSAMALT.DAT" ORGANIZATION IS INDEXED ACCESS IS DYNAMIC RECORD KEY IS MID ALTERNATE RECORD KEY IS MITEM-NAME WITH DUPLICATES. Read sequentially &/or randomly This file is organized with indexes and the ACCESS IS DYNAMIC clause allows the programmer to access the file either sequentially or randomly using either the record key MID or the alternate record key MITEM-NAME. Random read using primary key: MOVE RETR-ID TO MID. READ MASTER-FILE INVALID KEY PERFORM B-310-INVALID NOT INVALID KEY PERFORM B-300-PROCESS END-READ. Sequential read using primary key: (Assumes starting point has been established). READ MASTER-FILE NEXT AT END MOVE "YES" TO EOF-IND END-READ. When reading a ACCESS IS DYNAMIC file sequentially, the NEXT is required to differentiate between the two types of READs.

Random and sequential reads MOVE START-PT TO MID. MOVE "YES" TO MSTR-FOUND. READ MASTER-FILE INVALID KEY MOVE "NO " TO MSTR-FOUND. IF MSTR-FOUND = "YES" PERFORM B-300-DETAIL EOF-MSTR = "YES”. B-300-DETAIL....processing... READ MASTER-FILE NEXT AT END MOVE "YES" TO EOF-MSTR. This code shows the START-PT being moved to the MID (the record key) and then a random read being done to locate the record that is requested. When the record is found, control will pass to the B-300-DETAIL. In this routine, the file will be read sequentially from the record located by the random read. Note that the sequential read uses the NEXT. When EOF is reached, processing will end.

Start and sequential read Random and sequential read Start and sequential read Random and sequential read In this code the start verb locates the starting record but does not read it. The first time the READ is executed the record that was located is read and processed. MOVE START-PT TO MID. MOVE “YES” TO MSTR-FOUND. START MASTER-FILE KEY >= MID INVALID KEY MOVE “NO “ TO MSTR-FOUND NOT INVALID KEY MOVE “YES” TO MSTR-FOUND END-START IF MSTR-FOUND = “YES” READ MASTER-FILE AT END MOVE “YES’ TO EOF-MSTR. In this code a random read locates the starting record. If the locate is successful, then the NEXT record is read and processed. MOVE START-PT TO MID. MOVE "YES" TO MSTR-FOUND. READ MASTER-FILE INVALID KEY MOVE "NO " TO MSTR-FOUND NOT INVALID KEY MOVE “YES” TO MSTR-FOUND END-READ. IF MSTR-FOUND = "YES” READ MASTER-FILE NEXT AT END MOVE "YES" TO EOF-MSTR. To mix random and sequential read statements, dynamic access must be specified.

Random read using alternate key: MOVE RETR-NAME TO MITEM-NAME. READ MASTER-FILE KEY IS MITEM-NAME INVALID KEY PERFORM B-410-INVALID NOT INVALID KEY PERFORM B-400-PROCESS. SELECT MASTER-FILE ASSIGN TO "C:\PCOBWIN\VSAM\VSAMALT.DAT" ORGANIZATION IS INDEXED ACCESS IS DYNAMIC RECORD KEY IS MID ALTERNATE RECORD KEY IS MITEM-NAME WITH DUPLICATES. Sequential read using alternate key: (Assumes that the start point and alternate key path has been established). READ MASTER-FILE NEXT AT END MOVE "YES" TO EOF-IND. Alternate key The sequential read is assuming that the path has been established by a previous random read.

SELECT MASTER-FILE ASSIGN TO "C:\PCOBWIN\VSAM\VSAM1.DAT" ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS MID FILE STATUS IS WS-FILE-STATUS. File status MOVE RETR-ID TO MID. READ MASTER-FILE INVALID KEY PERFORM B-310-INVALID. IF WS-FILE-STATUS = "00" PERFORM B-300-PROCESS. B-310-INVALID. MOVE RETR-ID TO PID. IF WS-FILE-STATUS = "23" MOVE "RECORD MISSING" TO PMSG ELSE MOVE "OTHER PROBLEM" TO PMSG. Because of the file status clause in the select, the file status is retrieved every time this record is used. A file status of 00 means that the processing was successful. Charts that give meaning to the specific numbers are available in COBOL manuals. 01 WS-FILE-STATUS PIC XX VALUE SPACES.

File status SELECT MASTER-FILE ASSIGN TO "C:\PCOBWIN\VSAM\VSAM1.DAT" ORGANIZATION IS INDEXED ACCESS IS RANDOM RECORD KEY IS MID FILE STATUS IS WS-FILE-STATUS. 01 WS-FILE-STATUS PIC XX VALUE SPACES. PROCEDURE DIVISION. DECLARATIVES. ERROR-HANDLING SECTION. USE AFTER ERROR PROCEDURE ON MASTER-FILE. ERROR-CHECK. IF WS-FILE-STATUS = "23" MOVE RETR-ID TO PID MOVE "RECORD MISSING " TO PMSG WRITE PRINTZ AFTER ADVANCING 1 LINES END-IF. END DECLARATIVES. MAIN-PROGRAM SECTION. MAINLINE. PERFORM A-100-INITIALIZE. PERFORM B-100-PROCESS. PERFORM C-100-TERMINATE. STOP RUN. B-200-LOOP. MOVE SPACES TO PRINTZ. MOVE RETR-ID TO MID. READ MASTER-FILE. IF WS-FILE-STATUS = "00" PERFORM B-300-PROCESS END-IF. The declaratives part of the program is where you can set up error handling procedures that can be applied to a file. Note that the read has no clause associated with it. If the read is unsuccessful control switches to the the error-handling section and appropriate processing is done.