RPG (IBM i / AS/400) · File status code
What does Status Code 01217 mean in RPG (IBM i / AS/400)?
An explicit OPEN or CLOSE operation failed, commonly because the file, member, or device doesn't exist, the user lacks authority to it, or it's already held *EXCL by another job.
An explicit OPEN or CLOSE operation failed, commonly because the file, member, or device doesn't exist, the user lacks authority to it, or it's already held *EXCL by another job.
Use the E extender or a MONITOR block around the OPEN/CLOSE and inspect %STATUS/%ERROR to get the real cause, then confirm the object exists, isn't exclusively locked elsewhere, and the profile has the needed authority.