POSITION

POSITION Syntax Diagram

Effect

The contents of the field col sets the output position (column) of the subsequent WRITE statement.

If the column defined by POSITION lies in the part of the line already written, it will be overwritten by any subsequent WRITE statement.

Example

The routine LINEOUTPUT has three input parameters - COLUMN, LENGTH and CHAR. Starting from COLUMN, it outputs a line comprising the character CHAR with the length LENGTH:

FORM LINEOUTPUT USING COLUMN LENGTH CHAR. 
  DATA LINEPOS TYPE P. 
  LINEPOS = COLUMN. 
  DO LENGTH TIMES. 
	POSITION LINEPOS. WRITE CHAR. 
	ADD 1 TO LINEPOS. 
  ENDDO. 
ENDFORM.

If you call the above FORM with

PERFORM LINEOUTPUT USING 5 10 '='.

the output is:

==========

Related

WRITE ... AT, WRITE ... UNDER