In which language? In RPG IV/ILE you would use the edit code built in function:
Eval String = %EditC(Numeric : ‘X’)
Edit code “X” gives you a straight numeric conversion without commas, blanks, etc.
In CL you simply use the CHGVAR command:
CHGVAR VAR(&STRING) VALUE(&NUMERIC)
All the best