Date 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
rafidwh
Participant
Posts: 179
Joined: Mon Oct 10, 2005 11:30 pm

Date format

Post by rafidwh »

Hi All,

I have a flatfile as a source and oci as target

I have two date columns where the source data is in YYMM format now I need to change the format like CCYYMMDD

here DD is hard coded value
but for CC, if YY>79 then CC is equal to 19 so i should append 19 to YYMM if CC<79 then CC=20

Can anyone suggest how to achieve this

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

Post by ray.wurlod »

Code: Select all

(If Left(InLink.TheDate,2) > 79 Then "19" Else "20") : InLink.TheDate : svDayNumber
Are you sure that this will always cover only the 20th and 21st centuries?

Also investigate the CENTURYPIVOT configuration parameter for DataStage (in the uvconfig file) - by default a two digit year is in the century 1930 through 2029, but this can be changed on a system-wide basis if that's what your business rules prescribe.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Hi,

Try following
Var1=INT(LEFT("YYMM",2)) ----- this will give the year

if Var1>79............................................

Thanks,
Anupam
Post Reply