Iconv Issue in Different Versions

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
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Iconv Issue in Different Versions

Post 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.
Thanks & Regards,

Zabi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Examples?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Post 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
Thanks & Regards,

Zabi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Post 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")
Thanks & Regards,

Zabi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Post by Zabeerulla »

Hi,

Otherwise please tell me how to disable the NLS settings for a particular project.
Thanks & Regards,

Zabi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Zabeerulla
Participant
Posts: 38
Joined: Tue Jan 10, 2006 1:25 am

Post 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.
Thanks & Regards,

Zabi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Zabeerulla,

did you look at the NLS Guide as suggested earlier? Look at page 2-4 to start with.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply