4.52 isnull - Evaluate NULL value

Format: isnull($num$), isnull($str$), isnull($date$), isnull($time$), isnull($bool$)

Determine whether NULL value is included in the value $num$ (the same applies to other data type). Returns 0b1 (true) if NULL value exists, and 0b0 (false) otherwise.

Examples

Example 1: Basic Example

$ more dat1.csv
id,val
1,a
2,
3,b
$ mcal c='isnull(${val})' a=rsl i=dat1.csv o=rsl1.csv
#END# kgcal a=rsl c=isnull(${val}) i=dat1.csv o=rsl1.csv
$ more rsl1.csv
id,val,rsl
1,a,0
2,,1
3,b,0

Example 2: Specify other field types

$ mcal c='isnull($s{val})' a=rsl i=dat1.csv o=rsl2.csv
#END# kgcal a=rsl c=isnull($s{val}) i=dat1.csv o=rsl2.csv
$ more rsl2.csv
id,val,rsl
1,a,0
2,,1
3,b,0

Example 3: Specify null character

$ mcal c='isnull("")' a=rsl i=dat1.csv o=rsl3.csv
#END# kgcal a=rsl c=isnull("") i=dat1.csv o=rsl3.csv
$ more rsl3.csv
id,val,rsl
1,a,1
2,,1
3,b,1