View previous topic :: View next topic |
Author |
Message |
ranjit2705 Beginner
Joined: 25 Mar 2003 Posts: 12 Topics: 8
|
Posted: Wed Jul 14, 2004 2:37 pm Post subject: Displaying Garbage value in Cobol Program |
|
|
Hi
I have encountered typical Problem In a Conbol progra... I have no clue about the problem......here is the problem..
A program abends in the trailer validation paragraph. The reason is that file total doesn't match the accumulated totals. Accumulated count, accumulated amount fields are elementary variables at 01 level. After a particular record, these values change dramatically (i.e.) Accumulated count gets reinitialized, amount becomes an extremely huge value. The job runs fine with the same load module against a different file. In
any case,the program just adds the record values to accumulated count and amount whenever a record is read. I have attached herewith the message:-
Combined Record Counter : 000000000157
Invalid Record Type Count : 000000000000
Combined Record Counter : 000054224107 (As this is next record, it
should increment only by 1 But it displays some Garbage)
Invalid Record Type Count : 000000000000
Combined Record Counter : 000054224108
Invalid Record Type Count : 000000000000
Combined Record Counter : 000054224109
Invalid Record Type Count : 000080000000 (Sudden increase)
Combined Record Counter : 000054224110
Invalid Record Type Count : 000080000000
Combined Record Counter : 000054224111
Invalid Record Type Count : 000080000054
I guess there might be some memory address issue but not sure....
I would really appreciate if anyone could throw some light on this since I have to come up with a solution...
Thanks
Ranjit _________________ Regards
Ranjit S Panda
Software Engineer |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Jul 14, 2004 2:45 pm Post subject: |
|
|
Ranjit,
How are Invalid Record Type Count & Combined Record Counter defined? Is there any table declaration above these variables? Did you run the pgm with a small set of input? Does it happen when you have few records?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ranjit2705 Beginner
Joined: 25 Mar 2003 Posts: 12 Topics: 8
|
Posted: Thu Jul 15, 2004 4:25 pm Post subject: |
|
|
Hi Kolusu
These variables are defined as 9(12) and initialized to zeroes....
the program ran fine upto 156 records in the file...it occoured when it read 157th rec.....
Thanks for your reoly
ranjit _________________ Regards
Ranjit S Panda
Software Engineer |
|
Back to top |
|
|
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Thu Jul 15, 2004 5:47 pm Post subject: |
|
|
Use some kind of Debug tool to fix this. One would have to see the kind of code to understand why/how is this happening. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
|
ranjit2705 Beginner
Joined: 25 Mar 2003 Posts: 12 Topics: 8
|
Posted: Fri Jul 16, 2004 12:35 pm Post subject: |
|
|
THis is a Batch Program and it very a small program....I am just adding 1 to this counter varaible after reading each record in File...and then displaying the value....it works fine with a small file say upto 150 records....it happened only when it read 157th record...I dont think any Debug tool will help me in fixing this...there is nothing wrong in the program...something is happening behind the scene like memory space....some junk value is being moved to this variable.....but I am not sure..... _________________ Regards
Ranjit S Panda
Software Engineer |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jul 16, 2004 12:46 pm Post subject: |
|
|
Quote: | THis is a Batch Program and it very a small program |
If it is indeed a small program , why don't you post the code and we will take a look at it
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
haatvedt Beginner
Joined: 14 Nov 2003 Posts: 66 Topics: 0 Location: St Cloud, Minnesota USA
|
Posted: Sun Aug 01, 2004 2:39 pm Post subject: |
|
|
Hi Ranjit,
are the counters packed, ie, usage comp-3 ? if not convert them to comp-3.
this should result in a S0C7 abend if you are encountering a abend situation.
if the program is using any indexes, make sure that you are always using the index associated with the field.
you can always compile your program with the SSRANGE(ON) option
then execute it with the following parm value (considering its a non IMS, non DB2 program)
//STEP01 EXEC PGM=XXXXXXXX,PARM='/CHECK(ON)'
good luck...
let us know how this turns out.
chuck haatvedt _________________ Chuck Haatvedt
email --> clastnameatcharterdotnet
(replace lastname, at, dot with appropriate
characters) |
|
Back to top |
|
|
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Sun Aug 01, 2004 3:02 pm Post subject: |
|
|
Chuck,
That is an LE runtime option. Isn't it?
I hope, Ranjit's COBOL program is LE-compliant. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
|
|
|