How can I find the maximum value of a field in a file while
reading the file dynamically? without using sort function.
Suppose i have a file with fields Timestamp, description,
teamname, teamnumber.. i have read the file till end and
find the maximun value of timestamp which is not in sorted
order.. can we use function max(timestamp)?



How can I find the maximum value of a field in a file while reading the file dynamically? without ..

Answer / mr.perfect

yes, we can use the function command.

MOVE FUNCTION MAX(timestamp-field) TO WS-TIMESTAMP

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

What is cobol?

0 Answers  


In COBOL "BEFORE" advancing is there or not ?

3 Answers  


What is the Purpose of POINTER Phrase in STRING command in COBOL?

0 Answers   Winsol Solutions,


File status must be checked both while opening and reading the file or only while reading the file?

2 Answers  


What is the difference between comp and comp-3 usage? Explain other COBOL usage?s.

3 Answers   IBM, Xansa,


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,


What is difference between com and com3? Eg. s9(4) so what is the memory it will occupy com and com3.

2 Answers  


Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


A LESS 1200 IF B GREATER 25 MOVE 47 TOC ELSE MOVE 57 TO C IF A GREATER 249 MOVE 67 TO C ELSE NEXT SENTENCE ELSE IF B LESS 67 MOVE 27 TO C What will be the value of C, when A is 137 and b is 25

3 Answers   TCS,


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length

2 Answers   IBM, Wipro,


Which of the following EDITind and PICTURE symbols is to be used if a minus(-) is to appear before the value if the value is -ve and a plus(+) is to appear before the value if the value is +ve? (a) + (b) - (c) + OR (d) It is not possible

7 Answers   TCS,


what is the difference between implicit and explicit scope terminator with example? 

1 Answers  


Categories