FAQs(31 to 45)

31) Code the related portions of CICS/COBOL-I programs to gain addressability to TWA area assigned to a

particular task. Assume that the size of TWA area is 300 bytes. What are the advantages if COBOL-II is used

in the place of COBOL? Code the above requirement in COBOL-II.

A)

COBOL- II PROGRAM

LINKAGE SECTION.

01 PARMLIST.

02 FILLER PIC S9(8) COMP.

02 TWA-PTR S(98) COMP.

01 TWA-DATA-LAYOUT.

02 DATA-AREA PIC X(300).

PROCEDURE DIVISION.

???.

EXEC CICS ADDRESS

TWA(TWA-PTR)

END-EXEC

SERVISE RELOAD TWA-DATA-LAYOUT.

COBOL- II PROGRAM

LINKAGE SECTION.

01 TWA-DATA-LAYOUT.

05 DATA-AREA PIC X(300).

PROCEDURE DIVISION.

???.

EXEC CICS ADDRESS

TWA(ADDRESS OF TWA-DATA-LAYOUT)

END-EXEC

???

32) Code a program meeting the following requirements.

?EMPS? is a transaction used to return information pertaining to an employee when the ?EMPID? is entered on the screen. The information pertaining to an employee is present in a VSAM/KSDS dataset registered in FCT as ?EMPINFOR?. The map and the working storage section of the emp-info are given for reference. If the employee id is found the information has to be sent to the screen (Status field) with the message ?Emp Id: XXX found.?. If the emp-id key is not found then status field should array the message ?Key not found.? and the ?EMP ID? field should be set to bright. If the Exit option is set to ?Y? then the task has to terminated. Use pseudo-conversation technique three (Single PCT and PPT).

EMPLOYEE INFORMATION FORM

EMP ID : XXX

EMP NAME : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

EMP DESIG : @@@@@ SEX : @

DEPARTMENT : @@@@@@@@@@

SALARY : $$$$$$$

STATUS : @@@@@@@@@@@@@@@@@@@@

EXIT : X

X - Input Field

@ - Output field (Alphanumeric)

$ - Output field (Numeric)

Mapname - EMPFORM

Mapsetname - EMPFORM

Label given to various ?named? fields on the DFHMDF macro while  defining the map shown above.

EMPID, EMPNAME, EMPDESIG, DEPART, SEX, SALARY, STATUS and EXITINP.

Structure of the VSAM/KSDS file.

Working-Storage Section.

01 EMP-IOAREA.

05 EMP-REC.

10 EMP-KEY PIC XXX.

10 EMP-NAME PIC X(32).

10 EMP-SEX PIC X.

10 EMP-DEPT PIC X(10)

10 EMP-DESIG PIC X(5).

10 EMP-SAL PIC 9(7).

A) COBOL-II PROGRAM.

WORKING-STORAGE SECTION.

77 LENGTH-OF-AREA PIC S9(4) COMP.

77 WS-RCODE PIC S9(8) COMP.

01 STATUS.

02 NORMAL.

05 FILLER PIC X(8) VALUE ?EMP ID: ?.

05 EMP-ID PIC X(3).

05 FILLER PIC X(6) VALUE ?FOUND?.

02 ABNORMAL REDEFINES NORMAL.

05 ABMSG PIC X(17).

01 EMP-IOAREA.

05 EMP-REC.

10 EMP-KEY    PIC XXX.

10 EMP-NAME   PIC X(32).

10 EMP-SEX    PIC X.

10 EMP-DEPT PIC X(10)

10 EMP-DESIG PIC X(5).

10 EMP-SAL PIC 9(7).

LINKAGE SECTION.

01 DFHCOMMAREA.

05 INPVAL PIC X(3).

PROCEDURE DIVISION.

???..

IF EIBCALEN=0

EXEC CICS SEND

MAP(?EMPFORM?)

MAPSET(?EMPFORM?)

ERASE

END-EXEC.

MOVE 3 TO LENGTH-OF-AREA

EXEC CICS RETURN

TRANSID(?EMPS?)

COMMAREA(?SEC?)

LENGTH(DATA-VALUE)

END-EXEC.

ELSE IF INPVAL = ?SEC?

EXEC CICS RECEIVE

MAP(?EMPFORM?)

MAPSET(?EMPFORM?)

END-EXEC.

EXEC CICS READ

DATASET(?EMPINFOR?)

INTO(EMP-IOAREA)

RIDFLD(EMPIDI)

LENGTH(LENGTH-OF-AREA)

RESP(WS-RCODE)

END-EXEC.

IF WS-RCODE NOT = DFHRESP(NORMAL)

MOVE ?KEY NOT FOUND? TO ABMSG?

MOVE DFHBMBRY TO EMPIDA

ELSE

MOVE EMP-NAME TO EMPNAMEO

MOVE EMP-SEX TO SEXO

MOVE EMP-DESIG TO EMPDESIGO

MOVE EMP-SAL TO SALARY

MOVE EMP-DEPT TO DEPARTO

MOVE EMP-KEY TO EMP-ID

MOVE STATUS TO STATUSO.

EXEC CICS SEND

MAP(?EMPFORM?)

MAPSET(?EMPFORM?)

ERASE

END-EXEC.

MOVE 3 TO LENGTH-OF-AREA

EXEC CICS RETURN

TRANSID(?EMPS?)

COMMAREA(?SEC?)

LENGTH(LENGTH-OF-AREA)

END-EXEC. 

EXEC CICS RETURN

END-EXEC.

ELSE IF (EXITINPI NOT = ?Y?)

EXEC CICS RETURN

END-EXEC.

33) What does ?Pseudo Conversational? mean?

A) The programming technique in which the task will not wait for the end-user replies on the terminal. Terminating the

task every time the application needs a response from the user and specifying the next transaction to be started when

the end user press any attention key (Enter, PF1 through PF24, PA1,PA2 and Clear) is pseudo-conversational

processing.

34) Explain the means of supporting pseudo conversation programming. (E.g. Storing and restoring of states,

control flow, error handling)

A) When we send a map using SEND MAP command. Immediately we release the program by using EXEC

CICS RETURN command. In this command we mention the TRANSACTION ID which is to be executed

after receiving the map. In this command we also specify the data that should be stored in

COMMUNICATION AREA for later use. When this command is executed the corresponding program is

released from the memory. After receiving the response from the terminal the program is again loaded and this

time the data which we stored in communication area will be copied into the working storage section. And

the map will be received with RECEIVE MAP command.

The variable EIBCALEN in EIB holds the length of communication area. In procedure division we checks the value of EIBCALEN If it is zero, we first send the map followed by RETURN command. Otherwise, that is if EIBCALEN is not zero, we know that this transaction is not running first time and we receive the map by using RECEIVE MAP command.

35) What is the function of the CICS translator?

A) The CICS translator converts the EXEC CICS commands into call statements for a specific programming language. There are CICS translators for Assembler, COBOL, and PL/1.

36) How can you start a CICS transaction other than by keying the Transaction ID at the terminal?

A) By coding an EXEC CICS START in the application program

1. By coding the trans id and a trigger level on the DCT table

2. By coding the trans id in the EXEC CICS RETURN command

3. By associating an attention key with the Program Control Table

4. By embedding the TRANSID in the first four positions of a screen sent to the terminal.

5. By using the Program List Table

37) What is the purpose of the Program List Table?

A) The Program List Table records the set of applications programs that will be executed automatically at CICS start-up time.

38) What are the differences between and EXEC CICS XCTL and an EXEC CICS START command?

A) The XCTL command transfer control to another application (having the same Transaction ID), while the START command initiates a new transaction ID (therefore a new task number). The XCTL continues task on the same terminal. START can initiate a task on another terminal.

39) What are the differences between an EXEC CICS XCTL and an EXEC CICS LINK command.

A) The XCTL command transfer control to an application program at the same logical level (do not expect to control back), while the LINK command passes control to an application program at the next logical level and expects control back.

40) What happens to resources supplied to a transaction when an XCTL command is executed?

A) With an XCTL, the working storage and the procedure division of the program issuing the XCTL are released. The I/O areas, the GETMAIN areas, and the chained Linkage Section areas (Commarea from a higher level) remain. All existing locks and queues also remain in effect. With a LINK, however, program storage is also saved, since the transaction expects to return and use it again.

41) What CICS command do you need to obtain the user logon-id?

A) You must code EXEC CICS ASSIGN with the OPERID option.

42) What is a resident program?

A) A program or map loaded into the CICS nucleus so that it is kept permanently in main storage and not deleted when CICS goes ?Short On

Storage?.

43) What is EIB. How it can be used?

A) CICS automatically provides some system-related information to each task in a form of EXEC Interface Block (EIB), which is unique to the CICS command level. We can use all the fields of EIB in our application programs right away.

44) What is some of the information available in the EIB area?

A)

I. The cursor position in the map

II. Transaction ID

III. Terminal ID

IV. Task Number

V. Length of communication area

VI. Current date and time

VII. Attention identifier

45) What information can be obtained from the EIBRCODE?

A) The EIBRCODE tells the application program if the last CICS command was executed successfully and, if not, why not.