Products Downloads


French version


 

 

ADELIA

VADELIA

SADELIA

WADELIA

MADELIA

(I/B)

(I/B) (S)

(B) (S)

(I/B) (S)

(I) (S)

 

Section for use

All

 

Syntax

POSITION_BEFORE ViewName

 

Description

This instruction positions the file associated with the view ViewName BEFORE the record having a key GREATER THAN or EQUAL TO the key specified in the variables which constitute the key of the view.

 

At this point, the record has not been read. The reading is the user responsibility.

 

Testing the success of the positioning is done with the EXISTS and DOES_NOT_EXIST instructions.

The EXISTS instruction is indicated if a record which has a key corresponding to the key fields of the view exists.

 

Example

Example for SALES file (file keys are customer code and line number);

SALES view is used with only W_CUST_CODE as access key.

 

SALES_CUST_CODE

SALES_LINE_NBR

0002

01

0002

02

0002

03

0002

04

0006

01

0006

02

0011

01

 

W_CUST_CODE = '0006'

POSITION_BEFORE SALES

* This will position the pointer in the file before line 01 of customer 0006

*

IF   SALES EXISTS

READ SALES

* This reads the record of customer 0006 / line 01

DO_WHILE SALES EXISTS

PRINT_VIEWS DETAIL_LINE

* this prints all the records for customer 0006

READ_EQUAL SALES

REDO

ELSE

PRINT NO_SALE_LINE

END

* if W_CUST_CODE = '0003' or '0004' or '0005', the result is the same

* if W_CUST_CODE < '0003', the pointer is before the first record

* if W_CUST_CODE > '0011', the pointer is after the last record

 

↑ Top of page


  • Aucune étiquette