The first VSAM file V1 has 2 fields A and B . There is a
DB2 file which has fields E and f. We need the fields A,
B , E and F to another VSAM file called V2. Kindly mention
the logic in procedure division in cobol..

Answers were Sorted based on User's Feedback



The first VSAM file V1 has 2 fields A and B . There is a DB2 file which has fields E and f. We nee..

Answer / rookie

I suppose the question is a bit confusing....DB2 deals in
table's and has records...

Open VSAM file and read the records into WS variables,
Fetch DB2 records in host variables
Now write them to file V2.

Is This Answer Correct ?    2 Yes 0 No

The first VSAM file V1 has 2 fields A and B . There is a DB2 file which has fields E and f. We nee..

Answer / anoop

One methode is we can first repro the VSAM file into
sequential file and then SORT it into another sequential
file to include only A and B fileds. Then repro it again
into the VSAM file V2.

In cobol open this file in I-O mode and read it sequentialy
and move A & B fileds to a working storage variable.

Read the field E & F from data base and A & B from the
working storage and populate into the V2 VSAM file.

There could be some changes in the logic as per the exact
requirement.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VSAM Interview Questions

What is IDCAMS? and what is the purpose of it?

4 Answers  


Is it slower if you access a record through alt index as compared to primary index?

1 Answers  


what do you mean by the cobol record key clause in vsam?

1 Answers   IBM,


On which datasets You can have ALT INDEX?

2 Answers  


Explain the difference between lds and esds?

1 Answers  


Explain the significance of the shareoptions parameter?

1 Answers  


How do you calculate record size of an alternate cluster? Give your values for both unique and nonunique.

1 Answers   IBM,


How to get the last record in vsam file in cluster? And how can u get the ksds file records into cobol program?

1 Answers  


Yes. Because the alternate key would first locate the primary key, which in turn locates the actual record. Needs twice the number of I/Os.

1 Answers  


In the COBOL SELECT statement what is the ORGANIZATION for a KSDS?

4 Answers  


what do you mean by the repro command?

1 Answers   IBM,


What are all the ways we can create datasets?

7 Answers   IBM,


Categories