Using PromoteSubRecord With Compare stage

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
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Using PromoteSubRecord With Compare stage

Post by abc123 »

I am using a compare stage to compare 2 identical files except for one value in one row. I have a promote subrecord after the compare stage and a sequential file stage after that. However, I cannot get the data that is output by the compare stage into the promote subrecord stage. I looked in the Developer's guide and there is nothing specific about it. Example1 talks about a column called subrec.

Here are my incoming columns to the compare stage:

ColA: char(10)
ColB: char(10)
ColC: char(30)

They are the same for both links.

My questions are:

1)What would be the output column for the compare stage?
2)What would be the input columns to the promote subrecord stage? They should be the same as the output columns of the compare stage.
3)What would be the output columns of the promote subrecord stage?

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

Post by ray.wurlod »

1) diff (integer), source1row (subrecord), source2row (subrecord)

2) columns collection is a property of the link - it can't be different at the other end

3) depends on how you've configured the stage, but probably something similar to the original source input
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Ray, I don't see a subrecord datatype. For the output columns of the Compare stage, what would the datatypes be?

diff: integer
source1row: subrecord

1)What is a "subrecord" datatype?

The Guide says that the output columns are result, first and second.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

By the way, I am extremely disappointed in the Developer's Guide. All it does is describe a stage. It doesn't give any more details and there are very few examples. For example, for the Compare stage, it seems like you are expected to know what result, first and second are and how to use them. No where is it mentioned as to what their data types should be, how to make the data viewable or something similar. This is stuff that one would need to use the stage.
Ultramundane
Participant
Posts: 407
Joined: Mon Jun 27, 2005 8:54 am
Location: Walker, Michigan
Contact:

Post by Ultramundane »

abc123 wrote:By the way, I am extremely disappointed in the Developer's Guide. All it does is describe a stage. It doesn't give any more details and there are very few examples. For example, for the Compare stage, it seems like you are expected to know what result, first and second are and how to use them. No where is it mentioned as to what their data types should be, how to make the data viewable or something similar. This is stuff that one would need to use the stage.
I agree. I think the documentation is terrible and not even close to Enterprise Class. You should be very disappointed. I find the documentation to be more of a constant sales pitch than something technical.

This is my interpretation of the documentation:
Stage so very easy to use that entry level programmer can use without some documentation. The using of this stage is accomplished by moving mouse and grab stage to drop on pallette. Blanks should be filled, job compiled, and job ready for production. You not have problems because product so easy use.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My belief is that the manuals were produced when no-one in Ascential really had any idea of how the Orchestrate stuff worked, so the poor old technical writers were just thrown in at the deep end.

Unfortunately, there has not been a whole lot done to improve things in the interim. Even the version 8.0 manual, for all its glossy "blue rinse", is not much better.

You do get better information on the Advanced DataStage classes (IBM's or mine), since developing training labs requires researching techniques, but that's hardly the point, is it?

Columns first and second are subrecord types. Send this link to or through a Peek stage to see what they look like.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Here is my job design:

File1 ------->
Compare ------> PromoteSubrecord----->SeqFile
File2 -------->

The output column of the Compare stage has:
result tinyint
first unknown
second unknown

The input tab of the Promote Subrecord stage has:
result tinyint
first unknown
second unknown

Under stage properties:
Subrecord Column = first

The output tab has:
first.fld1 char(10)
first.fld2 char(10)
first.fld3 integer

I get the following error when I run the job:
main_program: Syntax error: Error in "export" operator: Error in operator arg: In field "first": Expected ";", got: ".", line 321
In field "first": Expected ";", got: ".", line 322
In field "first": Expected ";", got: ".", line 323

This doesn't say which stage is causing the error. It just says "main_program". This is not a data issue as the data as only 6 lines and the . does not appear anywhere in the either input file.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It does tell you in which stage the error occurred. Only one stage from your design will generate an export operator in the score. Inspect the score to determine which it is (assuming you can't guess).
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