View previous topic :: View next topic |
Author |
Message |
ptf Beginner
Joined: 03 Jun 2004 Posts: 10 Topics: 5
|
Posted: Mon Aug 09, 2004 10:18 am Post subject: Easytrieve empty file |
|
|
I have a Easytrieve program that produces a report. In the event that the input file is empty, how can I still print out the headings of the report? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Aug 09, 2004 10:57 am Post subject: |
|
|
PTF,
You can code a FINISH proc which identifies a procedure to be executed during the termination of a JOB activity. After the last automatic input record is processed,the procedure identified by proc-name-2 is performed.
This is coded on the job statement.
Define a switch to indicate if the report is printed or not. If the report is not printed then at the end of the job , the disp-proc gets execueted where you will print the report once again.
Code: |
DEFINE W-REPORT-PRINTED W 01 A VALUE 'N'
JOB INPUT INFILE FINISH DISP-PROC
IF SOME CONDITION = TRUE
PRINT REPORT1
W-REPORT-PRINTED = 'Y'
END-IF
DISP-PROC. PROC
IF W-REPORT-PRINTED = 'N'
PRINT REPORT1
END-IF
END-PROC
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ptf Beginner
Joined: 03 Jun 2004 Posts: 10 Topics: 5
|
Posted: Wed Aug 11, 2004 3:23 pm Post subject: |
|
|
yes it does. Thanks! |
|
Back to top |
|
|
|
|