REGISTER or login:
You can use SQL or other tools. To give you the "best" answer, we need more information.
What is the purpose of this task?
Is it for a single source member or all members in a soiurce file?
Do you want comments and/or blank lines in the C spec area to be counted?
Are there any members that use /FREE?
Are there ever any /free specs? Do you need to count C-spec comment lines? (Comments can be more time-consuming than they code they cover.) What about C-specs that are blank? If a C-spec statement covers ten lines, does it count as one or ten?
SQL is pretty easy.
select COUNT(*) from mylib/QRPGLESRC
where upper(substr(SRCDTA, 6, 1)) = 'C' and
substr(SRCDTA, 7, 1) <> '*' and
substr(SRCDTA, 7, 70) <> ' '
Use OVRDBF to choose a member, or use CREATE ALIAS to alias a member. Adjust the WHERE clause as needed.
I haven't seen anyone care about counts of lines of code in more than ten years.