Direct access procedures are generally legal only on files opened for direct access. In some cases, procedures apply to keyed access files as well.