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
Answer Posted / 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 View All Answers
How do we get current date from system with century in COBOL?
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
What is the utilization of copybook in cobol?
how do you reference the fixed unblock file formats from cobol programs
What is a report item?
What is amode(24)?
What is the difference between comp and comp-3?
What is the difference between comp and comp-3 usage?
Which division and paragraphs are mandatory for a COBOL program?
What is perform what is varying?
example for sub strings ? and refernce modifications whit output pls
what is the use of outrecord?
Write some characteristics of cobol as means of business language.
Explain how to differentiate call by context by comparing it to other calls?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.