Power

 View Only
  • 1.  Backup of PF & LF

    Posted Mon January 20, 2025 12:56 AM

    Hi,

    I have a library containing various object types such as CLP, PGM, DTTARA, AUTL, PF, LF, etc. I need to back up this library and restore it on a new machine. However, the library contains thousands of physical files (PF), and during the restore process on the target system, I need to manually clear all the data in these PFs, which is time-consuming.

    Is there a way to take a backup of the library without including the data in the physical files (PFs), so that only the structure of the PFs is restored on the target system? This would significantly reduce the time and effort required during restoration.

    Looking forward to your guidance.



    ------------------------------
    Nadeem Ahmed Farooqui
    ------------------------------


  • 2.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 01:33 AM
    I haven't tested or tried this but it might work....

    On your system where you want to save the library:
    1. Create and empty duplicate library
    2. Create a user option in PDM to use the CRTDUPOBJ command with DATA(*NO)
    3. Use this option to duplicate the objects from the original library to the new library
    The new library should then have all the same objects as the original library with empty PFs.

    Regards,



    Lars Kjaersgaard  ·  
    Senior Systems Engineer

    Truis Pty Ltd  ·   1800 777 111  ·  NZ 09 307 0520
    144 Bluestone Circuit, Seventeen Mile Rocks, QLD 4073 Australia
    T  +61 7 3710 5000  ·   +61 7 3710 5043  ·    +61 421 998 113
    E
      Lars.Kjaersgaard@truis.com.au  ·  24x7 Support  +61 7 3710 5055

    J8056_TRU_Cyber Security Email Signature_AW2 1.jpg

    Email Disclaimer: https://www.truis.com.au/privacy-copyright-disclaimer/#email





  • 3.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 01:39 AM

    Hi Lars,

     

    Thank you for the suggestion. While this option may work for a library with a few physical files (PFs), it would still be time-consuming for a library containing thousands of PFs.

     

    Regards,

     

    Nadeem Ahmed Farooqui 

    Manager Technology Services 

     

    Octans Digital (Pvt) Limited

    Phone: +92 21 34329630 

    Mobile: +92 321 2196219  

    E-mail: nfarooqui@octans.ai

    Web: www.octans.ai

    Address: 2nd Floor, Nice Trade Orbit Building, Plot 44-A, P.E.C.H.S, Block 6, Shahrah-e-Faisal, Karachi, 75400, Pakistan

    signature_2335501106 

     






  • 4.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 01:52 AM
    Hi Nadeem,

    PDM should help you there. (Assuming you have 5770-WDS installed and licensed.)

    If you create a user option called "CD" for the CRTDUPOBJ DATA(*NO)
    Then work with objects in the library. (WRKOBJPDM or STRPDM option 2)
    Use F17 to filter the list if you only want to work on a subset of objects.
    Type "CD" next to the first object on the list and hit F13 - the CD is repeated on all items in the list.

    Then hit enter to run your "CD" option against all items.

    You will want to test this first on a small set of objects to ensure that you've got your "CD" option set up correctly.
    You will want to run it on an interactive session that you don't need for a while, because it may take some time.
    A file cannot be duplicated while it is in use for update by another job.

    Regards,



    Lars Kjaersgaard  ·  
    Senior Systems Engineer

    Truis Pty Ltd  ·   1800 777 111  ·  NZ 09 307 0520
    144 Bluestone Circuit, Seventeen Mile Rocks, QLD 4073 Australia
    T  +61 7 3710 5000  ·   +61 7 3710 5043  ·    +61 421 998 113
    E
      Lars.Kjaersgaard@truis.com.au  ·  24x7 Support  +61 7 3710 5055

    J8056_TRU_Cyber Security Email Signature_AW2 1.jpg

    Email Disclaimer: https://www.truis.com.au/privacy-copyright-disclaimer/#email





  • 5.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 03:49 AM
    Edited by Marc Rauzier Mon January 20, 2025 03:52 AM

    Hello

    I am not aware of any way to save physical files without data. But you could try to use CPYLIB DATA(*NO) to create a new library without data. However, there are some ownership and authority changes when using this command. Checkout https://www.ibm.com/docs/en/i/7.5?topic=ssw_ibm_i_75/cl/cpylib.html.

    So, if you restore the library like it was saved, you can try to play with IBM i SQL Services to clear all members.

    I did not complete full tests with the following, but you can use:

    SELECT TABLE_NAME, SYSTEM_TABLE_MEMBER, QSYS2.QCMDEXC('CLRPFM FILE(yourlib/' concat TABLE_NAME concat ') MBR(' concat SYSTEM_TABLE_MEMBER concat ')'
      FROM QSYS2.SYSMEMBERSTAT 
      WHERE TABLE_SCHEMA = 'yourlib';

    Checkout https://www.ibm.com/docs/en/i/7.5?topic=services-qcmdexc-scalar-function and https://www.ibm.com/docs/en/i/7.5?topic=services-sysmemberstat-view



    ------------------------------
    Marc Rauzier
    ------------------------------



  • 6.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 07:48 AM

    Good suggestion Marc.  Only comment I have is that, especially on a library with numerous files, is that many people forget to scroll all the way to the bottom, or use the icon near the lower left in Run SQL Scripts to go to the bottom.  So their work around is to wrap the above in a create table like this:

    create table qtemp.memberlist as (

    SELECT TABLE_NAME, SYSTEM_TABLE_MEMBER, QSYS2.QCMDEXC('CLRPFM FILE(yourlib/' concat TABLE_NAME concat ') MBR(' concat SYSTEM_TABLE_MEMBER concat ')'
      FROM QSYS2.SYSMEMBERSTAT 
      WHERE TABLE_SCHEMA = 'yourlib'

    ) with data



    ------------------------------
    Robert Berendt IBMChampion
    Business Systems Analyst, Lead
    Dekko
    Fort Wayne
    ------------------------------



  • 7.  RE: Backup of PF & LF

    Posted Mon January 20, 2025 08:08 AM

    Hi Robert,

    This seems doable. Let me give this workaround a try.

    Thanks a lot for support.



    ------------------------------
    Nadeem Ahmed Farooqui
    ------------------------------