Transform in Routine

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
Juls
Participant
Posts: 51
Joined: Tue Sep 14, 2004 9:17 am

Transform in Routine

Post by Juls »

Hi,

I get an error when compiling a routine that calls a transform. All I have in a routine for now is:
Ans=TAG.TO.DATE("2006-03-24");
and I get an error when I compile:

"Array 'TAG.TO.DATE' never dimensioned."

What am I missing? I also tried to use the following and I get the same error to dimension the function:
Ans=ConvertTag("2006-03-24", "I");


What's going on?

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

Post by ray.wurlod »

It is not possible to use Transforms within Routines. You can, however, copy the Transform's definition expression and use that in a Routine. In the case of a Transform that invokes another Routine (like TAG.TO.DATE) you will also need a DEFFUN declaration for that other routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Re: Transform in Routine

Post by rameshrr3 »

Hi

Copy the definition(source code) of TAG.TO.DATE from the transform and use it within the routine. Use an intermediate variable to store the result of the routine.

alternatively this is the way you could go about it

Ans = ICONV(Arg1,"D-YMD")

where Arg1 = "2006-03-24"

Thanks
Post Reply