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 default value of DISP parameter?

3 Answers   IBM,


subscript and index r not coded in u r application program what will happen?

2 Answers  


db2 variable decimal(15,2) what is the equalent size of cobol variable

2 Answers   Syntel,


how do you reference the ksds vsam file formats from cobol programs

0 Answers  


why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,






What is the use of intialize verb?

0 Answers  


How do you define a variable of comp-1 and comp-2?

0 Answers  


If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and will there be any error becoz of the Negative value

3 Answers   CTS,


How you can read the file from bottom?

0 Answers  


What do you understand by psb and acb?

0 Answers  


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

0 Answers  


Categories