Date to char transformation
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Date to char transformation
Hi,
Input is YYYY-MM-DD
Column type is Date(10)
Output should be YYYYMDDD
Outout type is Char ( 8 )
How to remove '-' from input to get output in transformer or modify stage. I am trying to use string_from_date but it is not working.
Example: Input : 9999-12-31
outPut: 99991231
Thanks for help!
Input is YYYY-MM-DD
Column type is Date(10)
Output should be YYYYMDDD
Outout type is Char ( 8 )
How to remove '-' from input to get output in transformer or modify stage. I am trying to use string_from_date but it is not working.
Example: Input : 9999-12-31
outPut: 99991231
Thanks for help!
Attitude is everything....
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Hi,
I used this function..
DateToString(DSLink3.DATE1)
I got following error:
Transformer_10,1: Internal Error: (length <= result.length()):date/conv.C: 562: Output string is not long enough to accomodate this format.
Traceback: msgAssertion__13APT_FatalPathFPCcRC11APT_UStringPCci() at 0xd3d806c0
convert__27APT_Conversion_UString_DateCFPCvPvT2() at 0xd36436f4
processInputRecord__65APT_TransformOperatorImplV0S10_test_date_to_string_Transformer_10Fi() at 0xd978e0c4
runLocally__22APT_CombinableOperatorFv() at 0xd376003c
run__15APT_OperatorRepFv() at 0xd36876a8
runLocally__14APT_OperatorSCFv() at 0xd3674054
runLocally__Q2_6APT_SC8OperatorFUi() at 0xd36f54ac
runLocally__Q2_6APT_IR7ProcessFv() at 0xd3771c68
executePlayer__18APT_ProcessManagerFP16APT_ScoreProcess() at 0xd3739d54
executeStep__FPC19APT_PMMessageHeader() at 0xd3806ed0
Can you tell me if the function syntax is correct. Date1 is input column with Date(10) type.
Thanks!
I used this function..
DateToString(DSLink3.DATE1)
I got following error:
Transformer_10,1: Internal Error: (length <= result.length()):date/conv.C: 562: Output string is not long enough to accomodate this format.
Traceback: msgAssertion__13APT_FatalPathFPCcRC11APT_UStringPCci() at 0xd3d806c0
convert__27APT_Conversion_UString_DateCFPCvPvT2() at 0xd36436f4
processInputRecord__65APT_TransformOperatorImplV0S10_test_date_to_string_Transformer_10Fi() at 0xd978e0c4
runLocally__22APT_CombinableOperatorFv() at 0xd376003c
run__15APT_OperatorRepFv() at 0xd36876a8
runLocally__14APT_OperatorSCFv() at 0xd3674054
runLocally__Q2_6APT_SC8OperatorFUi() at 0xd36f54ac
runLocally__Q2_6APT_IR7ProcessFv() at 0xd3771c68
executePlayer__18APT_ProcessManagerFP16APT_ScoreProcess() at 0xd3739d54
executeStep__FPC19APT_PMMessageHeader() at 0xd3806ed0
Can you tell me if the function syntax is correct. Date1 is input column with Date(10) type.
Thanks!
Attitude is everything....
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
Use DateToString(DSLink3.DATE1,"%yyyy%mm%dd") in your column derivation part , let the input be date (10) but in the output of transformer change it to char (8) .
Last edited by samsuf2002 on Fri Jun 08, 2007 7:51 am, edited 1 time in total.
hi sam here
Use convert or ereplace function in the transformer to remove "-" character from the input date like following
Code: Select all
Convert("-", "", DSLink3.DATE1)
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
We haven't heard from U is a while, but I note that U is still a registered member.just4geeks wrote:Hi DSguru,
U r right. I did not use it. Can u please tell me How can I use it.
I just used this : DateToString(DSLink3.DATE1)
Thanks!
The second person personal pronoun is spelled "you". The present tense plural form of the verb "to be" is spelled "are". Please take care to communicate professionally; it makes life easier for those posters (such as, one presumes, U from Burma) for whom English is not a first language.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA