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 

COMP-3 issues - S0C7

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


Joined: 04 Sep 2007
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Mon Sep 17, 2007 1:07 pm    Post subject: COMP-3 issues - S0C7 Reply with quote

I have my input value as: -89000.50. I want to update this value (many of this) into DB2 where we defined as Decimal(16,2).

I used a sort UTILITY to convert -89000.50 to Packed decimal and I formatted the value as

0000000000000900
000000000000805D

In the cobol program I defined the input value as

05 WS-A PIC S9(14)V9(2) USAGE COMP-3

Then when I am trying to update this value I got SQL = -311

When I defined 05 WS-B PIC S9(14)V9(2) USAGE COMP-3

when I tried to move the value

MOVE WS-A TO WS-B, I am getting the S0C7.
Could you please help me why this SOC7?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Mon Sep 17, 2007 1:24 pm    Post subject: Re: COMP-3 issues - S0C7 Reply with quote

kollanag wrote:
I have my input value as: -89000.50. I want to update this value (many of this) into DB2 where we defined as Decimal(16,2).

I used a sort UTILITY to convert -89000.50 to Packed decimal and I formatted the value as

0000000000000900
000000000000805D

In the cobol program I defined the input value as

05 WS-A PIC S9(14)V9(2) USAGE COMP-3

Then when I am trying to update this value I got SQL = -311

When I defined 05 WS-B PIC S9(14)V9(2) USAGE COMP-3

when I tried to move the value

MOVE WS-A TO WS-B, I am getting the S0C7.
Could you please help me why this SOC7?

A comp-3 field with a picture of s9(14)v9(2) would only take up 9 bytes, you are showing 16 bytes and you have the wrong number of zeros between the 9 and the 5.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Sep 17, 2007 1:31 pm    Post subject: Reply with quote

kollanag,

Show us the DB2 column definition.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kollanag
Beginner


Joined: 04 Sep 2007
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Mon Sep 17, 2007 1:40 pm    Post subject: Reply with quote

The input value is -8900.50 in my file.

The DB2 definition is fld-amt decimal(16,2).
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Sep 17, 2007 2:38 pm    Post subject: Reply with quote

Kollanag,

As mentioned by CraigG S9(14)V9(2) USAGE COMP-3 occupies only 9 bytes, but you show a much bigger number.

Quote:

I used a sort UTILITY to convert -89000.50 to Packed decimal and I formatted the value as


I don't know how you converted the values from input to output but this is how you need to convert the numbers to packed decimal numbers


Code:

//STEP0100 EXEC PGM=SORT             
//SYSOUT    DD SYSOUT=*             
//SORTIN    DD *                     
-8900.50                             
//SORTOUT   DD SYSOUT=*             
//SYSIN     DD *                     
  SORT FIELDS=COPY                   
  INREC FIELDS=(1,7,SFF,PD,LENGTH=9)
/*                                   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Mon Sep 17, 2007 2:39 pm    Post subject: Re: COMP-3 issues - S0C7 Reply with quote

kollanag wrote:
I used a sort UTILITY to convert -89000.50 to Packed decimal and I formatted the value as

0000000000000900
000000000000805D
Which one is real and which one is 'Memeoex"?
-89000.50 is
0000000000008000
000000000000905D
and
0000000000000900
000000000000805D is
-8900.50

Since we are not seeing the full true picture, what "sort UTILITY" statements did you use to convert this field?
Back to top
View user's profile Send private message
kollanag
Beginner


Joined: 04 Sep 2007
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Mon Sep 17, 2007 2:59 pm    Post subject: Reply with quote

I will try with 9 bytes field length and get back to you on this. Thanks for your help.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
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