Page 1 of 1

date language

Posted: Wed Jun 27, 2007 10:24 am
by ivannavi
I need to write a date to a sequential file with a three letter abbreviation for month. My locale is set to Croatian, but I still get the English abbreviation.

The help says:
The locales define the local formats for dates, times, sorting order, and so on that the project can use (for Parallel jobs, locale only specifies sorting order).
So I guess this is why. I have tried a server job, but in the server job there is no option for "format string" in the sequential file stage.

Is there any decent way to accomplish this?

Posted: Wed Jun 27, 2007 11:19 am
by ray.wurlod
Investigate lookup_string_from_int16() function in Modify stage to generate the month names in Croatian.

Or build a Lookup File Set that you can use with a Lookup stage to return the month name and/or abbreviation corresponding to each month number. Use Entire partitioning; it's easiest with only 12 rows.

Posted: Fri Jun 29, 2007 9:25 am
by ivannavi
Thanks Ray,

It took me some time to get this "lookup_string_from_int16()" working. Never used it before (neither this, nor the Modify stage).

This solution actually requires me to extract the information about the month from date and then perform a replacement of the month (using the lookup_string_from_int16) with the abbreviation string, and then assemble all those pieces together to form the desired string.

I will call that a workaround. Resolved it will be in some future version of DataStage, I hope. Maybe version 8 already has this working out of the box...