Re: Cobol internal SORT causes changes in fields




ddd.best@xxxxxxxxx wrote:

My Records can have the same key, but last field in record has varying
length, and while sorting -the entry which has the longest value in it
is copied to other entries that has shorter values.

What controls the 'varying' ? For example does the data file have:

HS-Number PIC X OCCURS 1 TO 16 DEPENDING ON something.

and is the 'something' in Working-Storage ?

The problem is that the sort file does not match this and so the
shorter records are not overwriting the longer records. You should
make the sort file match the FD better.

Alternately use an input procedure and set up the varying data areas
yourself.

.