The compress function will only work as long as the string is ALWAYS '_1234' at the end of the variable. Also, if any of the numbers or characters (_1234) is BEFORE the underscore, then those would also be compressed away. COMPRESS will get rid of ANY of the specified characters in the string, no matter where they are found -- before or after the underscore.
SCAN is probably the better function. Review the program and output below. METHOD1 variable was created with the SCAN function and METHOD2 was created with the COMPRESS function. Note the places where METHOD2 compressed in a way that might not be desirable.
Of course, the ultimate solution really depends on how the actual data looks.