Importing of a Orchestrate schema into a DS inRec: *;

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
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Importing of a Orchestrate schema into a DS inRec: *;

Post by trammohan »

Hi,

I have a question....
I have to import a Orchestrate schema definition to Data Stage

Example :

record
(
npa : string;
nxx : string;
tel_ln_no : string;
inrec : *;
)

In the above example How can I handle the inRec: *; portion while importing it to Datastage ?????....

Thanks in advance

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

Post by ray.wurlod »

You might have more luck posting this on the Parallel Extender forum. :cry:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vzoubov
Participant
Posts: 28
Joined: Tue Feb 05, 2002 12:30 pm
Location: Boston, MA

Re: Importing of a Orchestrate schema into a DS inRec: *;

Post by vzoubov »

trammohan wrote:Hi,

I have a question....
I have to import a Orchestrate schema definition to Data Stage

Example :

record
(
npa : string;
nxx : string;
tel_ln_no : string;
inrec : *;
)

In the above example How can I handle the inRec: *; portion while importing it to Datastage ?????....

Thanks in advance

Ram
inrec: * is a schema variable that denotes any set of fields (including an empty one). If your record schema contains only npa, nxx and tel_ln_no get rid of
inrec:*;
and import the record schema using the DS Manager.

Vitali.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Re: Importing of a Orchestrate schema into a DS inRec: *;

Post by Teej »

So in summary, it is a way to declare Orchestrate Propagated columns?

-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

Post by clshore »

You can define and import your orch schema like this:

record
(
npa : string[3];
nxx : string[3];
tel_ln_no : string[10];
inrec : string[];
)

The [] denote a string of unspecified length. This can be specified in subsequent processing, for example with another schema def.

Carter
vzoubov
Participant
Posts: 28
Joined: Tue Feb 05, 2002 12:30 pm
Location: Boston, MA

Re: Importing of a Orchestrate schema into a DS inRec: *;

Post by vzoubov »

Teej wrote:So in summary, it is a way to declare Orchestrate Propagated columns?

-T.J.
Yes. According to the Orchestrate documentation:

Operators use schema variables to transfer an entire record of an input data set to the output data set.
Operators that do not use schema variables drop unused fields from the
records of an input data set.

Vitali.
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

Vitali,,

How can I define the inRec :*; in Data stage schema

thanks
ram
vzoubov
Participant
Posts: 28
Joined: Tue Feb 05, 2002 12:30 pm
Location: Boston, MA

Post by vzoubov »

trammohan wrote:How can I define the inRec :*; in Data stage schema
Ram,

Schema variables cannot be used in the Data Stage table definitions. They are used in Orchestrate operators.
Here's an example of using schema variables in an Orchestrate custom operator (buildop):

Code: Select all

$operator schema_var
$class schema_var_op
$input master_in auto record (i:int32; j:int32; inrec:*;)
$output master_out auto record (sum:int32; outrec:*;)
$action
	sum = master_in.i + master_in.j;
$end
This operator takes as its input two integers i and j and outputs sum, i and j. Having two schema variables: inrec:* and outrec:* in you input and output interfaces forces the Orchestrate framework to propagate i and j to the output. If you didn't include schema variables the operator would output only one field - sum.
To run this operator
1. Create a file schema_var.opd with the content shown above. Put it into your DS project buildop directory.
2. Compile the schema_var buildop:
buildop -f -v schema_var.opd
3. Create a PX job with a generic stage. Something like:
Row Generator --> Generic (schema_var) --> Peek
Specify schema_var as the Operator property in the generic stage.
Alternatively you can run the following osh script:

osh "
generator
-schema record (
i:int32;
j:int32;
)
-records 10
|
schema_var
|
peek
-name
"

Regards,
Vitali.
Post Reply