Interview Questions

Code a program meeting the following requirements.

CICS Interview Questions


(Continued from previous question...)

Code a program meeting the following requirements.

Q: 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 thress (Single PCT and PPT).


EMPLOYEE INFORMATION FORM
EMP ID: XXX
EMP NAME:
EMP DESIG: SEX
SALARY:
STATUS:
EXIT: X
X- Input Field
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. 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).



AN: 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(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 IFINPVAL= 'SEC'
EXEC CICS RECEIVE
MAP('EMPFORM')
MAPSET('EMPFORM')
END-EXEC
EXEC CICS READ
DATASET("EMPINFOR')
INTO("EMP-IOAREA)
RIDFLD(IMPIDI)
LENGTH(LEHGTH-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-ANME 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')
ERASE
END-EXEC.
MOVE 3 TO LENGHT-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

(Continued on next question...)

Other Interview Questions