RPGIV @ Work

A unique site for RPG and System i Lovers

Welcome!

Hi, this site will provide all what you need in System i and RPG developments.

My Name is Chamara Withanachchi, System i Expert and RPG Developer. And in the field for last 11 years.

I hope you will find lot of valuable information from this site

RECNO keyword Print E-mail
User Rating: / 0
PoorBest 
Written by Chamara   

The RECNO keyword specifies that a DISK file is to be processed by relative-record number. The RECNO keyword must be specified for output files processed by relative-record number, output files that are referenced by a random WRITE calculation operation, or output files that are used with ADD on the output specifications.

The RECNO keyword can be specified for input/update files. The relative-record number of the record retrieved is placed in the 'fieldname', for all operations that reposition the file (such as READ, SETLL, or OPEN). It must be defined as numeric with zero decimal positions. The field length must be sufficient to contain the longest record number for the file.

The compiler will not open a SEQ or DISK file for blocking or unblocking records if the RECNO keyword is specified for the file. Note that the keywords RECNO and BLOCK(*YES) cannot be specified for the same file.

Note:
When the RECNO keyword is specified for input or update files with file-addition ('A' in position 20), the value of the fieldname parameter must refer to a relative-record number of a deleted record, for the output operation to be successful.
   FABC8FILX  IF   E             DISK    PREFIX(Old) RECNO(FileRRN)

   D FileRRN         S             10I 0
Next>