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 -LEVEL and BREAK-LEVEL

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


Joined: 05 Dec 2005
Posts: 14
Topics: 8

PostPosted: Thu Dec 29, 2005 9:52 am    Post subject: Easytrieve -LEVEL and BREAK-LEVEL Reply with quote

What is the difference between LEVEL and BREAK-LEVEL in esytrieve?

euphoria
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 29, 2005 12:23 pm    Post subject: Reply with quote

euphoria,

LEVEL is a system-defined field provided for control reports. The field is defined as a two-byte binary field. The value in LEVEL indicates the control break level and varies from 0 to 'n + 1' where:


    ■ LEVEL = 0 when processing detail lines
    ■ LEVEL = n for total line processing at each control level
    ■ LEVEL = n + 1, when processing FINAL totals.


BREAK-LEVEL is a system-defined field whose value indicates the highest control break level. The following example illustrates using BREAK-LEVEL to display an appropriate message in a BEFORE-BREAK procedure:

Code:

REPORT RPT
SEQUENCE REGION BRANCH
CONTROL REGION BRANCH
LINE REGION BRANCH NAME PAY-GROSS
BEFORE-BREAK. PROC
   IF LEVEL = 1 . * processing lowest break
      IF BREAK-LEVEL = 1 . * only branch is breaking
         DISPLAY '*** BRANCH TOTALS'
      ELSE-IF BREAK-LEVEL = 2. * region is breaking too
         DISPLAY '*** BRANCH AND REGION TOTALS'
      ELSE-IF BREAK-LEVEL = 3. * final report totals
         DISPLAY '*** BRANCH, REGION, AND FINAL TOTALS'
      END-IF
   END-IF
END-PROC


The BEFORE-BREAK procedure is invoked before summary lines are printed. In the previous example, LEVEL and BREAK-LEVEL fields are used to determine the appropriate message displayed before the summary lines are printed. Testing for LEVEL 1 tells us that the first summary line is going to be printed next (BRANCH totals). When BREAK-LEVEL is 1, only the BRANCH field is breaking. Therefore, we want to display a message stating this. When BREAK-LEVEL is 2, the REGION field is breaking. This causes both BRANCH and REGION summary lines to print. When BREAK-LEVEL is 3, prints BRANCH, REGION, and final summary lines.

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
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