Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: Decode Function in DS

$
0
0

The decode function provides an easier way to write nested ifthenelse functions. In nested ifthenelse functions, you must write nested conditions and ensure that the parentheses are in the correct places, as the following example shows:ifthenelse ((EMPNO = 1), '111',

ifthenelse((EMPNO = 2), '222',

ifthenelse((EMPNO = 3), '333',

ifthenelse((EMPNO = 4), '444',

'NO_ID'))))

In the decode function, you list the conditions, as the following example shows. Therefore, decode is less error prone than nested ifthenelse functions.decode ((EMPNO = 1), '111',

(EMPNO = 2), '222',

(EMPNO = 3), '333',

(EMPNO = 4), '444',

'NO_ID')


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>