You are on page 1of 136

In a batch program, often the required input/output and work areas are defined within the program

and the program reads its own input data

In an online system, often input/output and work areas are allocated by the system itself, as needed and the system reads the data on behalf of its application programs

Functionally the above products are compatible with each other, with certain exceptions caused by the differences among their corresponding operating systems.

Like an OS controls the jobs within a computer, so does CICS, the transactions (application programs) within a single CICS job CICS runs under the control of the OS To the OS,CICS is a single task, operating in one partition or region of the system A CICS job is submitted to the OS as any other batch job but as a long-running and high priority job submitted to the OS as any other batch job

Cuts down the total amount of programming needed provides on environment (control services) for the execution of application programs Supports a network of hundreds of terminals simultaneously Includes interfaces to files and database products

To make the best use of the time and system resources that the OS gives to CICS, it takes on itself some of the aspects of an OS Doesn’t duplicate all of the services provided by the OS and in fact, asks the underlying OS to serve its tasks, as and when required. control system that acts as an interface between the OS and the application manages the data, terminals and application program and provides

control services for online processing

Preprocesses the application source code and translates CICS commands into CALL statements in the language of the application program Verifies the syntax of a CICS command and executes it * Step by step interactive execution of cics application program Provides facilities to debug and monitor application programs Writers specific areas of main storage to a sequential dataset

Provides the application programs with time- controlled functions

Provides functions to govern the file processing activities of application programs

Provides functions to govern the flow of application programs

Provides function to control resources and synchronize task activity

Adding Martina’s record to a payroll file – single ‘Add’ transaction All the additions made to the file – ‘Add’ transaction

Adding a new personnel record Modifying payroll information Inquiring on the status of account Deleting an item from inventory

1 2 3 4 5 6 7 8 9 10

To modify a record from an account file perform: Display menu screen Wait for response] Receive menu screen Read the subject record from the account file Display the record in formatted form Wait for the user to enter changes Receive the changes Write changes to the printed log Update the account and index files accordingly Redisplay the menu screen

To Modify a record from an account file perform: 1 Display menu screen 2 Wait for response] 3 Receive menu screen 4 Read the subject record from the account file 5 Display the record in formatted form 6 Wait for the user to enter changes 7 Receive the changes 8 Write changes to the printed log 9 Update the account and index files accordingly 10 Redisplay the menu screen Note The steps 2 and 6 of the4 conversational transaction have disappeared During these wait states the program is released from the main storage and CICS takes care of reading the input when the user gets around to sending it

Constants in Working Storage Variables in Dynamic Working-Storage Restriction on program alteration

A task (A) which uses a program has exclusive use of the CPU resource. Another task (B) which tries to use the same program, interrupts the OS. At the interruption time (in between two OS interrupt points) in the program, the OS suspends from task (A) after saving its status. If then executes the other task (B) which also uses the same program. For both the tasks (I.e.A and B) to use the same program, the program should be reentrant.

A task (A) which uses a program has exclusive use of the CPU resource. Another task (B) which tries to use the same program interrupts CICS. At the interruption time in the program (in between two CICS calls), CICS suspends from task (A) after saving its status. It then executes other task(B) which also uses the same program. For both the tasks (I.e A and B) to use same program it should be reentrant.

The terminal operator enters a TRANSID in order to start a transaction the TRANSID is matched against the PCT to determine if it is a valid entry.

PCP knows if there are any tasks currently using the same program form the value of counter Example If use counter is 2 then two users are using the same program If use counter is zero then the corresponding program is released from main memory

Example The CICS sign-on screen

The above screen has a number of fields, although only three of the characters are displaying the data * The first field is protected – I.e. the terminal operator cannot type over that area of the screen * * The second field is also protected The third field ------is unprotected- I.e. the user can type in that area In the above screen this fields 20 positions long (even though it is not visible)

The fourth field is known as the Stopper field (not visible) Its function is to stop the user from keying more than 20 characters into the same field There is no data in this field, but is protected and the keyboard is locked thus preventing the user from keying in more than 20 characters into the third field Hence every field has the following control information: Encoded Screen Address shows the position of the particular field on the screen Control Information shows the field is about to begin Control Information describes the display attributes of the field Data contains the field’s value to be displayed The above control information for the first field: Encoded Screen Address Row 1, Col 1 Control Information The field begins here Control Information High Intensity, Protected Data CESN – CICS/VS SIGNON – USERID AND PASSWORD

Code CNTL=FRSET in DFHMSD or DFHMDI Code ATTRB=(FSET,…) in all the DFHMDF macros, from which the application program expects to receive data regardless of whether they are input fields or output fields

MAPONLY DATAONLY

PROCEDURE DIVISION EXEC CICS HANDLE CONDITION ERROR (ERROR-MESSAGVE) END-EXEC. HANDLE-PARAGRAPH-1. EXEC CICS HANDLE CONDITION LENGERR(LENERR-PARA-2) END-EXEC. HANDLE-PARAGRAPH-2 EXEC CICS HANDLE CONDITION LENGERR(LENERR-PARA-2) END-EXEC HANDLE-PARAGRAPH-3 EXEC CICS HANDLE CONDITION LENGERR END-EXEC Any length errors in HANDLE-PARAGRAPH –1 would cause a transfer of control to LENERR-PARA-1 Any length errors in HANDLE-PARAGRAPH –2 would cause a transfer of control to LENERR-PARA-2 * HANDLE-PARAGRAPH-3would turn off the LENGERR condition causing the program to default to the ERROR condition and to be directed to the ERRORMESSAGE paragraph, if an LENGERR condition occurred * If a length error occurred after HANDLE-PARAGRAPH-3 turned off the LENGERR condition and if the HANDLE-ERROR condition was absent, the program would ABEND

EXEC CICS

HANDLE AID PF3 (END-ROUTINE) PA1(CANCEL-ROUTINE) ENTER(NORMAL-ROUTINE) ANYKEY(WRONG-KEY-ROUTINE) RECEIVE MAP(‘FORM000’) MAPSET(‘FORM001’)

END-EXEC EXEC CICS

END-EXEC At the end of the RECEIVE map command the control will be transferred to the appropriate routine based on the key pressed, for which the routine is actually specified before the RECEIVE MAP command

EXEC CICS

END-EXEC EXEC CICS

HANDLE AID PF1 PF2 PF3(END-ROUTINE) ENTER(NORMAL-ROUTINE) ANYKEY(WRONG-KEY-ROUTINE) RECEIVCE MAP(‘FORM000’) MAPSET(‘FORM001’)

END-EXEC At the end of the RECEIVE map command, the control will be transferred to END-ROUTINE, if any of the PF1, PF2, PF3 keys is pressed.