Now, Get RPG Codes in all three formats only on this website on every RPGLE related programming article.

Fixed, /Free and Fully Free RPG


Copy, Clear and Remove member in multimember physical file in AS400

Copy, Clear and Remove member in multimember physical file in AS400
Copy, Clear and Remove member in multimember physical file in AS400, CPYF, Copy file member data, CLRPFM, clear physical file member, RMVM, remove member, CL command, as400, ibmi
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, CPYF command, copy member in as400, multimember physical file in as400,ibmi
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,cpyf command, copy and replace data using cpyf, multimember physical file in as400
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 member,clrpfm, multimember physical file in as400,ibmi,CLRPFM to clear physical file first member
CLRPFM to clear physical file first member

Clearing the last member

CLRPFM FILE(EASYCLASS1/WEB_3) MBR(*LAST)
CLRPFM to clear physical file member,clrpfm, multimember physical file in as400,ibmi,CLRPFM to clear physical file last member
CLRPFM to clear physical file last member

Clearing the All member

CLRPFM FILE(EASYCLASS1/WEB_3) MBR(*ALL)
CLRPFM to clear physical file member,clrpfm, multimember physical file in as400,ibmi,CLRPFM to clear physical file All member
CLRPFM to clear physical file All member


Clearing any specific member

CLRPFM FILE(EASYCLASS1/WEB_3) MBR(MBR3)
CLRPFM to clear physical file member,clrpfm, multimember physical file in as400,ibmi,CLRPFM to clear physical file specific named member
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,RMVM, Remove member, CL command, remove member of multimember physical file in as400, ibmi
RMVM-Remove All Member

Remove generic member

RMVM FILE(EASYCLASS1/WEB_3) MBR(MBR3)
RMVM-Remove generic Member,RMVM, Remove member, CL command, remove member of multimember physical file in as400, ibmi
RMVM-Remove generic Member

Related Post

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain