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
For rewrite, why is it mandatory that file needs to be opened?
how to refer the data field?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
What are the different open modes available in cobol?
Whats the difference between search & search ALL?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
What is amode(31)
how to access the file from prodution from changeman tool and to submit a file to production
) How do u handle errors in BMS macro?
How to know whether the module is dynamical or statistical?
what is amode(24), amode(31), rmode(24) and rmode(any)?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.