Exists method: Tree class

Syntax

Exists(SetID, UserKeyValue, TreeName, EffDt, BranchName)

Description

The Exists method finds an existing tree, as specified by the parameters. The parameters must specify a unique tree. If a tree matching the parameters is found, the method returns 0. This method works with either open or closed trees.

Parameters

Parameter Description

SetID

Specify the table indirection key for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "S", you must specify a SetID.

If the tree structure doesn’t have its IndirectionMethod specified as "S", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

UserKeyValue

Specify the User Key Value for the tree. This parameter takes a string value. If the tree structure the tree is based on has its IndirectionMethod specified as "U" or "B", you must specify a User Key Value.

If the tree structure doesn’t have its IndirectionMethod specified as "U" or "B", you must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

TreeName

Specify the name for this tree. This parameter takes a string value.

EffDt

Specify the effective date for this tree. This parameter takes a string value.

BranchName

This parameter is required, but it is unused in this release. You must enter a Null string (that is, two quotation marks with no blank space between them ("")) for this parameter.

Returns

An integer: 0 if tree exists.

Example

&RSLT = &MYTREE.Exists("", "", "VENDOR_PER_DATA", "05-03-1998", ""); 
If &RSLT = 0 Then 
   /* tree exists, do processing */ 
Else 
   /* tree doesn't exist, do error processing */ 
End-if;