SQL doesn't place a lock on the file.  I've used insert, update and delete 
with SQL while the files have been locked via programs lots of times with 
no issues.
Thanks,
Tommy Holden
From:
Jonathan Mason <jonathan.mason@xxxxxxxxxxxxxxxx>
To:
midrange-l@xxxxxxxxxxxx
Date:
02/27/2008 08:26 AM
Subject:
Alternative to CPYF that doesn't apply a lock
Hi List
We have a program that makes use of the CPYF command to copy data from a 
work file in QTEMP to a corresponding file in our data library. 
Depending on the file being used there can be upwards to 100,000 records 
being copied which is starting to cause a problem as the CPYF applies a 
lock to the file being copied into.
The help text describes the restriction as:
 
     o  During the time a CPYF request is run, the file specified for
        the To file (TOFILE) parameter may be locked (similar to an 
        *EXCL lock with no timeout) so that no access is possible. 
Because the file is locked this is causing other programs to fail 
CPF4128 and RPG1216 errors.  I am thinking about putting in a change to 
use an SQL insert instead of the CPYF and was wondering if anybody knows 
whether or not using SQL would apply a lock to the receiving file.
Thanks in advance
Jonathan
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.