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

Name the sections present in data division.

0 Answers  


What is a scope terminator? Give examples.

2 Answers  


i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL program fail?

12 Answers  


How many variables can be declared in w-s section.?

2 Answers  


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.

0 Answers  






How will you find the currepted records in a file

2 Answers  


How can you add a particular field in copybook?

2 Answers   L&T,


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

3 Answers   IBM, Xansa,


How is sign stored in Packed Decimal fields and Zoned Decimal fields?

6 Answers   ABC, HCL, TCS,


What are differences between COBOL and java ? why we are giving more preference to COBOL ?

3 Answers   TCS,


how many divisions are there in cobol

3 Answers   ADP,


hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a record and if some condition is matched tat particular record must be deletd fom the ps

5 Answers   iNautix,


Categories