TomLiotta
18875 pts. | Dec 21 2009 7:52AM GMT
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:
select sum( FLD1 ) from MYLIB/MYFILE
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






