I hv ten records in ps file and i hv say some 15 records in
vsam file .i hv empno and age in ps file n
empno,empname,dept n desig in vsam file. i hv 2 read the ps
file n check wid matching empno in vsam file and then
insert all fields from ps and vsam into db2 table....plz
help in writin the procedure division



I hv ten records in ps file and i hv say some 15 records in vsam file .i hv empno and age in ps fi..

Answer / vaneesh

File FD for PS
01 PS-FILE
05 PS-EMP-NO
05 PS-EMP-AGE
File FD for VSAM
01 VSAM-FILE
05 VSAM-EMP-NO-------->RECORD KEY
05 VSAM-EMP-NAME
05 VSAM-EMP-DEPT
PROCEDURE DIVISION

PERFORM UNTILL END OF PS FILE
READ PS FILE

READ VSAM-FILE KEY IS PS-EMP-NO
IF VSAM-FILE-STAUTS = '00'

EXEC SQL
INSERT INTO TABLE EMPLOY WITH VALUE 'PS-EMP-NO', 'PS-EMP-
AGE', 'VSAM-EMP-NAME' 'VSAM-EMP-DEPT'
END-EXEX
END-PERFORM.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More COBOL Interview Questions

Wat is the difference between NEXT and CONTINUE statement in cobol,can any one explain with example.

11 Answers   Deloitte,


describe 805 error

6 Answers   DELL,


what is srange and nosrange pls reply to ths question ?

2 Answers   L&T,


Give some advantages of REDEFINES clause?

2 Answers   Syntel,


State the various causes of s0c1, s0c5 and s0c7.

0 Answers  






What is a subscript ?

3 Answers  


wht is packed decimal in cobol

2 Answers  


What is the local-storage section?

0 Answers  


What is the Importance of GLOBAL clause According to new standards of COBOL?

2 Answers   Infosys,


what are the working storage fields in BMS macro?

2 Answers   IBM,


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,


what are the diferences b/w sub-script and index?

4 Answers  


Categories