ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » COMP-3 PACKED DECIMAL

Post new topic  Reply to topic
 COMP-3 PACKED DECIMAL « View previous topic :: View next topic » 
Author Message
djeripo
PostPosted: Thu May 20, 2004 1:30 pm    Post subject: COMP-3 PACKED DECIMAL Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Hi,
Could you tell me how to convert a 11byte character into a,
PIC S9(9) V99 COMP-3
When I imported CobolCopyBook ,that element under CWF tab is displayed with the following attributes,

Physical Type Packed Decimal
Length Count 6
Virtual Decimal Point 2 .
Thanks in advance
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Thu May 20, 2004 1:45 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Please be more specific.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
djeripo
PostPosted: Thu May 20, 2004 2:13 pm    Post subject: Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Sorry about that Jeff.
I am doing a conversion from TDS to CWF .
I am getting a 11 byte character something like ,
00000061200 (BILL_PREMIUM).

I need to convert it into an equivalent PIC S9(9) V99 COMP-3

I know , I have to cast that in compute node something like
CAST(BILL_PREMIUM AS FLOAT(9,2)??) .Not sure how to do that.
Back to top
View user's profile Send private message Visit poster's website
EddieA
PostPosted: Thu May 20, 2004 3:31 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

If you've set up the TDS and CWF correctly:
Code:
SET OutputRoot.MRM.OutputPD = InputBody.InputCHAR / 100;

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
djeripo
PostPosted: Thu May 20, 2004 3:39 pm    Post subject: Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Sorry, I did nt get that .Could you please elaborate.
Back to top
View user's profile Send private message Visit poster's website
wooda
PostPosted: Fri May 21, 2004 12:27 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Why are you modelling the input as character and not decimal ?

00000061200

Looks like a decimal which is right justified and padded with 0.

If you model it as a decimal then conversion should not be necessary assuming that you want to output the same logical value but in the format described by your COBOL.
Back to top
View user's profile Send private message
djeripo
PostPosted: Fri May 21, 2004 7:05 am    Post subject: Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Alex,
I am getting a character of 11 bytes.
00000061200 (BILL_PREMIUM).

I would type cast it into Decimal after concatinating a period(.) to it .
Something like ,
CAST(SUBSTRING (BILL_PREMIUM FROM 1 FOR 9) || . || SUBSTRING(BILL_PREMIUM FROM 10 FOR 2) AS DECIMAL(11,2) ) .
The resultant would be ,
000000612.00
The thing which I dont understand is ,
The Length of Input Element is 12 bytes(After concatenation of period)whereas Output Element is 6.

Do you mean to say that, I can straight away assign this(000000612.00
) to a an element in cobol copy book of structure,
Physical Type Packed Decimal
Length Count 6
Virtual Decimal Point 2 .
This is first time I am doing something like this .Please excuse me if it is too basic .
Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Sun May 23, 2004 2:23 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What does your specification says about the input data? Will it always be 11 chars long? If you are getting data as 00000000011 then you want to assign 0.11 to the output field, correct?
Your output field is long enough to hold data of 9(9).9(2) size. Since its defined as COMP-3 field it is taking 6 bytes only.
The code you mentioned in above post will take care of moving data into output field correctly.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
djeripo
PostPosted: Sun May 23, 2004 8:18 pm    Post subject: Reply with quote

Master

Joined: 25 Jan 2004
Posts: 225

Thanks Kiran. It worked , without making any changes.My input is always fixed with 11 characters.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » COMP-3 PACKED DECIMAL
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.