IConv function behaving differently in DS 7.5.2 and 7.5

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

saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

IConv function behaving differently in DS 7.5.2 and 7.5

Post by saikrishna »

Hi


I am using IConv to find out the difference between two dates (i.e Date1 and Date2) in terms of days, as follows:

IConv(Date2,"D")-IConv(Date1,"D")

The format of dates in 7.5 are as follows:
Date1 format
YYYYMMDD
(Integer datatype)

Date2 format
"MM-DD-YYYY"
(char datatype)

We migrated our jobs to DS 7.5.2, then these two formats are not working with DataStage 7.5.2.


I tested that the following version is working fine with DS 7.5.2
"DD-MM-YYYY"
(char datatype)

I want your confirmation whether it works differently with the two versions.

I need your help in Date1 format. We are passing it as an argument (integer), How do I use IConv for this.


Thanks
Sai
ZDC
Premium Member
Premium Member
Posts: 15
Joined: Fri Nov 23, 2007 5:06 am

Post by ZDC »

Hi there,

Actually it sounds very strange.Could you provide some sample date data and differences in results in the DS versions.

Cheers,
ZDC
Zero Degree Consulting
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

The output in DS 7.5 for the following function is

IConv(20071118,"D")

Output:
14567


In DS 7.5.2 For the same function
IConv(20071118,"D")

Output :
-310248

Please let me know the solution.

Thanks
Sai
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Are you using NLS?
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would think the solution would involve a call to your official Support provider. I was only able to check 7.5.1A here and it returned the expected value.

Interesting... just saw Ken's question between previews. Curious to see if that will affect the answer.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsusr
Premium Member
Premium Member
Posts: 104
Joined: Sat Sep 03, 2005 11:30 pm

Post by dsusr »

[quote="kcbland"]Are you using NLS? ...[/quote]

Could you please explain the reason why it can behave with NLS enabled because in the guides it is written "avoid using ICONV/OCONV when NLS is enabled unless you fully understand the consequences"
ZDC
Premium Member
Premium Member
Posts: 15
Joined: Fri Nov 23, 2007 5:06 am

Post by ZDC »

Sai,

This is hit and trial solution,Please use Oconv function with different options for the value 14567 in 7.5.2 version and check out for which option it returns you value 20071118 or 2007 11 18 and then use that option.

if it didnt work then please contact ascential suport for this problem.

I hope this will help.

Cheers,
ZDC
Zero Degree Consulting
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Well, NLS makes ICONV/OCONV work differently. During the upgrade, maybe they installed NLS support by accident, which now makes ICONV/OCONV behave differently than its non-NLS mode.

I'm waiting to hear this answer, because anything else is guess work. In general, avoid the "D" option and try to explicitly state the format when known. "D-YMD[4,2,2]" is always better than just "D".
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

I just want to have confirmation,Is this behaviour because of NLS installation?

I dont know whether NLS is installed on my DS Server 7.5.2 or not, May I know, The way to check that.
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

I just want to have confirmation,Is this behaviour because of NLS installation?

I dont know whether NLS is installed on my DS Server 7.5.2 or not, May I know, The way to check that.
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

Hi

I just found that NLS button in administrator is enabled in new DS Server 7.5.2. Where as it is disabled in our previous DS server 7.5.

Taken that NLS is installed in my new machine, To make IConv to work, What should I need to do.

I mean, To get correct ouput from IConv for 20071118, What exactly I need to do

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

Post by chulett »

Not positive, but pretty sure one way to check is to see if you have an entry for NLSMODE in your $DSHOME/uvconfig file. No mention = not installed. If it is there, then seeing it set to 1 shows it as enabled, while 0 is disabled.

If you do have it installed and enabled and can afford to experiment a little: shutdown DataStage, change the value, 'regen' and then restart. Let us know if the behaviour changes back.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok, seeing as you now know it *is* installed, seems to me it would be best to follow Ken's advice and use the more explicit format he noted in his post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

Hi

Can you please give me the format code in IConv to recognize YYYYMMDD
(Integer)
Eg: To recognize 20071118, What to put in IConv format code?

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

Post by chulett »

DYMD[4,2,2] should work fine, I would think.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply