View previous topic :: View next topic
|
Author |
Message |
candyboy
New User
Joined: 13 Nov 2006 Posts: 10
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
candyboy
New User
Joined: 13 Nov 2006 Posts: 10
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear it is resolved! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|