File Variable and Date Handling

This area discusses how File Variables and dates are handled by PROIV and Reality:

File Variables 

When a File Variable that is not explicitly referenced, the corresponding record field is unaltered, or is set empty for new records that are added to the file. This is true for all File Variables regardless of their type.

Numeric and DATE File Variables

DATE File Variables have a Display Mask of DATE4 set on the Variable Properties window. Click here for more information about the Variable Properties window.

The following table illustrates how these Date File Variables are handled.

Data Read from Reality file

Resultant value of DATE File Variable

Display code DATE shows

Data written to Reality File

‘’

REALNODATE

 

‘’

‘0’

61360

31/12/1967

‘0’

‘-61359’

1

01/01/1800

‘-61359’

‘-61360’

0 - The following error message is generated: '190 - Date Outside Supported Range In Reality File - filename'

no output

‘-61360’

‘-61391’

-31 - The following error message is generated: '190 - Date Outside Supported Range In Reality File - filename'

no output

‘-61361’

Reality uses a different base date to PROIV when storing dates (31st December 1967 for Reality and 31st December 1799 for PROIV). However, numeric fields that are identified by the DATE display code in the File Definition are automatically adjusted to take account of this.

If the value chosen for REALNODATE corresponds to a valid date, that date value cannot be written back to a Reality file because a null is written instead.  For example, if REALNODATE is set to 0, it is not possible to write the date 31/12/1799 to a Reality file.  It is written as a null.

Reality dates outside the range supported by PROIV (i.e. prior to 1/1/1800 (day 1)) cannot be displayed or input by PROIV but can be read and written successfully provided their processing is restricted to adding or subtracting a number (of days) from the value.

To do this, zero and negative numbers must become valid dates, and at that time, zero will no longer be suitable as the resultant value for an empty date field.  For this reason, application logic should not attempt to detect empty date fields by testing for zero, but should test for &#@NODATE instead.

Numeric, non-DATE File Variables 

The following table illustrates how these File Variables are handled.

Data Read from Reality file

Resultant value of File Variable

Data written to Reality file

''

0

'0'

'0'

0

'0'

 

Empty attributes, values, or subvalues within a record or subrecord are treated as zero when read into an active non-DATE numeric File Variable.  If this is likely to cause problems (for example, in the case of a date, or a credit limit) then define the File Variable as a DATA TYPE 'A' field in PROIV so that the values ' ' and '0' can be distinguished.

Empty values are treated as non-existent subrecords in Subfiles.

Comment on this topic

Topic ID: 720104