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

Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY 'MAIN-PARA' PERFORM SECTION-A. STOP RUN. SECTION-A. PARA-A1. DISPLAY 'SECTION A PARA A1'. PARA-A2. DISPLAY 'SECTION A PARA A2'.

4 Answers  


I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.

3 Answers   IBM,


How many maximum number of procedures can we write in one COBOL program?

5 Answers  


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

0 Answers  


i need a small 3d program using inline and outline.

0 Answers  






How do define dynamic array in cobol.

0 Answers  


Explain about different table spaces.

0 Answers  


How can you add a particular field/coloumn in copybook?

3 Answers   ADP, DELL, L&T,


what r the types of perform statement

4 Answers  


What are the pertinent COBOL

0 Answers   IBM,


In the JCL, how do you define the files referred to in a subroutine ?

2 Answers  


What is a SSRANGE and NOSSRANGE?

0 Answers  


Categories