Date conversions
Moderators: chulett, rschirm, roy
Date conversions
I want to convert the date format mmddyyyy to ddmmyyyy in MODIFY stage.
can any one explain the syntax for this.
can any one explain the syntax for this.
-
- Participant
- Posts: 9
- Joined: Fri Jun 01, 2007 12:14 am
Re: Date conversions
Why did you require the modify stage, you can directly do that using transformer.
Otherwise please let us know the exact recquirement
Thanks,
Karunakar
Otherwise please let us know the exact recquirement
Thanks,
Karunakar
karun
In a transformer use substring to format the output. The code would be as :
But, the output should be of Char/Varchar datatype.
Code: Select all
DateCol[4,2] : DateCol[1,2] : DateCol[5,4]
Thanks and Regards!!
dspxlearn
dspxlearn
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Date data types, as I explained elsewhere, do not have formats. It is only when they are represented as string data type that the format becomes relevant. If you have dates, as you state, then your question is moot.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The third position in a Modify stage is actually 2 because, in Modify stage, everything uses C language conventions, including zero-based counting. However, in a Transformer stage, one-based counting is used.
Further, the square-bracket notation for substring is not supported in the Modify stage; instead you would need the formulation.
But it won't do you any good because concatenation is not supported at all in the Modify stage, in which only single-input-field functions are possible.
Further, the square-bracket notation for substring is not supported in the Modify stage; instead you would need the
Code: Select all
substring[start,length](string)
But it won't do you any good because concatenation is not supported at all in the Modify stage, in which only single-input-field functions are possible.
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.
Hello and welcome to DSXchange, Eujish!
You are right that the date conversions in ICONV/OCONV can be used, but only in Server jobs (or server stages in PX/EE jobs), and this is a PX/EE thread so those two functions aren't an option.
You are right that the date conversions in ICONV/OCONV can be used, but only in Server jobs (or server stages in PX/EE jobs), and this is a PX/EE thread so those two functions aren't an option.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>