How to format current date as string in parameter

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jcook
Participant
Posts: 3
Joined: Wed Aug 31, 2011 1:21 pm
Location: Cincinnati, OH
Contact:

How to format current date as string in parameter

Post by jcook »

I want to pass the current date to to a job as a parameter from the sequence. I am calling DSJobStartDate for the parameter to the job. However, I'd like to reformat this to a string in the format of 'DD-MON-YYYY'. Yet, I cannot identify a function to do this type of reformatting of the current date in the parameter expression. Is this possible and what function could I use to reformat the current date into a string?
Jeff Cook, CBIP
Principal Consultant
Pinnacle Solutions Group, Inc.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: How to format current date as string in parameter

Post by SURA »

Use routine.

DS User
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

Oconv(Iconv(DSJobStartDate, "DYMD"), "D-DMY[2,A3,4]")
See also this article.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jcook
Participant
Posts: 3
Joined: Wed Aug 31, 2011 1:21 pm
Location: Cincinnati, OH
Contact:

Problem solved

Post by jcook »

Thanks, Ray. That fixed my problem! :D
Jeff Cook, CBIP
Principal Consultant
Pinnacle Solutions Group, Inc.
Post Reply