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

2,790 pts.
Tags:
AS/400 database
AS/400 development
PF/LF
Physical File
RPG
RPG ILE
RPGILE
Hello, I'm looking for an example of how to get a row count of a PF from a ILE rpg program. Thanks everybody.
ASKED: December 10, 2008  2:10 AM
UPDATED: December 10, 2008  7:43 PM

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following