How to get the row count of a PF with RPG ILE?

2790 pts.
Tags:
AS/400 database
AS/400 development
PF/LF
Physical File
RPG
RPG ILE
Hello, I'm looking for an example of how to get a row count of a PF from a ILE rpg program. Thanks everybody.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You could use embedded SQL to retrieve a row count :-

C/EXEC SQL
C+ SELECT COUNT(*) FROM YOURFILE INTO :COUNT
C/END-EXEC

Regards,

Martin Gilbert.

The file information data structure positions 156-159 Binary – Number of records in file when it was opened. Add to the ‘F’ spec INFDS(MyDSName)

and d specs
D MyDSName DS
D OrigNumRec 156 159B 0

Phil

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • tarek11

    the answer above u have given is not correct dear...

    He wants to know you to want to get no of recors(count) through rpgle. 

    20 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: