DB2 date format

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

Post by ray.wurlod »

What is the value coming in from DSLink8.PROCESS_DT ?

Capture this using stage tracing or the Debugger or an extra output from the Transformer stage to a text 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.
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Post by naren6876 »

ray.wurlod wrote:What is the value coming in from DSLink8.PROCESS_DT ?

Capture this using stage tracing or the Debugger or an extra output from the Transformer stage to a text file. ...
The value coming in that link is 20070627

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, now output FMT(DSLink8.PROCESS_DT, "L####/##/##") to establish whether the problem is in Fmt() or Iconv().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

What is the source datatype? and what is the target db2 date format?

Depending upon your target format, use iconv and oconv function accordingly like

Code: Select all

Oconv((Iconv(DSLink8.PROCESS_DT,"DYMD")),"D-YMD[4,2,2]")
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please also output Len(Fmt(DSLink8.PROCESS_DT, "L####/##/##")) and Quote(Fmt(DSLink8.PROCESS_DT, "L####/##/##")) so we can be sure there are no non-printing characters?

Although theoretically unnecessary, try being specific about the format in the Iconv() function.
Iconv(Fmt(DSLink8.PROCESS_DT, "L####/##/##"), "D/YMD[4,2,2]")
or
Iconv(Left(Fmt(DSLink8.PROCESS_DT, "L####/##/##"), 10), "DYMD")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Post by naren6876 »

ray.wurlod wrote:Can you please also output Len(Fmt(DSLink8.PROCESS_DT, "L####/##/##")) and Quote(Fmt(DSLink8.PROCESS_DT, "L####/##/##")) so we can be sure there are no non-printing characters?

Although theoretic ...
The output of
Len(Fmt(DSLink8.PROCESS_DT, "L####/##/##")) = 10

Quote(Fmt(DSLink8.PROCESS_DT, "L####/##/##"))
and I am not able to use the Quote and receiving message like

variable 'Quote' not defined.

Thanks in advance.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

naren6876, add a parenthesis, the line is

Code: Select all

Quote(Fmt(DSLink8.PROCESS_DT, "L####/##/##")))
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Two lefts and three rights, Arnd? :wink:

DQuote or SQuote, there is no Quote.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Craig - I guess I really can't count. Silly me.

Naren6876 - Please ignore my earlier post and follow Master Craig's suggestion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There IS a Quote function - I use it a lot.

Quote is not in DSParams, but you can put it there so that it should compile and run successfully. But DQuote or SQuote will serve as well for the current purpose.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There is? It didn't come up in the ellipsis list of functions and the OP's error suggested it didn't exist. The online help has an entry for Quote but actually brings up DQuote. :?

I'll take your word for it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As noted, 'tis not in DSParams.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, 'tis not in the Help either. :wink:
-craig

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