Page 1 of 1

Control totals using control sequence sum

PostPosted: Mon Jun 09, 2008 3:26 pm
by kamal
I have an Input file as shown below:

position
1 to 2 3 to 4 5 to 6
Company Dept Amt
C1 D1 10
C1 D1 10
C1 D1 10
C1 D1 10
C1 D1 10
C1 D2 10
C1 D2 10
C1 D2 10
C1 D3 10
C2 D4 20
C2 D4 20
C2 D4 20
C2 D4 20
C2 D4 20
C2 D5 20
C2 D5 20
C2 D6 20
C2 D6 20


I need only the control totals of Company and dept in my o/p as :
C1 90
D1 50
D2 30
D3 10
C2 180
D4 100
D5 40
D6 40



how can this be done ?
I tried following code.
LIST ON                                                               
*******************************************************************   
FILE PRTFL01 PRINTER FB(133 0)                                         
*******************************************************************   
FILE PERSNL FB(571 5710)                                               
IN-AMT                             5  02  N                         
IN-COMP                           1  02  A                             
IN-dept                             3  02  A                             
*                                                                     
 JOB INPUT PERSNL NAME FIRST-PROGRAM                                   
 PRINT PAY-RPT                                                         
 REPORT PAY-RPT LINESIZE 132 PRINTER PRTFL01 NOADJUST                 
 SEQUENCE IN-COMP  IN-DEPT                           
 CONTROL IN-COMP  IN-DEPT                           
 SUM IN-AMT                                                           
 TITLE 01 '         REPORT TALLY . '
 LINE 01  IN-COMP  IN-DEPT IN-AMT                     



Only control totals are required after company change and dept change.
Did not understand the working of sum control and sequence together. Please advice.

Re: Control totals using control sequence sum

PostPosted: Mon Jun 09, 2008 9:58 pm
by dick scherrer
Hello,

From that input what is the output?

Re: Control totals using control sequence sum

PostPosted: Mon Jun 16, 2008 2:49 pm
by kamal
The output should be as follows:
C1 90
D1 50
D2 30
D3 10
C2 180
D4 100
D5 40
D6 40

Re: Control totals using control sequence sum

PostPosted: Mon Jun 16, 2008 11:21 pm
by dick scherrer
Hello,

That appears to be the same as what was posted for the requirement. . .

What happens when you run the code you posted?

Re: Control totals using control sequence sum

PostPosted: Tue Jun 17, 2008 5:55 pm
by kamal
Sorry for the confusion.Please see the attcahed output.

Re: Control totals using control sequence sum

PostPosted: Tue Jun 17, 2008 11:41 pm
by dick scherrer
Hello,

The attached output is the "normal" way to group totals.What you show as the desired output is not at all typical. You want "summaries", but you want them in a sort of nested sequence.

I'm not aware of this being a capability of Easytrieve.

What you could do is read the output from the summary job and create a new set of totals based on your requirement.