Focal Point
Changing Values of previously computed variables

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6131036762

January 23, 2008, 07:54 AM
<Darron>
Changing Values of previously computed variables
I am using datamigrator 7.60 and have written a stored procedure where i set the value of a field in compute i cannot reset the value of that field with another compute as it keeps the value of the first compute
IE
COMPUTE Dte/A20V=DATECVT(HDATE(EffDate,'YYMD'),'YYMD','A8DMYY') ; NOPRINT
COMPUTE ValDte/A20V = EDIT(Dte,'99/99/9999');

Dte =01011900
ValDte = 01/01/1900

and futher on in the same print i try and use the DTE variable again

COMPUTE Dte/A20V=DATECVT(HDATE(EffDate,'YYMD'),'YYMD','A8DMYY') ; NOPRINT
COMPUTE ValDte1/A20V = EDIT(Dte,'99/99/9999');

Dte =23062005
but
ValDte1 = 01/01/1900 (This should = 23062005 )

Help
Ps there also seems to be a limitation on the length of a line that can be used by datamigrator , that is why i have had to break the date transforms into two lines , any idea about this ?
January 23, 2008, 09:17 AM
GinnyJakes
COMPUTEs are done after all the data is processed. The COMPUTE is performed on the summarized field in the sort group. For any given sort group, the input value will always be the same. Having multiple computes in the same sort group will buy you nothing because the input data is always the same.

Can you do a DEFINE? That is a row-level computation.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 23, 2008, 09:29 AM
GamP
And then you should also keep in mind that fieldnames in any given request should be unique.
If not, you might end up with unexpected results. Like in this case, what probably happens is that the second compute for valdte will use the first computed dte field.
But that is just my guess.
What happens if you use really unique compute names, such as dte1/dte2 and valdte1/valdte2?

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988