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 soc7 abend?how u can trace it?

4 Answers   Accenture,


can we declare s9(9)v9(9) in cobol ? if yes how many bytes it will occupy ?(urgent plz answer it)

13 Answers   CTS,


record length in spool?

2 Answers   Infosys,


level number 77 is used to define a)group data b)elementary data c)redefine d)none

8 Answers   TCS,


HOW WE WILL SORT THE ARRAY WHICH IS GOING TO USE FOR SEARCH ALL?

2 Answers   Cap Gemini,






what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


what is internal sort and external sort ? which is preferable ?

2 Answers   TCS,


what is the coding difference between COBOL and CICS.

8 Answers   Cap Gemini,


How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?

1 Answers   CTS,


What is the default value of DISP for temp datasets

5 Answers   IBM,


I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.

10 Answers   Mascon,


In an array processing what is the thing that can be done by using subscripts but not by using index

4 Answers   JPMorgan Chase,


Categories