Date formating help needed

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Date formating help needed

Post by sagar deshmukh »

How to convert mm/dd/yyyy to yyyy-mm-dd in transformer stage.I dont want to use substring
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First IConv() with a mask matching your input format, then OConv() on that result with a mask matching your desired ouput format.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

i did not get you, Can you please give the example of the format, am getting compilation error
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What did you try? Can you post what is causing your compiler errors?

The formats are all in the online help, for example find IConv function (BASIC) in the Index, go there, scroll down to the Date Conversions section and then click on the "D" for a detailed description of that code and how it is used.

Don't forget you can inline the two functions, call one inside the other, so both easily work on the same input data.

ps. This is core Server stuff, you need to learn how to use IConv/OConv to convert your data, especially dates. I don't believe in Silver Platter answers, you'll learn more and it will stick way more better if we nudge you in the right direction and you work the rest of it out for yourself.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

Well, i got it...Some bracket missmatch happned...
evry time we have to use both Iconve and Oconv?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you don't want to (or can't) substring, then yes you need both to go from one external representation to another.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you're good now, please mark the post as Resolved using the button at the top of the screen.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply