1 / 27

Application Program Design

Application Program Design. Day3. 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

lindsay
Télécharger la présentation

Application Program Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Application Program Design Day3

  2. 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. BMS Screens (Presentation Layer) BMS VTAM COBOL – CICS program (Business Layer) Coding COBOL under CICS • EXEC interface stubs

  4. 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. Pseudo - conversational techniques • The most important thing is passing of data between pseudo-conversational tasks. • We can pass data via a COMMAREA Ex.WORKING-STORAGE SECTION. 01 WS-COMMAREA. 02 WS-FLAG PIC X(2). LINKAGE SECTION. 01 DFHCOMMAREA. 02 LK-FLAG PIC X(2).

  6. Pseudo - conversational techniques Return Statements • RETURN -1 EXEC CICS RETURN END-EXEC. • RETURN -2 EXEC CICS RETURN TRANSID (‘TN01’) END-EXEC.

  7. 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. Pseudo - conversational techniques Ex.PROCEDURE DIVISION. A000-MAIN-PARA. EXEC CICS HANDLE CONDITION END-EXEC. IF EIBCALEN = 0 ---------- ELSE PERFORM EVALUATE B000-AID-CHK-PARA ENDIF

  9. Pseudo - conversational techniques • EVALUATE your populated EIBAID. Ex.B000-AID-CHK-PARA. EVALUATE EIBAID WHEN DFHENTER --------------- WHEN DFHPF1 --------------- END-EVALUATE.

  10. Useful CICS commands EXEC CICS ASKTIME [ABSTIME(data_area)] END-EXEC. 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. 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. 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. 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. NOHANDLE and HANDLE ABEND • NOHANDLE EXEC CICS RECEIVE INTO (IN-DATA-BUF) LENGTH (20) NOHANDLE END-EXEC. • HANDLE ABEND EXEC CICS HANDLE ABEND LABEL (abend-handle-para) END-EXEC.

  15. 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. 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. 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. Compilation of Cobol-CICS program

  19. 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. 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. CICS Hello World! Program Development Step 1: Open a tso session. Step 2: Create a new PDS. Step 3: Code the following program in a new member.

  22. CICS Hello World! Program Development Step 4: Compile the program using the clist TRNGCICS

  23. Execution of Hello World! Program Step1: Open an Client session for Mainframe, type CICS3 and hit ENTER key. Enter your User id and Password and press the Enter Key.

  24. Execution of Hello World! Program Step 2: You’ll find a blank screen as shown below. Type the transaction-id. To Sign off, use the transaction CESF

  25. CICS Hello World! Program Development 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.

  26. 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. Thank You!

More Related