Total # of records in a file
3 posters
Page 1 of 1
Total # of records in a file
What is the simplest way to find out total # of records in a file?
Thanks.
Raj
Thanks.
Raj
rajkumar400- Posts : 59
Join date : 2010-12-25
Re: Total # of records in a file
Using DSPFD u can get number of records in a file
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Re: Total # of records in a file
ThANKS. But inside the RPG.
rajkumar400- Posts : 59
Join date : 2010-12-25
# of records
In command line,Using DSPFD u can get the total no. of records...
In CL,Using RTVMBRD u can get this by NBRCURRCD(ie number of current records)...
In RPG,Using FILE INORMATION DATA STRUCTURE(ie infds) u can get this...
By calculation also we can find this,inside RPG
step0:In F Spec,declare the file as I/P mode
step1:initialize a variable say "X" to 0
step2:READ a file 31
step3:*IN31 DOWEQ *off
step4:ADD 1 to X
step5:Read a file 31
step6:ENDDO
Now X contains number of records
In CL,Using RTVMBRD u can get this by NBRCURRCD(ie number of current records)...
In RPG,Using FILE INORMATION DATA STRUCTURE(ie infds) u can get this...
By calculation also we can find this,inside RPG
step0:In F Spec,declare the file as I/P mode
step1:initialize a variable say "X" to 0
step2:READ a file 31
step3:*IN31 DOWEQ *off
step4:ADD 1 to X
step5:Read a file 31
step6:ENDDO
Now X contains number of records
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Re: Total # of records in a file
Thanks. I will go with INFDS DUE TO performance.
rajkumar400- Posts : 59
Join date : 2010-12-25
Re: Total # of records in a file
One thing i forgot to say
IN CL,u have one another way to find the number of records...
Using RUNQRY,with outform(*summary) u can find this...
PGM
RUNQRY QRYFILE((PMS90/EMPMST)) OUTFORM(*SUMMARY)
ENDPGM
IN CL,u have one another way to find the number of records...
Using RUNQRY,with outform(*summary) u can find this...
PGM
RUNQRY QRYFILE((PMS90/EMPMST)) OUTFORM(*SUMMARY)
ENDPGM
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Re: Total # of records in a file
Added to this we can use SQL400 or SQLRPG. select count(*) .....
razuk_r- Posts : 65
Join date : 2009-07-31
Location : Chennai
Re: Total # of records in a file
thanks bro
soundhar- Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai
Similar topics
» Set up your file to reuse deleted records
» Will synon (file) object allow more than 13,000 records?
» Have OS/400 notify you when a file contains more than a certain number of deleted records
» What is the maximum number of Level heading formats and Level total formats that can be defined in a print file?
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Will synon (file) object allow more than 13,000 records?
» Have OS/400 notify you when a file contains more than a certain number of deleted records
» What is the maximum number of Level heading formats and Level total formats that can be defined in a print file?
» What are the reasons a logical file may be "dropped" during the File definition load process?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum