It is better to use branchchng since that API will only act on existing branches. API branchdata_3 will add a branch if the branch does not exist. It is not necessary to give the keywords since all needed argument are in the correct order, i.e.
psspy.branch_chng(12345,34567,'1',0)