Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

LOCK Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LOCK Problem

    That CPYF needs to create a member lock. The file will need to be available at that time. In general I would avoid using CPYF when the file is in use. Also, I would avoid copying a file with 16 million records in it. Is that standard daily operations? You could replace the CPYF with an SQL statement like... INSERT INTO MYNEWLIB/MYNEWFILE (SELECT * FROM MYOLDLIB/MYOLDFILE) Of course this assumes the destination file is empty. It might run slower than CPYF, I would have to test it to verify that. But it should avoid the lock problem you are having. Anyone else have any thoughts? Kevin

  • #2
    LOCK Problem

    In desparate times, one calls for desparate measures. For CPYF locking problems, I turn to the System/36 utility $COPY. Files can be specified for sharing, and the results are fairly fast. Here is a procedure I call COPYSHR: // IF ?1?/ * 'ENTER INPUT,OUTPUT FILE NAMES' // LOAD $COPY // FILE NAME-COPYIN,LABEL-?1R?,DISP-SHR // FILE NAME-COPYO,LABEL-?2R?,RECORDS-?F'A,?1?'? // RUN // COPYFILE // END Dave

    Comment


    • #3
      LOCK Problem

      What a blast from the past! And probably a good solution!

      Comment


      • #4
        LOCK Problem

        Hi, We are facing a problem with Locking of files. We have big file with more than 16 million records which is under commitment control with LCKLVL(*CHG) , the problem we face is that when the application is accessing this file for update/write operations and during this time if someone tries to copy this file (using CPYF) from one Library to another then all the other operations being done from application program give an error that this file cannot be accessed due to locks on it. If I check the Locks on this file then I see that there is a SHRRD lock on the from file but the Member level locks show a EXCLRD lock on the member. Does anyone have an idea what is happening here. Regards Aseem

        Comment


        • #5
          LOCK Problem

          I have used SQL in the past to clear a file in order to avoid locks (rather then CLRPFM). I embedded the SQL in a rpg program which allows me to override the file to any file I need to clear. This may work well in this situation whereby creating a utility program that will not lock the files. Haven't tried it, but I think it would work. -Steve

          Comment

          Working...
          X