Remembering past occurrence

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

Remembering past occurrence

Post by gateleys »

Hi,
I have a situation where I need to keep track of some past occurrence of a field value. Example: If InLink.Column = 'remember me' then I set a stage variable svIsRemember = 1. Now, as I process through other records, I check for occurrence of anohter string InLink.Column = 'String to change', that is EREPLACED with 'new String' if svIsRemember = 1. Note: svIsRemember is reset (=0) if I encounter a column with string 'Stop Remember'.

I could do it if I could write an IF statement without the ELSE clause. Can anyone suggest how I could do this?
Thanks,

gateleys
Klaus Schaefer
Participant
Posts: 94
Joined: Wed May 08, 2002 8:44 am
Location: Germany
Contact:

Re: Remembering past occurrence

Post by Klaus Schaefer »

Hi,

I'm not sure if I got your point, but on a stagevar derivation you can specify something like

If in.field1='xxx' then 1 else stagevar

to keep the contents of stagevar "untouched" in the else case.

Best regards
Klaus
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Yeah, what Klaus said. :lol:
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

AAAHH!! :oops: Its been a loooonnngg week. Thanks.

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

Post by ray.wurlod »

In an expression you can not use statements. The conditional expression (IF test THEN value ELSE value) is an expression; it must always return a value and must, therefore, always have both a THEN part and an ELSE part.

The IF statement is only available in Routines.
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