Dear Miguel
Try using IBM i service (from Run SQL Script tool session) to check if there is any job(s) locking the file.
SELECT JOB_NAME, PATH_NAME, CHECKED_OUT, CHECKED_OUT_USER_NAME (and any other columns you want) FROM TABLE(QSYS2.IFS_OBJECT_LOCK_INFO(PATH_NAME => '/myfile/test1.txt'))
More info about the service here: IFS_OBJECT_LOCK_INFO table function at https://www.ibm.com/docs/en/i/7.4.0?topic=services-ifs-object-lock-info-table-function
There is also the service IFS_OBJECT_STATISTICS table function to see more attributes of stream files in IFS.