Michael,
I would recommend using DDS to create a custom externally described format
(printer) file for each report, and using them. It is easy to create,
using the PDM RLU utility, or the WDSC Code Designer. That way you write to
your format file just like writing to a physical file with named fields.
QPRINT is a generic printer file for the system.
File control looks something like;
FILE-CONTROL.
* ---------------------------------------------------------------*
* Data for the report
* ---------------------------------------------------------------*
SELECT Report-Data-File
ASSIGN TO DATABASE-REPORTFILE
ORGANIZATION IS Sequential
FILE STATUS IS Report-Data-Status.
* ---------------------------------------------------------------*
* 1st Printer file for the report
* ---------------------------------------------------------------*
SELECT Print-Report1
Assign to Formatfile-PrinterFileName1(10 char max)-SI
File status is Print-Report1-Status.
* ---------------------------------------------------------------*
* 2nd printer file for the report
* ---------------------------------------------------------------*
SELECT Print-Report1
Assign to Formatfile-PrinterFileName2(10 char max)-SI
File status is Print-Report2-Status.
Data Division part
FILE SECTION.
*----------------------------------------------------------------*
FD Report-Data-File.
*----------------------------------------------------------------*
01 Report-Data-Rec.
COPY DDR-ALL-FORMATS IN REPORTFILE.
* ---------------------------------------------------------------*
FD Print-Report1.
* ---------------------------------------------------------------*
01 Print-Report-Lines.
COPY DDSR-ALL-FORMATS IN PrinterFileName1(10 char max).
* ---------------------------------------------------------------*
FD Print-Report2.
* ---------------------------------------------------------------*
01 Print-Report-Lines.
COPY DDSR-ALL-FORMATS IN PrinterFileName2(10 char max).
If you already have all your reports defined in working storage, then it
would be more work. It is great for starting a report from scratch. Define
the output in a printer file, and get it signed off from the requester/user,
then write the programming to the printer file.
Just a thought.
Jim Essinger
Senior Programmer/Analyst
GCO Servicing
(208) 452-4-9475
On 5/16/07, Michael Rosinger <mrosinger@xxxxxxxxx> wrote:
List,
It is my understanding that a typical printer file definition is something
like:
SELECT PRINT-FILE1 ASSIGN TO PRINTER-QPRINT.
If the program in question produces multiple reports, is it as simple as
defining additional files like this?
SELECT PRINT-FILE2 ASSIGN TO PRINTER-QPRINT.
SELECT PRINT-FILE3 ASSIGN TO PRINTER-QPRINT.
If so, how does the O/S know to separate the reports as individual files?
Or
am I missing a qualification somewhere? Something special in the CL? The
above compiles fine but I'm not yet able to test the program.
A CL example calling a program that produces multiple report files would
be
very helpful. TIA
--
Regards,
Michael Rosinger
Systems Programmer / DBA
Computer Credit, Inc.
640 West Fourth Street
Winston-Salem, NC 27101
336-761-1524
m rosinger at cciws dot com
As an Amazon Associate we earn from qualifying purchases.