Re: Writing two reports a once
Posted in 1993
}From: candle!root (Bruce Momjian) }Subject: Writing two reports a once }Date: Fri, 15 Oct 1993 03:34:07 GMT }X-Informix-List-Id: <news.4624> } }Is there a way to open two report files, and loop through calling each, }then when the reports are closed, the first gets written to the file, }then the second gets appended to the end of the first? } }I tried this: } } START REPORT A1 TO "x" } START REPORT A2 TO "x" } FOR I = 1 TO 10 } OUTPUT TO REPORT A1(...) } OUTPUT TO REPORT A2(...) } END FOR } FINISH REPORT A1 } FINISH REPORT A2 } }Unfortunately, this makes the two files overlapped. Note that both }reports have an ORDER BY line, meaning the report only gets written out }after the FINISH command. Assuming Unix, use: START REPORT A1 TO "x" START REPORT A2 TO "y" ... FINISH REPORT A1 FINISH REPORT A2 RUN "cat y >>x; rm -f y" Are the ORDER BY clauses ORDER EXTERNAL BY or not? If they are ORDER EXTERNAL BY, then I would expect the behaviour you seem to be getting. If they are ORDER {INTERNAL} BY clauses, then you might get interleaved reports, or you might get the output from A1 overwriting the output from A1. This is because the START REPORT statements independently open the file and position the write pointer at the start, and then write to the file. This is a property of Unix I/O systems. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>