I had 100 records and i want to execute last three records by
using cobol programming?what will be coding?

Answers were Sorted based on User's Feedback



I had 100 records and i want to execute last three records by using cobol programming?what will be..

Answer / farid

In jcl we can do as follows.........

1st skip the 97 recordes and write rest 3 into another file
using sort utilities(with the help of jcl).now cobol program
can use the 2nd file which has only last 3 records

Is This Answer Correct ?    6 Yes 0 No

I had 100 records and i want to execute last three records by using cobol programming?what will be..

Answer / atul

Using Short card you can write the last 3 records.
Short card as :

SORT FIELDS=COPY SKIPREC=97 STOPAFT=03


It will copy the last three records and put it in a file.

Cobol program can use this file containing records.

Is This Answer Correct ?    2 Yes 0 No

I had 100 records and i want to execute last three records by using cobol programming?what will be..

Answer / sandip

In cobol apply counter while reading file if counter reach at 97 start writing record to another file.

Is This Answer Correct ?    2 Yes 0 No

I had 100 records and i want to execute last three records by using cobol programming?what will be..

Answer / harsha

Read file sequentially and load it in table. keep check on
the number of ocurances(i.e. number of records).

Once the table is fully loaded, you know the total
occurances. Say it is X. Now read the table with occurance
X-3

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More COBOL Interview Questions

What is the maximum length of a field you can define using COMP-3?

4 Answers   Complex System, Infosys,


When the working storage variables get allocated? a.At Compile time b.At starting of the run time c.At end of the run time. d.None of these

6 Answers   Wipro,


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

0 Answers  


in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?

2 Answers   HSBC,


what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,






what are difference organizations in cobol and access mode in cobol? can you expalin what organization means while declaring for ksds,esds,rrds?

1 Answers   HCL,


What is the difference between Structured COBOL Programming and Object Oriented COBOL ?

1 Answers  


Difference between cobol and cobol-ii?

0 Answers  


What is Alternate Index ? How is it different from regular index ?

2 Answers  


What is the difference between COMP & COMP-3 ?

2 Answers  


how to crack cts interview apps? NOVEMBER 21 2010

2 Answers   CTS,


1.What is the default print format in cobol?

5 Answers   HSBC,


Categories