Products Downloads


French version


 


ADELIA

VADELIA

SADELIA

WADELIA

EADELIA

(I/B)

(I/B) (C/S)

(B) (S)

(I/B) (C/S)

(B) (C/S)


Section for use

All


Syntax

IF ViewName EXISTS


Description

This instruction is a logical operator which can only appear in a condition.

It tests whether a file access was successful.


A reading or positioning instruction must have taken place beforehand.


The variable ViewName located before the instruction must be the guide word of a view declared at the prototype level.


Example

* Controls the ITEM file

*

PREPARE_MSG 0057 Z_ITEM_CODE

CHAIN ITEM_VW

IF   ITEM_VW EXISTS AND MODE = 'CREATE'

* already exists

INIT_MSG Z_ITEM_CODE MODE

ANOMALY

END

*

IF   ITEM_VW DOES_NOT_EXIST AND MODE = 'UPDATE'

* record does not exist

INIT_MSG Z_ITEM_CODE MODE

ANOMALY

END

*

*

CHAIN ITEM_SIZES

DO_WHILE ITEM_SIZES EXISTS

NEW_COLOR = 'Blue'

UPDATE ITEM_SIZES

READ_EQUAL ITEM_SIZES

REDO


↑ Top of page

  • Aucune étiquette