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 » Length not set while import C

Post new topic  Reply to topic
 Length not set while import C « View previous topic :: View next topic » 
Author Message
yaakovd
PostPosted: Mon Nov 30, 2009 9:17 am    Post subject: Length not set while import C Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

Hi

While create a new message definition (CWF) file from a C header file, length of fields is not set.

Any explanation, solution, workaround?

I'm using Toolkit 6.1 with fix 4
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
smdavies99
PostPosted: Mon Nov 30, 2009 9:56 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Could you post a sample of the C header file?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Dec 01, 2009 6:12 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

It actually set part of lengths and even parse somehow, but result is completelly wrong....

Code:
struct trans_tail_                     //OFS   Description
{
    unsigned char nu;                  //44   Keep for high byte part offset

   unsigned char TwoPO_checker_sign   :1;   //45   For 2 person operation
   unsigned char opt_master_trans      :1;   //45   Master transaction of events (FSD14741)
   unsigned char opt_fuel_test         :1; //45    Pump Test ticket (FSD58636)
   unsigned char nu_flags            :5;   //45   Not used

    unsigned char ext_pos_no;            //46   External POS number
   
    unsigned char ext_device             :4;//47   External device number
    unsigned char quick_till             :1;//47   QUICK POS (Tesco)
    unsigned char dock_till              :1;//47   QUICK docking (Tesco)
    unsigned char opt_scanpoint_item_till:1;//47   SCANPOINT
    unsigned char nu2                :1;//47   
   
    unsigned short ticket_no;            //48   Ticket number
     char date[6];               //50   Date (YYMMDD in BCD)  Yaakov BCD change
     char time[6];               //53   Time (HHMMSS in BCD)  Yaakov BCD change

    unsigned char opt_return_ticket :1;      //56   Return ticket
    unsigned char opt_training_mode :1;      //56   Training mode ticket
    unsigned char opt_pc_generated  :1;      //56   Record generated by MFS/LFS
    unsigned char opt_pos_offline   :1;      //56   POS was offline
    unsigned char opt_void_ticket   :1;      //56   Ticket was voided
    unsigned char opt_bad_record    :1;      //56   Ignore record
    unsigned char opt_store_count   :1;      //56   Store stock count TRS (Tesco)
    unsigned char opt_wastage_mode  :1;      //56   Tesco

    unsigned short cashier;               //57   Cashier number
    unsigned char pos_no;               //59   POS number
    unsigned short seq_no;               //60   Record sequence number

    unsigned char pc_no         :4;         //62   PC number (1 or 2) receiving TRS from POS
    unsigned char trans_version :4;         //62   TV number
    unsigned char qdx;                  //63   QuickDex flags
};                                 //64


_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Wed Dec 02, 2009 5:10 pm    Post subject: Re: Length not set while import C Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

The C struct contains bit fields. It's likely that MRM does not support a corresponding BIT data type.

The import wizard generates a *.report.txt file; check that for warnings or errors during import.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Fri Dec 04, 2009 6:24 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

no errors, no warnings

Code:
Elapsed time processing this message definition file: 0.5 seconds
Number of warnings for this message definition file: 0

Number of files processed: 1

but still result is not correct
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Fri Dec 04, 2009 8:16 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Looks like a defect -I suggest that you raise a PMR.
Please reference this thread in the PMR - it will provide useful background for the responder.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Dec 15, 2009 1:36 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

PMR 63449,003,756

and answer given (unfortunatelly not really helps ):
Quote:
the problem which you described in pmr 63449,003,756 is a known limitation / issue when importing C header files in WMB Toolkit - see the following URL:
http://www-01.ibm.com/support/docview.wss?rs=849&context=SSKM8N&context=SS3GH2&context=SSKMAB&q1=swg21219996&uid=swg21219996&loc=en_US&cs=utf-8&lang=en
in particular Defect T23384 on the above url.
Ingeneral as a workaround of the above limitations, if the C header file fails to import, the header file must be corrected before importing again. If the file imports successfully, the resulting message model can be corrected using the message definition editor.


meaning of all these open defects that MB cannot be used for project, where we need define about 1000 structures with 35-30 fields each since we will need fix C file of 17000 rows or create everything manually.
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
shanson
PostPosted: Tue Dec 15, 2009 6:00 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Before you get upset with the C importer, are you aware that the MRM parser does not support BIT fields either? So, even if you managed to import the header files, the MRM parser could not use them.

You need to create a script that pre-processes your C header files, and where it encounters bit fields, collapses them into a single unsigned char or unsigned int. Then the files will import, but more importantly the MRM can parse them. In your ESQL/Java logic, if you need to examine or set the value of bits, you need to break apart the byte and use bitwise operations.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Dec 15, 2009 2:00 pm    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

thanks, already understood how deep the problem...

What is the best way to do that in ESQL? any short-cut?
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Tue Dec 15, 2009 2:49 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hello,

There is no shortcut to writing the code I'm afraid. The ESQL functions of interest are BITAND, BITOR, BITNOT and BITXOR and these are documented in the infocenter.

Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
yaakovd
PostPosted: Tue Dec 15, 2009 3:16 pm    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

Of cource, but I mean for any sophisticate way to translate
for example hex string "A2" to bit-string "10100010" without running BITAND 8 times.

Code:
CREATE FUNCTION FormatBits8(IN INDSET INT)
RETURNS CHAR
BEGIN
   DECLARE bitStr CHAR '';
   DECLARE J INT;
   DECLARE I INT 0;
   WHILE (I < 8) DO
      SET J = CAST(POWER(2,I) AS INT);
      SET bitStr = bitStr || CAST (BITAND(INDSET, J)/J  AS CHAR);
      SET I = I + 1;
   END WHILE;
   RETURN bitStr;
END;   

_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Dec 16, 2009 2:35 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
I mean for any sophisticate way to translate for example hex string "A2" to bit-string "10100010" without running BITAND 8 times.


As it happens there is :

Code:

DECLARE inputData INTEGER 0xA2;
SET OutputRoot.XMLNSC.Top.ResultCAST = RIGHT( CAST( inputData AS BIT ), 8);


The CAST to BIT creates a BIT string of length 64 (as INTEGERS are 64bits in ESQL) so the RIGHT function is used to only take (in this case) the last 8 BITs. Another tip is that all the ESQL string functions operate on BIT strings as well as CHAR and BLOB strings.

So the output from this code is:
Code:
<Top><ResultCAST>10100010</ResultCAST></Top>



Hope this helps,


Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Length not set while import C
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.