Arithmetic with Modify Stage?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hesubo
Charter Member
Charter Member
Posts: 7
Joined: Tue Jul 18, 2006 5:30 pm
Location: Salisbury, NC

Arithmetic with Modify Stage?

Post by Hesubo »

Can a modify stage be used to add or subtract two fields together into a new value? I'm getting the following error:

main_program: Error parsing modify adapter: Expected ';' or end, got: "-"; input:
trans_dt = trans_dt
;
store_nbr = storenum
;
wrkstatn_nbr = wrkstanum
;
store_id = storenum
;
func_id = functype
;
Prsnl_scnr_used_ind = Handle_Null(IND08, 0)
;
trans_qty = trans_qty
;
sls_amt = TotGrossPos - TotGrossNeg
;
sls_qty = sls_qty
;

obviously the error is related to the sls_amt calculation. Is this an indication that this type of calculation is not allowed in the Modify stage?
iamnagus
Participant
Posts: 48
Joined: Wed Sep 29, 2004 1:16 am

Post by iamnagus »

Yes you can't use modify stage to do arithmetic operations.

As for me,
Modify stage can be used to change the data types,sizes and to handle nulls i.e to defaults to nullable fields. Use trasnformer stage for your requirement.
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Arithmetic with Modify Stage?

Post by ashwin141 »

You can use modify stage for only follwing things

Dropping or Editing Columns
Changing Datatype
Null Handling

I guess it can't be used for Arithmetic Operations.

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

Post by ray.wurlod »

Almost nothing with two operands can be accomplished in the Modify stage. About the only exception is handle_null().

Substring is possible; concatenation is not. String length, raw length are possible.

Arithmetic using arithmetic operators is definitely not possible in a Modify stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply