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
What is difference between static and dynamic call in cobol?
What is the difference between goback, stop run and exit program in cobol?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What are the rules of the move verb?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
how do you reference the fixed unblock file formats from cobol programs
What are the cobol coding sheets?
Name the divisions, which are available in a cobol program?
Write a cobol program making use of the redefine clause.
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
how to move the records from file to array table. give with code example
How do you reference the fixed block file formats from cobol programs
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?