View previous topic :: View next topic
|
Author |
Message |
Abhi Nature
New User
Joined: 14 Dec 2011 Posts: 17 Location: India
|
|
|
|
Hello!
I am writing a report using REPORT writing functionality of easytrieve.
1) One output file, multiple REPORT paragraphs
REPORT REPORT1 PRINTER OUTPUTF1 <other parameters>
LINE 01 <VARIABLES>
REPORT REPORT2 PRINTER OUTPUTF1 <other parameters>
LINE 01 <OTHER VARIABLES>
REPORT REPORT3 PRINTER OUTPUTF1 <other parameters>
LINE 01 <SOME OTHER VARIABLES>
Above REPORT paragraphs are printed on different conditions to a same output file.
The problem is, OUTPUTF1 has records from only first REPORT paragraph. In above case records from only REPORT1 are printed to OUTPUTF1. If REPORT2 paragraph is moved above REPORT1 then records from only REPORT2 are printed to OUTPUTF1.
Thanks! |
|
Back to top |
|
|
Abhi Nature
New User
Joined: 14 Dec 2011 Posts: 17 Location: India
|
|
|
|
Okay. This was interesting!
From the manual - ...if another report is already using the associated
print file, the PRINT statement outputs data to a work file that is spooled
until the associated JOB activity processing is complete
Therefore, the data from second REPORT paragraphs and further was spooled to a work file since multiple REPORT paragraphs were writing to same output file. Only first REPORT paragraph was directly writing to output file. This paragraph was holding the output file. Once JOB activity was completed, spooled data from work files should supposedly write to output file. This was not happening.
Spooled data from work files in my case was not writing to output file! The reason - I was using STOP EXECUTE! STOP EXECUTE immediately terminates all easytrieve function. This implies that writing spooled data from work files is yet another JOB activity, an internal one. Only writing STOP worked - it terminates only the current activity. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, STOP EXECUTE will do that. It is for error situations. To just get on with the next thing, you use STOP.
If you add a SEQUENCE to each report, you will get no report output with STOP EXECUTE.
In your existing case, note that you would not get totals at the end of the report. |
|
Back to top |
|
|
|