stage variables

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
DSbox61
Premium Member
Premium Member
Posts: 62
Joined: Mon May 22, 2006 10:18 am

stage variables

Post by DSbox61 »

Hi,

I have a condition where i need to apply a constraint to one of my link. I have set of records ordered by column1. I want to check whether the current column1<>previous column1. I want to use this as a constraint to my output link.

can i make use of this in stage variables.

i used them as follows:
in stage variables
---------------------------
stagevar1=inputlink.column1
stagevar2=stagevar1

constraint
----------------------
stagevar2<>stagevar1

column derivation
------------------------
outputlink.column1=inputlink.column1

need help guyzzz..
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

Code: Select all

stgvar1:
if  column1 <> stgvar2 then 1 else 0
stgvar2:
column1

pass all of those for which stgvar1 = 1. before the transformer make sure to sort data on column 1
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Re: stage variables

Post by meena »

Hi,

Code: Select all

 SV1:column1
 SV2:If SV1=SV3 then 1 Else 0
 SV3:SV1

 Constraint::SV2=0
Check this. Else you can do a search in the forum as this is discussed many times here..
DSbox61
Premium Member
Premium Member
Posts: 62
Joined: Mon May 22, 2006 10:18 am

Post by DSbox61 »

Thnxx a lot folks....
It works now.....
Post Reply