INDICATOR keyword in Update statement

Hi,

I encountered an INDICATOR keyword in Update Statement. I would like to know what it does and any documentation on this would help. Is this supported in Natural 3.1.3 ?

Thanks,
Earkkai

Another question that demonstrates the need for a “Documentation Button”. This is for SQL only.

INDICATOR INDICATOR Clause:

The INDICATOR clause is an optional feature to distinguish between a “null” value (that is, no value at all) and the actual values “0” or “blank”.

When specified with a receiving host-variable (target field), the INDICATOR host-variable (null indicator field) serves to find out whether a column to be retrieved is “null”.

Example:

DEFINE DATA LOCAL 
1 NAME      (A20) 
1 NAMEIND   (I2) 
END-DEFINE 
SELECT * 
  INTO NAME INDICATOR NAMEIND 
  ...

In this example, NAME represents the receiving host-variable and NAMEIND the null indicator field.

If a null indicator field has been specified and the column to be retrieved is null, the value of the null indicator field is negative and the target field is set to “0” or “blank” depending on its data type. Otherwise, the value of the null indicator field is greater than or equal to “0”.

When specified with a sending host-variable (source field), the null indicator field is used to designate a null value for this field.

Example:

DEFINE DATA LOCAL 
1 NAME      (A20) 
1 NAMEIND   (I2) 
UPDATE ... 
SET NAME = :NAME INDICATOR :NAMEIND 
WHERE ...

In this example, :NAME represents the sending host-variable and :NAMEIND the null indicator field. By entering a negative value as input for the null indicator field, a null value is assigned to a database column.

An INDICATOR host-variable is of format/length I2.

steve

An addenda to the last post. The documentation I copied is from Natural on the PC (since I usually have this open on my PC, it is the fastest place to go for anything re Natural). I could not find a counterpart to this on the online mainframe documentation.

steve

See http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat422mf/sm/basic.htm#Parameters_basic for details.