CDS returns a FIXED BINARY(31) value that indicates if the old and current values in a compare double and swap were equal.
CDS compares the "current" and "old" values. If they are equal, the "new" value is copied over the "current", and a value of 0 is returned. If they are unequal, the "current" value is copied over the "old", and a value of 1 is returned.
On z/OS, the CDS built-in function implements the CDS instruction. For a detailed description of this function, read the appendices in the Principles of Operations manual.
On Intel, the CDS built-in function uses the Intel cmpxchg8 instruction in the same manner that the CS built-in function uses the cmpxchg4 instruction.