meaning of the variable line in the definition of sfl

Use this board for starting discussions, asking questions, and giving advice on RPG programming for the IBM i platform (and predecessors.)
CAPL_INFO
Profound User
Posts: 38
Joined: Wed Jul 19, 2017 4:54 am
First Name: Nadine
Last Name: Gauthier
Company Name: CAPL
Country: France
Contact:

meaning of the variable line in the definition of sfl

Post by CAPL_INFO »

Hi,

I don't inderstand the meaning of the variable line XLG in the definition of sfl

Code: Select all

     FTRA008E   CF   E             WORKSTN INFDS(CURSEU)
     F                                     sfile(TRA008SF1:XLG)
i thought it represented the sfl row number !
But this number varying in time !

how can i retrieve the number of rows in a sfl in rpgle ?

Thanks.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: meaning of the variable line in the definition of sfl

Post by Scott Klement »

It is the row number. ("relative record number") For example, when you do READ or READC against the subfile, this will be set to the row that you have retrieved.

The only way that I know of to retrieve the number of rows is to read them all and count them. Or, better, count them when you load the subfile, and keep the count in a variable.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests