Return value of RowProcCompareWithPreviousValue??

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
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Return value of RowProcCompareWithPreviousValue??

Post by gateleys »

1. What does RowProcCompareWithPreviousValue return after the comparison? Is it 1 if True and 0 when false?

2. Can I use IF(NOT(sv_ID)) to check for false condition( sv_ID is my stage variable which uses RowProcCompareWithPreviousValue to compare my current ID with previous ID)? Or will it be IF(sv_ID=0)?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Look at the source of the routine. Check the online help for the System Variables in particular the definition of @TRUE and @FALSE.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ppalka
Participant
Posts: 118
Joined: Thu Feb 10, 2005 7:25 am
Contact:

Re: Return value of RowProcCompareWithPreviousValue??

Post by ppalka »

gateleys wrote:1. What does RowProcCompareWithPreviousValue return after the comparison? Is it 1 if True and 0 when false?
Routine description:

The routine provides a persistent switch based upon the input data. If the supplied value compares with the previous value, 1 is returned, otherwise 0 is returned. This is useful in determining a grouping change.

This routine should not be used more than one place in a job. The previous value is shared with the routine RowProcGetPreviousValue, but this sharing will only work if the routines are used in the same process-chain of the job.

Example:

Input....................Returns

1.............................0
1.............................1
1.............................1
2.............................0
3.............................0
4.............................0
4.............................1
4.............................1
5.............................0
2. Can I use IF(NOT(sv_ID)) to check for false condition( sv_ID is my stage variable which uses RowProcCompareWithPreviousValue to compare my current ID with previous ID)? Or will it be IF(sv_ID=0)?
if sv_ID=0 then //when a new ID comes
Post Reply