I want to get some general information about the files present in a library to get some insight. I need the number of records in each file(table) and each file size in the given library on the IBM i system. I am gathering this data to analyze how big the file size is and how many records need processing per file to estimate the time taken to complete one of the jobs running for a long time. Seems like huge data and records in the database.
It would be helpful if I could get some SQL queries to get this information.
You can execute the following SQL query to get the number of records and file size of each file/table in your library.
select system_table_name, number_rows, data_size from
qsys2.systablestat where system_table_schema = 'Libname'
Here in this SQL query, we are selecting data from the IBM i catalog
systablestat
present in theQSYS2
library.