Hi, James.
There's no explicit SUM stage because that functionality is built into
the SPECS stage....you might try something like this (untested):
specs
a: word 3 . /* grab third word in record */
set #0+=a /* add it to counter 0 */
eof /* at EOF */
/Total:/ 1 /* output text "Total" in column 1 */
print #0 next /* followed by the sum */
Good luck.
James Stracka (DHL US) wrote:
I have a file that has numeric data in column 3 that I want to sum.
Not realizing there was no PIPE SUM stage I tried:
PIPE < JIMS TESTFILE A | SPECS WORD 3 | SUM | VAR TOTAL
Which of course gave:
FPLSCB027E Entry point SUM not found
FPLSCA003I ... Issued from stage 4 of pipeline 1
FPLSCA001I ... Running "SUM"
Ready(-0027); T=0.01/0.01 13:44:13
Is there a way to SUM the data within a PIPE instead of doing:
PIPE < JIMS TESTFILE A | SPECS WORD 3 | STEM VALUE.
Total = 0
Do ix = 1 to value.0
Total = total + value.ix
end
--
Dave Jones
V/Soft
www.vsoft-software.com
Houston, TX
281.578.7544