Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Error in Total Report
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 2:21 pm    Post subject: Error in Total Report
Reply with quote

Hi,

My report is showing wrong total. Pls help to resolve this error.

I appreciate it.


Code:
*                                                         
FILE PRINFILE PRINTER FB(220 0)                           
*                                                         
FILE REJTFILE   FB (1259 0)                               
%EZMCBRSO NAME REJTIN                                     
%EZMCBRSA NAME REJTIN                                     
*                                                         
*                                                         
WS-5017-TOT-REJECTED         W   7  N    VALUE 0 +         
                                         MASK 'Z,ZZZ,ZZ9' 
*                                                         
*                                                         
JOB INPUT REJTIN FINISH FINISH-PROC                       
                                                           
*                                                         
   WS-5017-TOT-REJECTED = WS-5017-TOT-REJECTED + 1         
*                                                         
   PRINT DLYAREJT                                         
*                                                         
FINISH-PROC.  PROC                                         
                                                           
  IF WS-5017-TOT-REJECTED = 0                             
     PRINT NULL-REPRT                                     
  END-IF                                                   
                                                           
END-PROC                                                   

REPORT DLYAREJT +                                                   
       PRINTER PRINFILE NODATE NOHEADING NOADJUST                   
                                                                   
*                                                                   
SEQUENCE WS-BRSO-NBR-DLR-INV                                       
*                                                                   
CONTROL FINAL NOPRINT NEWPAGE WS-BRSO-NBR-DLR-INV NOPRINT           
*                                                                   
TITLE 1 COL  4 +     
        COL 42 ' CBRS INBOUND/OUTBOUND REJECT REPORT '        +     
        COL 89 'RUN DATE  ' COL 98 SYSDATE                    +     
        COL 107 'TIME ' COL 112 SYSTIME                             
*                                                                   
TITLE 2 COL 206 'RPT NBR R5017'                                     
*                                                                   
 TITLE 3 COL 2   'FUND-NBR'                                       +
         COL 12  'CUST-ACCT-NBR'                                  +
         COL 36  'DEALER-ID'                                      +
         COL 49  'CONTRA-FIRM-NBR'                                +
         COL 66  'SUB-FIRM-NBR'                                   +
         COL 80  'CNTRL-NBR'                                      +

         COL 66  '------------'                 
         COL 80  '---------'                     
         COL 113 '------------------'           
         COL 133 '-----------'                   
         COL 154 '--------'                     
         COL 164 '---------'                     
         COL 175 '---------'                     
*                                               
 LINE 1  COL 2   WS-BRSO-NBR-FUND-INV           
         COL 12  WS-BRSA-NBR-ACCT-CUST-DLV       
         COL 36  WS-BRSO-NBR-DLR-INV             
         COL 49  WS-BRSA-NBR-FIRM-CONTRA         
         COL 66  WS-BRSA-NBR-FIRM-SUB           
         COL 80  WS-BRSO-NBR-CONTROL             
 *                                                                     
 AFTER-BREAK. PROC                                                     
                                                                       
    IF LEVEL = 1                                                       
       DISPLAY ' '                                                     
       DISPLAY COL 7 'TOTAL RECORDS FOR THE DEALER '  +                 
                      WS-BRSO-NBR-DLR-INV ' : ' TALLY                   
       DISPLAY ' '                                                     
    END-IF                                                             
                                                                       
 END-PROC                                                               
 *                                                                     
 TERMINATION. PROC                                                     
                                                                       
    DISPLAY ' '                                                         
    DISPLAY COL 7 'TOTAL  RECORDS REJECTED :   '    +                   
                   WS-5017-TOT-REJECTED                                 
                                                                       
    DISPLAY ' '                                                         
 DISPLAY COL 20 '#####  END OF CBRS INBOUND/OUTBOUD REJECT REPORT #####'
 END-PROC                                                               
 *                                                                     


My Report is
Code:

 FUND-NBR  CUST-ACCT-NBR           DEALER-ID    CONTRA-FIRM-NBR  SUB-FIRM-NBR
 --------  -------------           ---------    ---------------  ------------
                                                                             
 00060     000000002               02354        00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
                                                                             
      TOTAL RECORDS FOR THE DEALER 02354   :     3                           
                                                                             
 00009     000000002               02356        00000015                     
 00009                                          00000015                     
 00009     000000002                            00000015                     
 00009     000000002                            00000015                     
 00009     000000002                            00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
                                                                             
      TOTAL RECORDS FOR THE DEALER 02356   :     8                           
                                                                             
                                                                             
      TOTAL  RECORDS REJECTED :           8                                 
                                                                             
                   #####  END OF CBRS INBOUND/OUTBOUD REJECT REPORT #####   



The total reject is showing 8 which should be 11. Pls advise.

Thanks.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 2:36 pm    Post subject:
Reply with quote

what does your input file look like?
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 2:48 pm    Post subject:
Reply with quote

Hi,

Pls find details of my Input file.

Code:

                              Data Set Information                         
 Command ===>                                                             
                                                                           
 Data Set Name . . . . : AFS.IMSD4.ID4CB992.INBND.REJECTS                 
                                                                           
 General Data                           Current Allocation                 
  Management class . . : DATARLSE        Allocated megabytes : 1           
  Storage class  . . . : DATA            Allocated extents . : 1           
  Volume serial . . . : TINB54                                           
  Device type . . . . : 3390                                             
  Data class . . . . . : INVBMPC                                           
  Organization  . . . : PS             Current Utilization               
  Record format . . . : FB              Used megabytes  . . : 1           
  Record length . . . : 1259            Used extents  . . . : 1           
  Block size  . . . . : 32734                                           
  1st extent megabytes: 1                                               
  Secondary megabytes : 50             Dates                             
  Data set name type  : EXTENDED        Creation date . . . : 2011/07/12 
  SMS Compressible. . : YES             Referenced date . . : 2011/08/08 
                                        Expiration date . . : ***None*** 
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Aug 09, 2011 3:06 pm    Post subject:
Reply with quote

Good luck Dick.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 3:35 pm    Post subject:
Reply with quote

Thx Peter,

I am not an ezytrieve specialist.
was not even trying to help the TS.
was trying to have the TS supply enough info for someone who could help him.

i am out of this......
should not have entered in the first place.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 09, 2011 3:42 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
what does your input file look like?
I tried looking at it, couple of time but every time it just looks like a file! icon_wink.gif
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 3:45 pm    Post subject:
Reply with quote

Hi Anuj,

I did not get what you want to say here.

Could you pls elaborate?

I appreciate it.

Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 4:20 pm    Post subject:
Reply with quote

ibmmainframe1,

you are doing something during the control break that causes WS-5017-TOT-REJECTED
to be reset to zero.
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 4:30 pm    Post subject:
Reply with quote

Hi dick,

yes during control break its resetting. I would like to know where I am making mistake.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 09, 2011 5:49 pm    Post subject: Reply to: Errot in total
Reply with quote

You are SEQUENCEing the report.

The value in your WS-5017-TOT-REJECTED for the record which appears last in sequence.


To put it another way, if you look at the last record printed, you will find that it was the 8th record on your input file.
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 6:46 pm    Post subject:
Reply with quote

Hi Bill,

Good Catch.

Now I am getting the right total.

However the sequence got changed. Pls let me know how to show the report in the sorted order.

Code:

   FRANKLIN MUTUAL SERIES FUND INC        CBRS INBOUND/OUTBOUND REJECT REPORT
                                                                             
 FUND-NBR  CUST-ACCT-NBR           DEALER-ID    CONTRA-FIRM-NBR  SUB-FIRM-NBR
 --------  -------------           ---------    ---------------  ------------
                                                                             
 00009     000000002               02356        00000015                     
 00009                                          00000015                     
 00009     000000002                            00000015                     
 00009     000000002                            00000015                     
 00009     000000002                            00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
                                                                             
      TOTAL RECORDS FOR THE DEALER 02356   :     8                           
                                                                             
 00060     000000002               02354        00000015                     
 00060     000000002                            00000015                     
 00060     000000002                            00000015                     
                                                                             
      TOTAL RECORDS FOR THE DEALER 02354   :     3                           
                                                                             
                                                                             
      TOTAL  RECORDS REJECTED :          11                                 
                                                                             
                   #####  END OF CBRS INBOUND/OUTBOUD REJECT REPORT #####   
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 09, 2011 6:51 pm    Post subject: Reply to: Errot in total
Reply with quote

OK, 9th record.

What you are effectively doing is adding a sequence number to your report file. The sequence number starts from zero, so sequence number 8 is the 9th record.

There are a number of ways to avoid this, but first you have to understand what has happened.

In your manual, look up how a report file is built when you issue a PRINT. Note especially the important difference between file fields and "W" working storage on the on one hand and "S" working storage on the other.

If you don't fully understand, come back with what you think and we'll get you there.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 09, 2011 6:54 pm    Post subject:
Reply with quote

ibmmainframe1 wrote:
Hi,

Pls find details of my Input file.

Code:

                              Data Set Information                         
 Command ===>                                                             
                                                                           
 Data Set Name . . . . : AFS.IMSD4.ID4CB992.INBND.REJECTS                 
                                                                           
 General Data                           Current Allocation                 
  Management class . . : DATARLSE        Allocated megabytes : 1           
  Storage class  . . . : DATA            Allocated extents . : 1           
  Volume serial . . . : TINB54                                           
  Device type . . . . : 3390                                             
  Data class . . . . . : INVBMPC                                           
  Organization  . . . : PS             Current Utilization               
  Record format . . . : FB              Used megabytes  . . : 1           
  Record length . . . : 1259            Used extents  . . . : 1           
  Block size  . . . . : 32734                                           
  1st extent megabytes: 1                                               
  Secondary megabytes : 50             Dates                             
  Data set name type  : EXTENDED        Creation date . . . : 2011/07/12 
  SMS Compressible. . : YES             Referenced date . . : 2011/08/08 
                                        Expiration date . . : ***None*** 


This gets the prize for "Surprise Answer of the Day", Peter gets the prize for "Quick Quip" and dbz gets the "I wonder how I could possibly have made that more clear" certificate for the office wall.
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Tue Aug 09, 2011 8:25 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for appreciating my suprise answers. icon_lol.gif

well I did not understand regarding the sequence.

Pls advise. Thanks.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 09, 2011 8:34 pm    Post subject:
Reply with quote

Fuller explanation later. Off to the beach now.

For now, define your count as type "S", not "W".

Code:
WS-5017-TOT-REJECTED         S 7  N 0  +         
                                         MASK 'Z,ZZZ,ZZ9' 


Note the other changes, I'll explain later.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Aug 09, 2011 8:52 pm    Post subject: Reply to: Errot in total
Reply with quote

Not so easy to organise...

Just to suggest changing the prefix from WS to something else, so that by looking at the name you know if it is W or S field.

I just used W- or S- for prefixes.

Ah... seems we are going, after all...
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Aug 10, 2011 4:03 am    Post subject: Reply to: Errot in total
Reply with quote

When you define an Easytrieve Plus report there is an important difference between different types of data as to how fields are sourced for the report.

Easytrieve has fields from files. It also has two different types of "working storage" fields. Type W and Type S.

Typically, when you issue a PRINT statement, what happens at that point is that Easytrieve creates a file from which it is going to later produce the report (look for references to EZTRxxxx files).

What goes onto the report files are those fields mentioned anywhere in the report, including in report procedures, titles and lines, but only those fields which are file fields, or Type W fields. Type S fields never end up on a report file.

When the report file is processed to produce the report, all references to file fields and Type W fields are sourced from the report file, Type S fields are sourced from "working storage".

If we follow the case of a count, in a Type W field, which is referenced in the report, like in the TERMINATION proc, it goes like this.

All file data refereced in the report is written to the report file. All Type W data reference in the report is written to the report file. So the "total" is written to the report file along with all the other data, but with only its "current" value at that time.

Instead of being a "total" it is effectively a sequence number.

The report file is sorted (according to the SEQUENCE required) and processed, each item from the report, except for Type S, being sourced from the report file.

The "total" printed in the TERMINATION is just the "sequence number" (offset by one, because the PRINT is before the addition) of the record which has turned up last from the sort.

I said "typically" above for the PRINT statement, so exactly when is the report file not used?

If the (physically) first REPORT in the Easytrieve Plus JOB (not JCL) is not sequenced, then that report, and that report alone for that JOB, will not be written to a report file, but will be produced "as you go along". Any subsequent reports in the JOB will be written to report files.

If the (physically) first REPORT in the Easytrieve Plus JOB (not JCL) is sequenced, then that report and all the subsequent reports in the JOB will be written to report files.

What this means is that the only time your current arrangement of code will work is if the REPORT is the first, physically, in the JOB, and if it is not sequenced.

There are many ways around your problem. If you make the field Type S is one of them.

This leads naturally to another point. Don't try to change the value of a Type W field (or file field) in a report procedure. If you need to change the value of something, do it to a Type S. It will "work" most of the time, by which I mean it'll look like it is working. With a Type S field it will always work in a report procedure.

I made two other changes to your total field.

I gave it 0 decimal places. This is how to get a signed number in Easytrieve Plus (search the forum/look at the manual for more details).

I also took off your initial VALUE statement. Easytrieve Plus initialises fields in "working storage". Numerics to zero, alphanumerics to space. You should decide for your site standards whether to code the VALUE anyway, but it is not necessary (so, to me, confusing when done).
Back to top
View user's profile Send private message
ibmmainframe1

New User


Joined: 26 Jul 2005
Posts: 64
Location: India

PostPosted: Wed Aug 10, 2011 2:30 pm    Post subject:
Reply with quote

Hi Bill,

Amazing. Taking such a pain in giving this elaborate explanation.

I really appreciate it.
icon_biggrin.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Aug 10, 2011 2:50 pm    Post subject:
Reply with quote

No problem.

It is a very common error. I feel it is a deficiency in the manual, as it is not set out clearly enough.

Now it is here, it should cut down on the repeat questions.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 10, 2011 3:37 pm    Post subject:
Reply with quote

Hi Bill,

Quote:
Now it is here, it should cut down on the repeat questions.

Dreamer . . . icon_smile.gif

If it weren't for repeat questions, we'd not have lots of our topics.

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us