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
In COBOL programming, what is PERFORM? What is VARYING?
how to refer the data field?
What are the different data types in cobol?
A table has two indexes defined. Which one will be used by the SEARCH?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
What is amode(24)?
State the various causes of s0c1, s0c5 and s0c7.
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
What the difference is between continue and next sentence?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
What are the different rules to perform a Search?
what is the use of outrecord?
How many bytes S(8) comp field occupy and its maximum value?
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?
How do define dynamic array in cobol.