Not too sure of the complexity of your question but use the RSTLIB command.
If the library already exist on system B then use CLRLIB before you restore. Also check the authority levels for the lib XYZ on system A in regards to the owner of the lib and if an authorization list is used. Then verify the owner user profile and authorization list exist on system B, if not create them so it does not default to QDFTOWN.
REGISTER or login: