MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Easytrieve empty file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Mon Aug 09, 2004 10:18 am    Post subject: Easytrieve empty file Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Aug 09, 2004 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Wed Aug 11, 2004 3:23 pm    Post subject: Reply with quote

yes it does. Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group