@INROWNUM ?

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

DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

@INROWNUM ?

Post by DeepakCorning »

What Exactly in @INROWNUM??

My Understanding was @INROWNUM is the input row Counter and is independent of the Table Count. But in One of my job the value that the @INROWNUM has is the Count in the table and I am not at all able to understand this. Is my understanding of the variable wrong???
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

You are right that it is the input row counter. But I am not clear when you say Table Count. What are you referring to as a table count and where exactly are using this variable? In the constraint section or in the derivation? and for what are you using it?
Kris

Where's the "Any" key?-Homer Simpson
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

I am using it in My logic... X should get a value when @INROWNUM = 1 (For the First row) and some other row if @INROWNUM > 1 and I am using this logic from years but Today for one environment the variable is not working correct. Its not getting assigned 1 at all.
I really appreciate your help in this matter...
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

You will have to be more clear on what exactly you are tying to do? From what I understand you are using it in a derivation where in you are trying to collect some values based upon your @INROWNUM variable value. Is that correct? If so, are you also defining any constraint in the Transformer?If so, looks to me that the first row from the input doesn't qualify for the constraint and hence not picking the first row. If now, please answer the questions asked in the earlier post.

HTH
Kris

Where's the "Any" key?-Homer Simpson
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

I am sorry if I did not give you the full details of the job and confused you.
I am trying to assign a column a value depending on the whther the row is the first one to flow in the job or not. If it is the first row to get processed in the job then the column should get calculated differently and when it is second,third.... then it should get a different value. The probelm that I am having is the Variable @INROWNUM is not getting set to "1" (I populated a sequential file with all the values thatI am getting for this variable and the first one is "2" instead of "1") and hence the logic is not working. No, I am not using it in any kind of constraint.
So I just wanted to know that if there are any reasons of this variable not getting a value 1 for the first row.
Let me know if you have any more doubts.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I have severe doubts about your claim. @INROWNUM is always assigned 1 for the first row input.

Of course, due to output constraints this row may not be output, but what I say is, and remains, true.

Perhaps you want @OUTROWNUM ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

I agree Ray. But here is what I m observing in my job - If I set the job to run for only 947 rows then the @INROWNUM value starts from 1 and goes upto 947 but if I run it for more than 947 rows then it starts from 2 and the value of 948 repeats twice and it goes upto the final rowcount.
I know its hard to blv but can not help its happening :(--

Let me try to paste the data (The Last column is the inrownum)

6006.00000,945.00000,946.00000
6006.00000,946.00000,947.00000
6006.00000,947.00000,948.00000
6006.00000,948.00000,948.00000
6006.00000,949.00000,949.00000
6006.00000,950.00000,950.00000
uegodawa
Participant
Posts: 71
Joined: Thu Apr 27, 2006 12:46 pm

Post by uegodawa »

Have you tried with @OUTROWNUM. Because I had a similar issue and I used @OUTROWNUM to solve the problem.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Is your transformer connected to another active stage? Try turning off row buffering if that's the case.

Mike
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

I am actually doing the calculation in stage variables so OUTROWNUM will not work in the stage variables. But if no choice then I have to use that variable.
But it still leaves the question why this system variable is not working??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't think it's possible to answer your question without seeing the actual job and what you are doing in it. As in posting a dsx export of it somewhere.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How do you set the job to run only 947 rows? If it is via the normal job execution call then I've tried the same thing and can't reproduce your problem with AIX and 7.5
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Yes the usual way , while running it gave a option to run for specific number of rows.

And its not happening with any other job but only with this one. I am not modifying the param anywhere , not filtering out anything but still. Strange fact is it starts from 2 and repeats at 948 no matter what you do and how you run :)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

By the way, what is second columna and what is third column?
Have you given any constrains, used in any stage varialbe?
Try to map this value in a integer.
What is the job design and what are you trying to acheive?
Hope you have tried running in a sequential mode too.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

The Third Column and the second column are just counters which depends on the INROWNUM value. But as the INROWNUM is not getting the value 1 they are starting with wrong values.
I am just trying to assign the counters values depending on if it is the first row in the stage or not.
No Constraints on the variable in the job and also I am not using it anywhere other than this stage.

And one more thing that i tested is that the value is getting wrong value only in this "stage". Right now I changed my logic to go after the inrownum in the previous stage but I am really curious to know why this happens and whts the solution to this?
Post Reply