How can i add up the records of my physical file's numeric field lets say Esal's records using wrkqry?
Please help me by an appropriate code example.
thanks in advance.
Software/Hardware used:
AS/400
ASKED:
December 20, 2009 7:20 AM
UPDATED:
December 21, 2009 4:32 PM
I’m only discussing the question, not attempting to answer it.
Personally, I’d skip that entirely and do the work with a QM query instead. To produce a sum over a field named FLD1 in a file named MYFILE in a library named MYLIB, I’d put this statement into a source member:
Then I’d create the QM query with the CRTQMQRY command and run it with the STRQMQRY command.
That assumes I didn’t have the SQL Dev Kit installed. If I was entitled to it, I’d install it. If it was installed, I’d simply work through the STRQM command. If I already knew Query/400, I’d start my work with the ‘Prompted’ mode and move to SQL mode later. If I was already comfortable with SQL, that’s the mode I’d start with.
I don’t know if Query/400 (now apparently renamed Query for i5/OS) has been meaningfully updated since OS/400 V4. I won’t be surprised if it’s never updated again.
Tom