Page 2 of 2

Re: Check the file sorted or not!

PostPosted: Wed Dec 19, 2012 3:35 am
by dick scherrer
Hello and welcome to the forum,

No one here minds that you are a beginner - indeed, beginners/students are the reason this forum exists.

We do mind when someone asks the forum to do their work for them. We are most willing to help, but Not do your (home)work for you.

we can do it by reading the file, like for example we will read 1st record and then we will compare it with the other next records, if the 1st record is greater then the next record then we will display 'records are not in ascending order' or viceversa.
You have just "written" the program. Now, all you have to do is convert this to COBOL syntax.

When you get stuck, post what you have tried and what needs clarification.

Re: Check the file sorted or not!

PostPosted: Wed Dec 19, 2012 6:24 pm
by BillyBoyo
If, as abatch job you want to check a file is in sequence, use MERGE with one input file, specifying the desired key. The job will fail if not in sequence.