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

Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?

12 Answers   T systems, Tech Mahindra,


Mention the guidelines to write a structured cobol program?

0 Answers  


In a program, variables are used but no DB2 involved in it. Can you call it as host variables??

4 Answers   EDS,


What is the difference between CALL BY VALUE and CALL BY CONTENT?

7 Answers  


Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY 'MAIN-PARA' PERFORM SECTION-A. STOP RUN. SECTION-A. PARA-A1. DISPLAY 'SECTION A PARA A1'. PARA-A2. DISPLAY 'SECTION A PARA A2'.

4 Answers  






01 a pic 9(6) value is 123456 01 b pic 9(3) move a to b wht will be the value ?

6 Answers   Patni,


We have 3 programms A,B,C.In the middle of the program A the controls goes to program B and in the middle of the program B control wants to go program C,after completion of program C again control comes to program B and again after completion of program B control comes to program A.How the process will takes and what are the controls we use for that process.If it is possible anybody of you explain with example?

5 Answers   IBM,


RENAME clause takes new SPACE in memory.TRUE or FALSE? a)TRUE 2)FALSE

12 Answers   TCS,


Can JUSTIFIED be used for all the data types?

3 Answers  


I want ALL ERROR codes in VSAM

3 Answers   American Express, TCS,


which one is better among static call and dynamic call?

3 Answers  


What is the use of EVALUATE statement?

4 Answers   Tesco,


Categories