LastRowInGroup

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
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

LastRowInGroup

Post by Rob4732 »

I have read several threads pertaining to the LastRowInGroup(), LastRow() and LastTwoInGroup() functions.

I want to include one of the above functions in the derivation of a staging var, but none seem to be there. Only see the standard functions(Date & Time, Mathematical, Null Handling, String, etc...)

There is probably a simple answer to this and I'm not seeing it.

Thanks

Robert

P.S. - I also don't see the system variable @ITERATION.
We don't see things as they are;
We see them as we are.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Since you didn't specify, let's get this out of the way - are you running the 8.5 release?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Yes, running 8.5

thx
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you seeing a Loop Condition area in your Transformer stage? If not, was this job upgraded/imported from an earlier version? If so, create a new job with a new instance of Transformer stage and let us know what you can find in that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Hi Ray,

Yes, there is a loop condition in the transformer. Job was created in datastage 8.5.

I also created a new job in 8.5(in case something was corrupt in my original job), but see same problem in new job.


I have created a PMR with IBM.

Thanks
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I suspect @ITERATION system variable is only visible if you're editing an expression with the Loop area.

Functions LastRow() and LastRowInGroup() are in the functions tree (even when editing stage variable or output link expressions) in the Last Row Handling branch of the functions tree.

There is no LastTwoInGroup() function unless you create your own.

I'm currently running on Red Hat Linux, and the above is what I have verified.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Thanks.

I currently don't have the 'Last Row Handling' branch in the function tree.

I also added the following to my 'loop condition':

@ITERATION <= 3

Note - I had to type in @ITERATION, as it is not available for selection.

When I validate the 'loop condition', I get the following message:

variable @ITERATION not defined.

Thanks for the input. :)
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the Repository open \Stage Types\All\Processing\Transformer Stage - does it have a 2010 IBM copyright on the Creator page?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Below is text in the copyright box from the Creator tab of \Stage Types\All\Processing\Transformer:

Licensed Materials - Property of IBM, (C) Copyright IBM Corp. 1999, 2010 All Rights Reserved.


On a side note, we installed 8.5 about a month ago and this is the first time we have tried the looping functionality. Not sure if we missed something in the install.

Thx
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's nothing special in the install. I'm now out of ideas, you seem to have the correct version of the stage (it has a Loop Condition area), so we'll wait to hear what IBM support have to say.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
acx_dyates
Participant
Posts: 2
Joined: Thu Oct 21, 2010 9:44 am
Location: Plano, TX

Re: LastRowInGroup

Post by acx_dyates »

Rob4732 wrote:I have read several threads pertaining to the LastRowInGroup(), LastRow() and LastTwoInGroup() functions.

I want to include one of the above functions in the derivation of a staging var, but none seem to be there. Only see the standard functions(Date & Time, Mathematical, Null Handling, String, etc...)

There is probably a simple answer to this and I'm not seeing it.

Thanks

Robert

P.S. - I also don't see the system variable @ITERATION.
Do you have an old DSParams by chance (from an earlier version?)
--- Doug
acx_dyates
Participant
Posts: 2
Joined: Thu Oct 21, 2010 9:44 am
Location: Plano, TX

Re: LastRowInGroup

Post by acx_dyates »

The 8.5 DSParams should have entries like:

[parallelonly-system-variables]
@PARTITIONNUM
@NUMPARTITIONS
@ITERATION\O\!V

...and would also include the function entries that you mentioned uder the section below.

[parallelonly-functions]
--- Doug
Rob4732
Premium Member
Premium Member
Posts: 66
Joined: Mon Oct 06, 2008 5:14 pm

Post by Rob4732 »

Thanks Everyone for the suggestions.

I was about to post the solution when I read acx_dyates post, which describes what IBM found to be the problem also. We replaced our 8.5 DSParams file with an 8.1 version(resulting in missing functions, sysvars and probably other things in our 8.5 environment). DSParam files are NOT plug and play between earlier versions of datastage and 8.5. Replacing our 8.1 version of DSParams back to the 8.5 version solved the problem. Of course we have to re-enter our 8.1 env var info and settings via admin again in 8.5.

Thx

Robert
We don't see things as they are;
We see them as we are.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a Migration Assistant tool that, among other things, looks after merging modified DSParams files.
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