to split date from the date record in DDYYYY format

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
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

to split date from the date record in DDYYYY format

Post by yaminids »

Hello there,

This is my first post even thougn I was reading other messages from a long time. I think its a great forum for anybody who wants information about Ascential products
Let me explain about my question. I am trying to separate date from a date record in 'ddyyyy' format. can anyone expalin to me how to achieve this.
Thanks in advance.

-Yamini
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
converting dates to any givven format has more then 1 way of doing it.

the conventional way:
Use Oconv() and Iconv() to get dates from any format to internal DS format and then back to a format of your choice.
(read the help on ussage of theese routines).

the substring way:
if you have a date format of "2004-29-10" in a column col1 (since it is easily treated as a string)
you can write something like this:
link1.col1[6,2] : link1.col1[1,4]

now you only need to pick and write.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: to split date from the date record in DDYYYY format

Post by chulett »

yaminids wrote:I am trying to separate date from a date record in 'ddyyyy' format.
Did you perhaps mean 'dddyyyy' format? :? If so, there is a 'Julian' conversion option for Iconv that would do that for you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
changming
Participant
Posts: 68
Joined: Wed Oct 13, 2004 3:35 am

Post by changming »

agree with the above. just add some details
this is from help file
J outputs the day of the year as a number, 1 through 366.
sample :
X = Oconv(10740, "D2*JY") X = "147*97"
conver any date into internal date , then convert back using oconv
Post Reply