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

The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND

10 Answers   Huawei, IBM, TCS,


How to solve SOC7. I have the cobol coded as below 01 A PIC 9(4). 01 AIN REDEFINES A. 05 AIN1 PIC S9(4) 01 B PIC 9(4)V99. 01 BIN REDEFINES B. 05 BIN1 PIC S9(4)V99. PROCEDURE DIVISION. START-PARA. INITIALIZE A AIN B BIN. ACCEPT A B. DISPLAY 'VALUE OF A=' A. DISPLAY 'VALUE OF B=' B. DISPLAY 'VALUE OF BIN1=' BIN1. DISPLAY 'VALUE OF AIN1=' AIN1. COMPUTE AIN1 = BIN1 - AIN1. DISPLAY 'VALUE OF AIN1=' AIN1. When i'm executing this code i'm getting SOC7 for A = 12 & B=34. Can someone explain SDSF OUTPUT DISPLAY TCOM058R JOB05458 DSID 102 LINE 0 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> CSR ********************************* TOP OF DATA ********************************** VALUE OF A=12 VALUE OF B=34 VALUE OF BIN1=34 VALUE OF AIN1=12 CEE3207S The system detected a data exception (System Completion Code=0C7). From compile unit PROG1 at entry point PROG1 at statement 29 at compile +000004CE at address 00007ECE. Please address how to solve this issue Thanks in advance.

1 Answers  


i want to enter the name 'pandu' into ur table how?

1 Answers   Fidelity,


What is comp-1 and comp-2?

0 Answers  


TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr

1 Answers   MNC,






what are the control characters used in reports

1 Answers  


what will be the output when a)pic 9(6)value 000178 is moved to pic ***,***. b)pic 9(5) value 57397 is moved to pic $$,$$9.

5 Answers  


how many times PARA-A is performed : PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1 UNTIL TIMES-COUNTER >0 PARA-A MOVE P TO Q MOVE H TO TIMES COUNTER a.10 b.1 c.11 d.0

4 Answers   TCS,


Define static linking and dynamic linking.

0 Answers  


how would you resolve sb37 and SE37?

2 Answers   Hewitt,


What type of Call you would use if you don;t want the control back to the calling program?

8 Answers   TCS,


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


Categories