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 the LINKAGE SECTION used in COBOL?
IF I mention stop run in CICS what happens?
Explain about different table spaces.
what is s000 u4087 error? please give the all error codes in cobol,jcl.
What is amode(24)?
Write a cobol program making use of the redefine clause.
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
Why would you use find and get rather than to obtain?
What is the difference between Call and a Link?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is a scope terminator give example?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the use of intialize verb?
What are 77 levels used for?