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
 

 

Junk data in PIC S9(3) COMP-3 resulting in abend.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
Prakash Ramnani

New User


Joined: 02 Jun 2007
Posts: 5
Location: Rhode Island

PostPosted: Sun Jun 03, 2007 1:19 am    Post subject: Junk data in PIC S9(3) COMP-3 resulting in abend.
Reply with quote

Hi..
I have a CICS COBOL program which is calling other CICS COBOL program. I have initialized my entire copybook using INITIALIZE keyword on the 01 level. When the control goes to the other program, the other program has a group level move. In some of the fields proper data is getting moved while in some there is junk. These junk data values are moved in PIC S9(3) Comp 3 fields resulting in an abend. The junk values are ?????. When I check these values using HEX on option, I see the value is 40 means spaces. I need all the variables to be zeroes. If I INITIALIZE again, i.e if I re-initialized the entire copybook then the fields which have proper data will be initialized. Does anyone have any idea ?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Jun 03, 2007 1:28 am    Post subject:
Reply with quote

Are the fields that have junk in them supposed to still be zeros from the initialize? If so, just before the call move zero to them and see if you still abend.
If they are supposed to have valid numeric data in them (which you moved to them), the problem need other tactics.
Initialize has some restrictions when it comes to redefines, could this be the problem? Sometime initialize followed by a few moves of spaces and zeros can take care of a complicated data description.
Back to top
View user's profile Send private message
Prakash Ramnani

New User


Joined: 02 Jun 2007
Posts: 5
Location: Rhode Island

PostPosted: Sun Jun 03, 2007 1:34 am    Post subject: Re: Junk data in PIC S9(3) COMP-3 resulting in abend.
Reply with quote

Yes. I had Move zeroes to them after the call and it went through without abend. But only the trick is if there is some data coming from that group level moved and later I have moved zeroes to it, then there will be a problem. INITIALIZE has drawback that it does not initialize the fillers. I have junk in couple of filler's too..
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: Sun Jun 03, 2007 1:42 am    Post subject:
Reply with quote

Hello,

If the fields are "really" filler, why does the content matter?

If you create a "fresh" level-01 that has all of the correct initial values (rather than using the INITIALIZE statement) and make sure that every byte has an acceptable value (even the fillers), you could move this new set of fields to the the data-name you now INITIALIZE. If you did this at the "start", and then later moved non-zero values to some fields, all would be preserved. This "fresh" field would only ever be moved from, replacing the INITIALIZE statememt(s) where ever they occur.

This may use a bit of extra working-storage space, but will save on performance at run-time.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Jun 03, 2007 1:57 am    Post subject:
Reply with quote

Like Dick says, sometimes initialize is not the answer.
If you realize that initialize genereate a series of moves of spaces and zeros, then just moving spaces and zeros makes the procedure division longer but is the same amount of machine code. As far as more procedure division, a "perform initialize-my-data-area" is a one liner too, and the actual paragraph can be buried way down at the bottom of the program.
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: Sun Jun 03, 2007 2:11 am    Post subject:
Reply with quote

Hello,

Actually, if a second level-01 is defined with all of the "starter" values, a single move may be all that is needed at run-time. It would work like an INITIALIZE, but would have initial values that were more flexible than what INITIALIZE provides. It would also be a single move, rather than the series generated by an INITIALIZE to be executed at run-time.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Jun 03, 2007 2:21 am    Post subject:
Reply with quote

dick scherrer wrote:
Actually, if a second level-01 is defined with all of the "starter" values, a single move may be all that is needed at run-time.
Good choice, been there, done it, works great.
Back to top
View user's profile Send private message
Prakash Ramnani

New User


Joined: 02 Jun 2007
Posts: 5
Location: Rhode Island

PostPosted: Sun Jun 03, 2007 4:07 am    Post subject: Re: Junk data in PIC S9(3) COMP-3 resulting in abend.
Reply with quote

Thanks all...
Can I check for ????? values in some of the variables after the call from a COBOL program and replace it with ZEROES.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Jun 03, 2007 4:22 am    Post subject:
Reply with quote

I don't really understand your reference to "????? values" but if you want to check for "valid" values is numeric fields, yes, you can check.
<teach on>
the whole point of an interactive system is to validate the input at some point and, after that trust the data. If the called program is getting "garbage", the calling program is falling down on its responsibility.
</teach off>
Oh, as an aside, make (VERY) sure that both programs are working from the same description of the data area.
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: Sun Jun 03, 2007 4:26 am    Post subject:
Reply with quote

Hello,

Are they "really" question marks? If you "sent" valid values, called your code, and came back to your calling module, what generated the ?????(s)?

Some presentation tools show ???? for "invalid" values - might this be your case?

How are these fields that return with ???? defined? If you define a numeric field and modify it in some other bit of code, i'm not sure how the ????s get into the field. If you have a numeric field, i don't believe you will be able to test foe ????.

If you post some detail, we can take a look/ offer suggestions.
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 -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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