This seems doable. Let me give this workaround a try.
Thanks a lot for support.
Original Message:
Sent: Mon January 20, 2025 07:48 AM
From: Robert Berendt
Subject: Backup of PF & LF
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
Original Message:
Sent: Mon January 20, 2025 03:48 AM
From: Marc Rauzier
Subject: Backup of PF & LF
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
Original Message:
Sent: Mon January 20, 2025 12:55 AM
From: Nadeem Ahmed Farooqui
Subject: Backup of PF & LF
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
------------------------------