sample code for read a 2nd record from last in flatfile how
can do?
Answer Posted / abhijit
Suppose file has 100 Record
1,2,3.........................100
a) Read the file and Count the number of records into a variable
Suppose CNT_VAR = 100
b) Suppose you want to read 2nd record from Last
So Set N = 2
c) Now to find the search variable compute the below
SRC_VAR = CNT_VAR - N i.e (100 - 2)
SRC_VAR = 98
d) Now Read the file to pick 98th record from top
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Why occurs cannot be used in 01 level in COBOL?
When is inspect verb is used in cobol?
How can you get the ksds file records into your cobol program?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
How do we get current date from system with century in COBOL?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
How you can read the file from bottom?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What are the various section in data division and briefly explain them.
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is the difference between binary search and sequential search?
Can you please let me know the centre name of INS certification in Kolkata.
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
Write down the divisions of cobol program?
Write a program that uses move corresponding.