|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DATE and TIMESTAMP issue |
« View previous topic :: View next topic » |
Author |
Message
|
mail2me.venky |
Posted: Mon May 28, 2012 11:15 pm Post subject: DATE and TIMESTAMP issue |
|
|
Apprentice
Joined: 11 May 2012 Posts: 26
|
My input date is 2012-05-21-12.14.43.770425+120
i want to to set the value for the following fields
SET OutputRoot.MRM.X.Y.Y_YR;
SET OutputRoot.MRM.X.Y.Y_DASH1;
SET OutputRoot.MRM.X.Y.Y_MNH;
SET OutputRoot.MRM.X.Y.Y_DASH2;
SET OutputRoot.MRM.X.Y.Y_DAY;
SET OutputRoot.MRM.X.Y.Y_DASH3;
SET OutputRoot.MRM.X.Y.Y_HOUR;
SET OutputRoot.MRM.X.Y.Y_DOT1;
SET OutputRoot.MRM.X.Y.Y_MIN;
SET OutputRoot.MRM.X.Y.Y_DOT2;
SET OutputRoot.MRM.X.Y.Y_SCD;
SET OutputRoot.MRM.X.Y.Y_DOT3;
SET OutputRoot.MRM.X.Y.Y_MSCD;
SET OutputRoot.MRM.X.Y.Y_SIGN;
SET OutputRoot.MRM.X.Y.Y_UTC;
which is right way to do it. ? EXTRACT FUNCTION or SUBSTRING?
I saw that from the EXTRACT function MSCD,SIGN, UTC could not be extracted
am i right ?
is there any other way to do it?
Tx
varun
 |
|
Back to top |
|
 |
kimbert |
Posted: Mon May 28, 2012 11:40 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
which is right way to do it. ? EXTRACT FUNCTION or SUBSTRING? |
Not this way. You have not explained the requirement. Where does the input data come from? If you are talking about using EXTRACt or SUBSTRING then you must have a string that contains the source data value. So why not use the facilities of the MRM parser to help you. Change the type in the input message definition to xs:dateTime and set the pattern correctly. The MRM parser will create a DATETIME field in InputRoot.MRM. If you want a different pattern in the output message, use a different message definition that specifies a different pattern for the dateTime.
Same logical dateTime value, different input and output formats. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 29, 2012 1:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I do not think you can use EXTRACT to get the values of DASH1, DASH2, or etc.
I do not think you have any real, legitimate need to get the values of DASH1, DASH2, etc.
As Kimbert says, use MRM or DFDL datetime parsing or at least CAST to extract the logical fields of the datetime values and then to reconstruct the transformed values into another datetime. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|