Date conversions

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
iamnagus
Participant
Posts: 48
Joined: Wed Sep 29, 2004 1:16 am

Date conversions

Post by iamnagus »

How Many types of syntaxes available for date conversions in MODIFY stage.

can any one brief about this
ray.wurlod
Participant
Posts: 54582
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

Lots. See Orchestrate Operators manual, particularly the chapter on the modify operator. Here are the main ones:
date_from_days_since[date](int32)
date_from_julian_day(int32)
date_from_string[date_format](string)
date_from_ustring[date_format](ustring)
month_day_from_date(date)
weekday_from_date[origin_day](date)
year_day_from_date(date)
days_since_from_date[source_date](date)
julian_day_from_date(date)
month_from_date(date)
next_weekday_from_date[weekday](date)
previous_weekday_from_date[weekday](date)
string_from_date[date_format](date)
ustring_from_date[date_format](date)
year_from_date(date)
year_week_from_date(date)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
leomauer
Premium Member
Premium Member
Posts: 100
Joined: Mon Nov 03, 2003 1:33 pm

Post by leomauer »

I am having very hard time with modify:
ray.wurlod wrote:Lots. See Orchestrate Operators manual, ustring_from_date[date_format](date)

Tried
L_MOD_DATE:Date = date_from_ustring "%yyyy-%mm-%dd" (L_MOD_DATE)

Got runtime abort with message:
main_program: Error parsing modify adapter: Expected ';' or end, got: ""%yyyy-%mm-%dd""
Expected destination field selector, got: ")"; input:
L_MOD_DATE:Date = date_from_ustring "%mm-%dd-%yyyy" (L_MOD_DATE)
;
I have no idea how else the call may look like.
Please help.
Last edited by leomauer on Fri Jun 27, 2008 6:50 pm, edited 1 time in total.
leomauer
Premium Member
Premium Member
Posts: 100
Joined: Mon Nov 03, 2003 1:33 pm

Post by leomauer »

Got it finally. It is actually with squre brckets
L_MOD_DATE:Date = date_from_ustring ["%mm-%dd-%yyyy"] (L_MOD_DATE)

Usually squre brckets used to denote optional parameters, here it is both.
The date format is either optional (with default format yyyy-mm-dd) or actully in square brackets.
sreddy
Participant
Posts: 144
Joined: Sun Oct 21, 2007 9:13 am

Re: Date conversions

Post by sreddy »

Hi


Go through this like you can found many date conversions.




http://mike2.openmethodology.org/wiki/A ... ming_Guide



iamnagus wrote:How Many types of syntaxes available for date conversions in MODIFY stage.

can any one brief about this
SReddy
dwpractices@gmail.com
Analyzing Performance
Post Reply