Page 1 of 1

Iconv Issue in Different Versions

Posted: Sun Oct 08, 2006 10:14 pm
by Zabeerulla
Hi,

I have one routine with the below code.

Ans = Iconv(Arg1[1,8], "D")

The same routine with same passing values is returning different results on DataStage 7.1 without NLS and DataStage 7.5 with NLS enabled is giving different results. Please advice how to overcome this issue.

Posted: Sun Oct 08, 2006 11:17 pm
by chulett
Examples?

Posted: Sun Oct 08, 2006 11:35 pm
by Zabeerulla
Hi,

Examples:

DS 7.1 without NLS

Value Result
20060902 00:00:00.000 14125
19671231 00:00:00.000 0

DS 7.5 with NLS

Value Result
20060902 00:00:00.000 -389172
19671231 00:00:00.000 Nothing

Posted: Mon Oct 09, 2006 2:07 am
by ArndW
What happens when you correctly specify "D4YMD" instead of "D"? I'm not at a DS client now, but by setting NLS the default date format can change.

Posted: Mon Oct 09, 2006 2:20 am
by Zabeerulla
Hi ArndW,

The routine works fine in DS 7.51 with NLS version for the following codes:

Ans = Iconv(Arg1[1,8], "DYMD")

Or

Ans = Iconv(Arg1[1,8], "D ")

But if I want to use the same below code in both the versions, can you please tell me what I need to do.

Ans = Iconv(Arg1[1,8], "D")

Posted: Mon Oct 09, 2006 2:29 am
by ArndW
If you really need to keep the date format you will have to change your NLS locale so that the default date format matches the non-nls one. This is certainly not what I would recommend - using a "D" conversion, particularly on output, is an invitation for big trouble. Be as specific as you can. If you use ICONV/OCONV in a transform you should always make use of the STATUS function to see if the conversion was successful.

Posted: Mon Oct 09, 2006 2:36 am
by Zabeerulla
Hi,

Otherwise please tell me how to disable the NLS settings for a particular project.

Posted: Mon Oct 09, 2006 2:44 am
by ArndW
You can do almost everything for NLS with your administrator client. Please refer to the PDF online document NLS Guide for details on how to change your locales.

Posted: Mon Oct 09, 2006 4:55 am
by ray.wurlod
The difference is because of "with NLS enabled and without NLS". Without NLS the expected format of a date (since you only have "D" as the second argument of Iconv) is specified in a file called msg.text; with NLS enabled the default date format is specified in the TIME locale category. The first is probably month-day-year order, the second probably year-month-day order. You can check by trying Oconv(13579,"D") - this will generate a date using your default date format.

Posted: Mon Oct 09, 2006 5:41 am
by Zabeerulla
Can u please tell me how to change default date format when the NLS option is enabled. I just want to change the time from 24 hour format to 12 hour format.

Posted: Mon Oct 09, 2006 7:13 am
by ArndW
Zabeerulla,

did you look at the NLS Guide as suggested earlier? Look at page 2-4 to start with.

Posted: Mon Oct 09, 2006 3:25 pm
by ray.wurlod
You change the TIME category of your locale. This is probably most easily managed using the NLS.ADMIN menu in the UV account. You will, however, need some familiarity with the ED command line editor in DataStage or with DataStage SQL, since the category definition is a record in a hashed file.