PROCEDURE dolrc LPARAMETERS cinstring cinput = cinstring numbytes = LEN(cinput) * Takes the input string, a character at a time, * convert to ANSI numeric and XOR with following character. * Do the first pair to prime crcval crcval = BITXOR(ASC(SUBSTR(cinput,1,1)),ASC(SUBSTR(cinput,2,1))) * Now, loop through the rest FOR x = 3 TO numbytes crcval = BITXOR(crcval,ASC(SUBSTR(cinput,x,1))) ENDFOR RETURN crcvalJust pass in your string, this will return the LRC value.