IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Issue with moving zeroes to COMP-3


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
candyboy

New User


Joined: 13 Nov 2006
Posts: 10

PostPosted: Tue Dec 16, 2008 8:43 am
Reply with quote

Hi,

I am having a set of fields defined as PIC S9(9)V99 COMP-3 and my requirement is to move zeroes to it. I am using MOVE ZEROES TO FIELD
in the code. The issue is that the value comming in this field is like X'000000000000' and the sign byte at the end is not comming. Due to this when I am loading this to table, its being discarded.

Strange part is that this issue comes up only for the first time and the next iterations of the same code gets the correct value like X'00000000000C'.

Is there anything I am doing wrong. Pls suggest.

Thanks
CB
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Dec 16, 2008 8:46 am
Reply with quote

Hello,

It sounds like the MOVE is not being executed on the first time thru. . .

If the MOVE ZEROS was executed, there would always be a valid sign (unless something later in the code was moved there).
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Dec 17, 2008 1:14 am
Reply with quote

As Dick alluded to, there's a good possibility your 1st MOVE is not being executed. A hint of this is that the COMP-3 field is LOW-VALUES which is what it would be if not initialized or populated.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Dec 17, 2008 3:58 am
Reply with quote

Here's something that you should never do -

Code:

03  WS-PACKED-GROUP.
    05  WS-PACKED-01 PIC S9(07) COMP-3.
    05  WS-PACKED-02 PIC S9(07) COMP-3.
    05  WS-PACKED-03 PIC S9(07) COMP-3.

MOVE ZERO TO WS-PACKED-GROUP.

When you move ZERO/ZEROS/ZEROES to a group level which contains elementary COMP-3 fields (in this example) 12-Bytes of Display-Numeric ZERO (X'F0') is moved to all three fields, which will eventually cause a S0C7 Data Exception.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 17, 2008 6:02 am
Reply with quote

LE has a storage option to initialize memory to LOW-VALUES. If this is set at your shop, then your first MOVE isn't happening for some reason. What is the exact code you're using and the field(s) involved -- post them in BBCode format, please?
Back to top
View user's profile Send private message
candyboy

New User


Joined: 13 Nov 2006
Posts: 10

PostPosted: Wed Dec 17, 2008 8:15 am
Reply with quote

Thanks guys!!

Based on the replies, we went through the code once more and figured out that infact the MOVE was not getting executed for the first time leading to the issue. Same has been corrected now.

That being said, all your replies have been a good source of learning for me. Thnx again

CB.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 17, 2008 8:39 am
Reply with quote

Glad to hear it is resolved!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Dec 17, 2008 8:51 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Remove leading zeroes SYNCSORT 4
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top