Page 1 of 1

Transform in Routine

Posted: Tue Apr 04, 2006 3:56 pm
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.

Posted: Tue Apr 04, 2006 3:58 pm
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.

Re: Transform in Routine

Posted: Tue Apr 04, 2006 9:58 pm
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