Total # of records in a file
Page 1 of 1 • Share •
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

» Trusted File Seller Badge (TFSB)
» Create Batch file for Selenium
» how to get data dynamically from Notepad file
» WebDriver + NUnit using App.Config File
» program to provide total number of objects present / available on the page
» Create Batch file for Selenium
» how to get data dynamically from Notepad file
» WebDriver + NUnit using App.Config File
» program to provide total number of objects present / available on the page
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum