with the midrange AS/400 systems the IBM service engineers have system disks that they can use to reset the Security Officer and Systems Manager passwords. That is the only way I know to do it.
To get useful help, some clarification is needed. Simply stated, which password did you lose? There are numerous passwords possible. Did you lose your user profile password? …the QSECOFR profile password? …some different profile password? …aDST profile password? (Which one? QSECOFR? …a different DST profile password?) …the ‘system’ password? (Why do you need the ‘system’ password?)
Different passwords have different recovery possibilities.