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

How to increase the logical record length of existing PS file?

7 Answers  


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

2 Answers   IBM, Steria,


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  


What are various search techniques in cobol? Explain.

0 Answers  


Differentiate COBOL and COBOL-II?

0 Answers  






What are literals?

0 Answers  


consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error

6 Answers   ABCL, TCS,


Explain fixed length record in cobol? with suitable example

1 Answers   IBM,


What is rmode(24)

0 Answers  


What should be the sorting order for SEARCH ALL?

5 Answers  


what is soc7 abend?how u can trace it?

4 Answers   Accenture,


how will u code parm parameter and where pls ?

3 Answers   DELL,


Categories