Application Program Design Day3. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Basic CICS programming –Structure.

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

August 29, Accessing the iSeries and Some Commands.
COBOL Considerations Identification Division. Environment Division
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
COSC 120 Computer Programming
CICS Basic Commands COBOL programming statements.
Intro to Program Development
CICS-Dbg1 Testing and Debugging Programmers responsibility that program works correctly! Can write program incrementally You must test anything that the.
1 Introduction to CICS. 2 Contents Introduction History Compatibility Typical Usage Components of CICS CICS Structure – Domains CICS Management Functions.
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan SPUFI Hands On Introduction to Embedded SQL DCLGEN.
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)
OO Cobol in z/OS.
CICS-Prg1 Terminal Handling CURSOR Positioning (in SEND MAP) IC option in DFHMDF Macro (ATTRB Parm)  If more than one – LAST position is used. DIRECT.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
CICS – Mainframe (LC) 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Course Schedule Day1 - Introduction to CICS Day2.
Chapter To familiarize you with  Why COBOL is a popular business-oriented language.  Programming practices and techniques  History of COBOL.
Basic Mapping Support Day2 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Introduction to BMS –Screen Layout.
Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.
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.
3-1 The DATA DIVISION Chapter Chapter Objectives To familiarize you with Systems design considerations Ways in which data is organized Rules for.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
Indexed and Relative File Processing
DB2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/DB01/003 Version No:2.0a Session Plan Introduction to Concurrency Control Different types.
IBM MAINFRAMES CICS Training Class-01.
1 Transaction Management Systems On z/OS Online Processing On The Mainframe Stephen S. Linkin Houston Community College © HCCS and IBM 2008 ©HCCS & IBM®
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
Lecture 31 Creating Executable Programs on the Mainframe Tuesday, January 20, 2009.
More Syntax in COBOL  Moving Data  Selection Statements  System Date  Indicators in Display files.
© Copyright 2006 Domino Software Ltd. Mantis Conversion  Complicated & Thorough Process  Several issues need to be addressed in the analysis.
HELLO WORLD program in COBOL - CIS12 Please use speaker notes for additional information!
IBC233 Lecture 2 Updated Winter 2008 Agenda Test next Week – Jan 23 ISeries Architecture CL (Control Language) Library Lists Operations Navigator.
Copyright © 2012 UNICOM Systems, Inc. Confidential Information z/Ware Product Overview illustro Systems International A Division of UNICOM Global.
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.
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
Chapter 9: Advanced SQL and PL/SQL Guide to Oracle 10g.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
File Handling & Temporary Storage Day4 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Access Methods –VSAM.
Chapter Six Introduction to Shell Script Programming.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 11 Understanding transaction managers on z/OS.
IBM-Mainframes COBOL Class-1. Background and History  COBOL is an acronym for: Common Business Oriented Language  COBOL was developed in 1959 by the.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Agenda Computer Languages How to Write a Simple C Program
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Chapter 9: Completing the Basics. In this chapter, you will learn about: – Exception handling – Exceptions and file checking – The string class – Character.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Week 2/3 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
Random update Please use speaker notes for additional information!
Chapter 16 Advanced Bourne Shell Programming. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To discuss numeric data processing.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
z/Ware 2.0 Technical Overview
Completing the Problem-Solving Process
Introduction to PL/SQL
Programming in COBOL.
The SMS Query Menu System for the iSeries
Designing and Debugging Batch and Interactive COBOL Programs
DB2.
Any Questions?.
Chapter 3 The DATA DIVISION.
An Introduction to Structured Program Design in COBOL
Chapter 14 Sorting and Merging.
Programming in COBOL-85 For IBM Mainframe System 390
Any Questions?.
Programming in COBOL.
Presentation transcript:

Application Program Design Day3

2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Basic CICS programming –Structure of a simple CICS embedded COBOL program –Not to be used COBOL verbs Program Control statements –EXEC Interface Block –Exception handling Creating a run-unit –Translation and options available –Compilation and options available –Linker options –Execution Testing and Debugging –Handle Abends –Native commands like CEMT, CECI, CEBR

3 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Coding COBOL under CICS EXEC interface stubs BMS Screens (Presentation Layer) COBOL – CICS program (Business Layer) BMSVTAM

4 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Not to be used COBOL verbs File I/O statements like –CLOSE, DELETE, OPEN, READ, WRITE, REWRITE, START No File Section and Environment Division required Other statements like –ACCEPT Date/Day/Day-of-week/Time, MERGE, STOP RUN and GO BACK.

5 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Ex.WORKING-STORAGE SECTION. 01 WS-COMMAREA. 02 WS-FLAG PIC X(2). LINKAGE SECTION. 01 DFHCOMMAREA. 02 LK-FLAG PIC X(2). Pseudo - conversational techniques The most important thing is passing of data between pseudo-conversational tasks. We can pass data via a COMMAREA

6 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Pseudo - conversational techniques Return Statements RETURN -1 EXEC CICS RETURN END-EXEC. RETURN -2 EXEC CICS RETURN TRANSID (‘TN01’) TRANSID (‘TN01’)END-EXEC.

7 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Pseudo - conversational techniques Return Statements RETURN -3 EXEC CICS RETURN TRANSID (‘TN01’) COMMAREA (WS-COMMAREA) LENGTH (WS-COMMAREA-LEN) END-EXEC. To get the data back from DFHCOMMAREA MOVE DFHCOMMAREA TO COMMAREA-DATA.

8 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Ex.PROCEDURE DIVISION. A000-MAIN-PARA. EXEC CICS HANDLE CONDITION END-EXEC. IF EIBCALEN = ELSE PERFORM EVALUATE B000-AID-CHK-PARA ENDIF Pseudo - conversational techniques

9 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Ex.B000-AID-CHK-PARA. EVALUATE EIBAID WHEN DFHENTER WHEN DFHPF END-EVALUATE. Pseudo - conversational techniques EVALUATE your populated EIBAID.

10 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 EXEC CICS ASKTIME [ABSTIME(data_area)] END-EXEC. Useful CICS commands EXEC CICS FORMATTIME ABSTIME(data_area) [YYDDD(data_area)] [YYMMDD(data_area)] [YYDDMM(data_area)] [DATESEP(data_value)] [TIME(data_area)] [TIMESEP(data_value)] END-EXEC. EXEC CICS SYNCPOINT END_EXEC.

11 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Exception handling Expected CICS errors –Record not found –Map fail Logical errors –Division by zero –Transaction id error –Illegal character in numeric field Hardware or system errors –Input/output error while accessing files

12 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 CICS commands for exception handling To handle expected CICS errors –HANDLE CONDITION –RESP –The above errors can be ignore by using IGNORE CONDITION or NO HANDLE To handle logical fatal errors –HANDLE ABEND

13 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 HANDLE and IGNORE condition HANDLE CONDITION EXEC CICS HANDLE CONDITION LENGERR (LENGTH-ERR-PARA) INVREQ (INVREQ-ERR-PARA) DUPKEY (DUPKEY-ERR-PARA) ERROR (GEN-ERR-PARA) END-EXEC. IGNORE CONDITION EXEC CICS IGNORE CONDITION LENGERR END-EXEC.

14 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 NOHANDLE and HANDLE ABEND NOHANDLE EXEC CICS RECEIVE INTO (IN-DATA-BUF) LENGTH (20) NOHANDLE END-EXEC. EXEC CICS HANDLE ABEND LABEL (abend-handle-para) END-EXEC. HANDLE ABEND

15 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 RESP code handling WORKING-STORAGE SECTION. 01 WS-RCODE PIC S9(8) COMP PROCEDURE DIVISION EXEC CICS SEND FROM (-----) LENGTH (-----) RESP (WS-RCODE) END-EXEC. IF WS-RCODE = DFHRESP (LENGERR) PERFORM LENGTH-ERROR-PARA-0100.

16 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Creating a run unit The CICS translator –Converting CICS code into the language in which rest of the program is coded –If EXEC SQL is used, additional steps to translate SQL s/ms and bind is required –EXEC commands are translated to CALL s/ms –One input SYSIN and 2 output SYSPUNCH and SYSPRINT

17 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Creating a run unit contd., Compiler options –AMODE(31), RMODE(ANY) –Ex : //LINKEDIT EXEC PGM=HEWL, PARM='XREF,RMODE=ANY,AMODE=31' –AMODE(24), RMODE(24) –Ex : //LINKEDIT EXEC PGM=HEWL, PARM='XREF,RMODE=24,AMODE=24'

18 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Compilation of Cobol-CICS program

19 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Testing and Debugging Abend Control Commands EXEC CICS HANDLE ABEND PROGRAM (name) LABEL (label) CANCEL RESET END-EXEC EXEC CICS ABEND ABCODE(‘9999’) END-EXEC

20 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Native CICS Commands - Recap CESN – to sign on CESF – to sign off CECI – Command level Interpreter CEBR – Temporary Storage Browse CEMT – Enhanced Master Terminal CEDF – Execution Diagnostic facility

21 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Step 1: Open a tso session. Step 2: Create a new PDS. Step 3: Code the following program in a new member. CICS Hello World! Program Development

22 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Step 4: Compile the program using the clist TRNGCICS CICS Hello World! Program Development

23 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Step1: Open an Client session for Mainframe, type CICS3 and hit ENTER key. Enter your User id and Password and press the Enter Key. Execution of Hello World! Program

24 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Step 2: You’ll find a blank screen as shown below. Type the transaction-id. To Sign off, use the transaction CESF Execution of Hello World! Program

25 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Step 5: Open a CICS Session. Step 6: Install the program using the command CEMT SET PROG(program-name) NEW. Step 7: Associate a transaction-id with the program in PCT Note that transaction-ids are unique in the system. CICS Hello World! Program Development

26 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Summary What are the not to be used COBOL verbs? What is used to store and retrieve information in pseudo-conversational programs? Ways of ending a task without ending the transaction How do we know if the program has been entered for the first time? How do we know what key is pressed? How do we do a commit or save changes in CICS? Different ways of exception handling How do we create a run unit in CICS? What are the Native CICS commands? Hello World Program (COBOL-CICS) development.

27 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Thank You!