Page 1 of 1

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

Posted: Mon Jan 26, 2004 9:14 pm
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

Posted: Mon Jan 26, 2004 11:38 pm
by ray.wurlod
You might have more luck posting this on the Parallel Extender forum. :cry:

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

Posted: Tue Jan 27, 2004 1:04 am
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.

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

Posted: Tue Jan 27, 2004 9:50 am
by Teej
So in summary, it is a way to declare Orchestrate Propagated columns?

-T.J.

Posted: Tue Jan 27, 2004 10:00 am
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

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

Posted: Tue Jan 27, 2004 8:03 pm
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.

Posted: Wed Jan 28, 2004 5:23 pm
by trammohan
Vitali,,

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

thanks
ram

Posted: Wed Jan 28, 2004 6:52 pm
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.