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 » Trailing blanks in fixed-length MRM field question

Post new topic  Reply to topic
 Trailing blanks in fixed-length MRM field question « View previous topic :: View next topic » 
Author Message
TonyD
PostPosted: Thu Nov 27, 2003 7:51 pm    Post subject: Trailing blanks in fixed-length MRM field question Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

I have an incoming message that is mapped to a Cobol copybook definition. It includes a Street Name field that is defined as 40 bytes, left-justified with 'space' as the padding character. I want to locate the end of the name, using the 'POSITION' function to find the first space.
The test however returns a result of '0', i.e. no space found in the field. When I view a trace I see:
Code:

 (0x0300000B):SP_AD_INDICATOR_2    = ''
                 (0x0300000B):SP_AD_NUMBER_2       = ''
                 (0x0300000B):SP_AD_STREET_NO      = '13'
                 (0x0300000B):SP_AD_STREET_NAME    = 'BOOTH'
                 (0x0300000B):SP_AD_STREET_TYPE    = 'CL'
                 (0x0300000B):SP_AD_STREET_DIR     = ''

The spaces are not displayed. Fields that are blank, e.g. SP_AD_NUMBER_2 which has fixed length of 8, are represented as null. This is in contrast to fields in the MQMD, for example:
Code:

(0x03000000):ReplyToQMgr      = 'DMQ1                      '
(0x03000000):UserIdentifier   = 'projct09         '

where trailing blanks are shown within the quotes.
What should I change in my message definition, created by importing the Cobol copybook, to ensure that the entire field, including trailing blanks, is retained?
I am using WBIMB 5, CSD01.
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Nov 28, 2003 2:40 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Go to the CFW physical format properties for element 'SP_AD_STREET_NAME' and set 'String Justification' to 'Not Applicable'. Make sure that the padding character is set to <SPACE>, but it probably is...otherwise it would not be trimming the input in the way you describe.
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Nov 28, 2003 11:07 am    Post subject: Reply with quote

Jedi Knight

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

Try setting the Padding to "NULL" for this element.
_________________
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
TonyD
PostPosted: Sun Nov 30, 2003 2:26 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Kimbert. I did as you suggested, retaining 'space' as the pad character, and it worked the way I was seeking:

Code:

  (0x0300000B):SP_AD_INDICATOR_2    = '  '
  (0x0300000B):SP_AD_NUMBER_2         = '        '
  (0x0300000B):SP_AD_STREET_NO       = '13'
  (0x0300000B):SP_AD_STREET_NAME    = 'BOOTH                              '

...many thanks....however now I am confused! What is the explanation for this? Left justification is the default for 'PIC (X)', and was generated as I would have expected when the copybook was imported. The Help gives no indication that a 'Not Applicable' setting has a particular significance. How did you know about this??!!
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Mon Dec 01, 2003 2:04 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The 'Justification' property describes how the logical value of the string is parsed or written. It therefore affects trimming (when the message is parsed), and justification (when the message is written). In your case, the value was being trimmed, but you did not want it to be, so the solution was to set 'Justification' to 'Not Applicable'.
Maybe 'Not Applicable' would be better worded as 'No Justification'. The help could certainly be improved in this area.
Back to top
View user's profile Send private message
TonyD
PostPosted: Mon Dec 01, 2003 2:22 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Kimbert, thanks for comment. I must say that I am surprised at this. I have always thought that specification of Left (alphanumeric) or Right (numeric) justification, together with the appropriate pad character, would cause a fixed length field to be fully populated. I have never considered 'justification' to be associated with' trimming'. You are obviously correct as your suggestion worked ...I still find it strange however!!
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon Dec 01, 2003 11:29 pm    Post subject: Reply with quote

Jedi Knight

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

TonyD, so finally what is your Padding set to for this element? I'm pretty sure that the behavior you are seeing is controlled by Padding Char.
_________________
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
TonyD
PostPosted: Tue Dec 02, 2003 2:10 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

I have 'space' as the pad character. Before starting the thread I had experimented with 'null' but it did not make a difference.
My confusion is further compunded by the fact that in an output MRM message, also based on an imported Cobol copybook, fields that are defined as left-justified, space-padded, are correctly built when I 'set' them to values are less than the specified fixed length....no need to set 'Not Applicable' here. They do appear in the trace output, following the Compute node where they are created, without the trailing spaces, but are correctly represented in the queue following MQOutput.
I will have to investigate this further!
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Trailing blanks in fixed-length MRM field question
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.