Copy, Clear and Remove member in the multimember physical file in AS400 |
Copy member data using CPYF command
We can copy data from one member to the other member using the CPYF (Copy File) command. Let's have a look.
CPYF FROMFILE(EASYCLASS1/WEB_3)
TOFILE(EASYCLASS1/WEB_3)
FROMMBR(MBR2)
TOMBR(MBR3)
MBROPT(*REPLACE)
CPYF command to copy member data |
Once we perform the CPYF command to copy and replace MBR2 member data to the other MBR3 member. You will see the record copied when the from-member is not empty.If it would be wmpty you will see Empty member not copied error message
CPYF- successful |
For how to display/view data in members using different ways please check this article.
Ways to display data of multiple members of multimember physical file in AS400
Clear member data using CLRPFM(Clear Physical File Member) command
We can clear data from first, last, All, or any specific named member using the CLRPFM command. Default member is the first member which gets cleared when this command executed
Clearing first member
CLRPFM FILE(EASYCLASS1/WEB_3)
CLRPFM to clear physical file first member |
Clearing the last member
CLRPFM FILE(EASYCLASS1/WEB_3) MBR(*LAST)
CLRPFM to clear physical file last member |
Clearing the All member
CLRPFM FILE(EASYCLASS1/WEB_3) MBR(*ALL)
CLRPFM to clear physical file All member |
Clearing any specific member
CLRPFM FILE(EASYCLASS1/WEB_3) MBR(MBR3)
CLRPFM to clear physical file specific named member |
Remove member
We can remove any or all members of a file using the CL command RMVM(Remove Member)
Remove All member
RMVM FILE(EASYCLASS1/WEB_3) MBR(*ALL)
RMVM-Remove All Member |
Remove generic member
RMVM FILE(EASYCLASS1/WEB_3) MBR(MBR3)
RMVM-Remove generic Member |