Re: Developer Question

Discussion created by ca.portal.admin on Jan 6, 2010

Not true.

In the batch environment, if the next physical page has not been allocated
to your address space and you attempt to move bytes from it, you will get an
addressability error, which is an S0C4. That is why it is recommended that
your sort key variable is at least 256 bytes, even if the key itself is only
1. By defining 256, you avoid the S0C4 when the key falls at the end of the
physical page since the additional storage will force the next page to be
allocated to your address space.

You are correct with respect to CV mode, however, fetch protection only
becomes an issue if you are running CV in, I believe it is called, secure
mode. In this mode, CV will set all pages in the storage pool to have fetch
protection turned on. Then, as a task is dispatched, the task's pages have
the fetch protection attribute turned off as the storage key is changed to
user mode. In normal storage protect mode, CV only changes the key of the
page, not the fetch attribute.

In any case, the warning in the COBOL manual is for exactly what I stated
previously, and as the warning implies, is more probable when the sort key
field is defined in a file's record buffer than when it occurs in a
program's working storage area. It can also be an issue when the sort key
field is in the linkage section as well. In that case, a wise precaution is
to move the sort key from the linkage section variable into a 256 byte
working-storage section prior to using it in a DML verb.