MMYY + oconv?

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
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

MMYY + oconv?

Post by jshurak »

I have a job that extracts a monthly table. The table has the 2 digit month and year format at the end. this is what I've been using

Code: Select all

If ReportDate = 0 Then
ReportDate = CONVERT("/","",OConv(@DATE - 7, "D/MY[Z,2]"))
End
It worked normally........until we rolled over to January. This bit of code doesn't use '0' as part of the month. ie. 108 instead of what I need '0108'.

Any suggestions?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is your target data type?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

Post by jshurak »

I'm sorry. This is just needed to pass the correct table name. Its the table name that has the 'mmyy' at the end.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok. Use the following

Code: Select all

If ReportDate = 0 Then 
ReportDate = CONVERT("/","",OConv(@DATE - 7, "D/MY[2,2]")) 
End
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jshurak
Participant
Posts: 74
Joined: Mon Jan 09, 2006 12:39 pm

Post by jshurak »

thanks!
Post Reply