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 

Displaying Garbage value in Cobol Program

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


Joined: 25 Mar 2003
Posts: 12
Topics: 8

PostPosted: Wed Jul 14, 2004 2:37 pm    Post subject: Displaying Garbage value in Cobol Program Reply with quote

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


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

PostPosted: Wed Jul 14, 2004 2:45 pm    Post subject: Reply with quote

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


Joined: 25 Mar 2003
Posts: 12
Topics: 8

PostPosted: Thu Jul 15, 2004 4:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jul 15, 2004 5:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
ranjit2705
Beginner


Joined: 25 Mar 2003
Posts: 12
Topics: 8

PostPosted: Fri Jul 16, 2004 12:35 pm    Post subject: Reply with quote

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


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

PostPosted: Fri Jul 16, 2004 12:46 pm    Post subject: Reply with quote

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


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Sun Aug 01, 2004 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Sun Aug 01, 2004 3:02 pm    Post subject: Reply with quote

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