How to pass job parameters in parallel tranformer 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
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

How to pass job parameters in parallel tranformer stage

Post by trammohan »

Hi,
Can any one help me the syntax of passing the job parameters in parallel transformer stage ..

Ex $FLAG defined as job parameter in the job

in parallel transformer if I use the same #$FLAG# i am getting error.

Thanks in advance
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

In the transformer stage your right mouse click menu is your friend and guide. On it you will see the "Job Parameter" option and selecting the job parameter will show you that it gets inserted into the derivation or constraint field without any surrounding characters. Eg. $FLAG
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

vmcburney wrote:In the transformer stage your right mouse click menu is your friend and guide. On it you will see the "Job Parameter" option and selecting the job parameter will show you that it gets inserted into the derivation or constraint field without any surrounding characters. Eg. $FLAG

If I use $FLAG in the transformer I am getting compilation error...
trokosz
Premium Member
Premium Member
Posts: 188
Joined: Thu Sep 16, 2004 6:38 pm
Contact:

Post by trokosz »

Well, $FLAG tells me its a user-defined enviornment variable you set vs. a Job parameter.....did you create a user-defined enviornment variable?

I ask because when you say #$FLAG" this presumes its a user-defined environment varaible.....If its #FLAG# then its not a user-defined environment variable.

So if you didn't define as a user-defined environment variable then change #$FLAG# to #FLAG# and the compile error goes away.
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

trokosz wrote:Well, $FLAG tells me its a user-defined enviornment variable you set vs. a Job parameter.....did you create a user-defined enviornment variable?

I ask because when you say #$FLAG" this presumes its a user-defined environment varaible.....If its #FLAG# then its not a user-defined environment variable.

So if you didn't define as a user-defined environment variable then change #$FLAG# to #FLAG# and the compile error goes away.
I defined FLAG as user defined environment variable ..

I used these syntaxes : #$FLAG#, #FLAG#... but still i am getting error
cmmurari
Participant
Posts: 34
Joined: Sun Jan 02, 2005 9:55 am
Location: Singapore

Post by cmmurari »

For job parameters you can able to assign Envrionment variables so in job parameter you can crate job variable ABC and assign envrionment variable " have to use only $FLAG" . and in Transformation stage you can able to use job properties #ABC#
Last edited by cmmurari on Wed Sep 28, 2005 10:14 pm, edited 1 time in total.
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

cmmurari wrote:hi

you have to use only $FLAG . don't use # # for environment variables.

Cheers,
krish
Hi chris,

$FLAG also not working...
cmmurari
Participant
Posts: 34
Joined: Sun Jan 02, 2005 9:55 am
Location: Singapore

Post by cmmurari »

What version DS you are using.

in DS 7.5 Job properties window >> Parameters tab>> you have Button called "Add Envrionment Variables". you can use this to add job parameters . and in Transformer stage expression window when you right click you can see popup window and you can able to select job parameters and that result to $PARAMETER . That should be work.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Is it showing up in the transformer as red text? What is the compilation error you are getting? Have you tried adding it in the transformer via the right mouse click menu?
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

cmmurari wrote:What version DS you are using.

in DS 7.5 Job properties window >> Parameters tab>> you have Button called "Add Envrionment Variables". you can use this to add job parameters . and in Transformer stage expression window when you right click you can see popup window and you can able to select job parameters and that result to $PARAMETER . That should be work.
I am getting this error :
Error compiling parallel transformer check. Transformer_22
Press the "Show Error" button to highlight the stage to which the error relates.

Compilation Error information

Output from transformer compilation follows:

##I TFCN 000001 08:25:57(000) <main_program>
Ascential DataStage(tm) Enterprise Edition 7.5.1A
Copyright (c) 2004, 1997-2004 Ascential Software Corporation.
All Rights Reserved


##I TOSH 000002 08:25:57(001) <main_program> orchgeneral: loaded
##I TOSH 000002 08:25:57(002) <main_program> orchsort: loaded
##I TOSH 000002 08:25:57(003) <main_program> orchstats: loaded
##I TFSC 000001 08:27:14(000) <main_program> APT configuration file: /apps/opt/aedw/source/config/config.apt.dstage.old
##I TFPA 000028 08:27:14(001) <main_program> APT Startup script: /apps/opt/ascential75/Ascential/DataStage/PXEngine/etc/startup.apt
hostname=ewttvp01 windowid=9
hostname=edwprd11 windowid=10
hostname=edwprd6 windowid=7
hostname=edwprd2 windowid=3
hostname=edwprd3 windowid=6
hostname=edwprd4 windowid=8
hostname=edwprd15 windowid=17
hostname=edwprd5 windowid=27
hostname=edwprd16 windowid=28
hostname=edwprd14 windowid=29
hostname=edwprd13 windowid=30
hostname=edwprd7 windowid=32
hostname=edwprd12 windowid=34
hostname=edwprd8 windowid=31
hostname=edwprd9 windowid=33
hostname=edwprd10 windowid=20
##I TLIC 000002 08:27:22(000) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd10' has 32 physical processors.
##I TLIC 000002 08:27:22(001) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd11' has 32 physical processors.
##I TLIC 000002 08:27:22(002) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd12' has 32 physical processors.
##I TLIC 000002 08:27:22(003) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd13' has 32 physical processors.
##I TLIC 000002 08:27:22(004) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd14' has 32 physical processors.
##I TLIC 000002 08:27:22(005) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd15' has 32 physical processors.
##I TLIC 000002 08:27:22(006) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd16' has 32 physical processors.
##I TLIC 000002 08:27:22(007) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd2' has 32 physical processors.
##I TLIC 000002 08:27:22(008) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd3' has 32 physical processors.
##I TLIC 000002 08:27:22(009) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd4' has 32 physical processors.
##I TLIC 000002 08:27:22(010) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd5' has 32 physical processors.
##I TLIC 000002 08:27:22(011) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd6' has 32 physical processors.
##I TLIC 000002 08:27:22(012) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd7' has 32 physical processors.
##I TLIC 000002 08:27:22(013) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd8' has 32 physical processors.
##I TLIC 000002 08:27:22(014) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'edwprd9' has 32 physical processors.

##W TFCP 000000 08:27:22(049) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1".
##E TFCP 000001 08:27:22(050) <transform> Error when checking composite operator: Unexpected tokens: ; [line 11,character 7].
##E TFCP 000012 08:27:22(051) <transform> Error when checking composite operator: Invalid local variable declaration: ; [line 11, character 7].
##E TFCP 000001 08:27:22(052) <transform> Error when checking composite operator: Unexpected tokens: ; [line 35,character 22].
##E TFCP 000027 08:27:22(053) <transform> Error when checking composite operator: Expected an operand; [line 35, character 20].
##E TFCP 000038 08:27:22(054) <transform> Error when checking composite operator: Expected semi-colon; [line 35, character 22].
##E TFSR 000019 08:27:22(055) <main_program> Could not check all operators because of previous error(s)
##E TCOS 000029 08:27:22(056) <main_program> Creation of a step finished with status = FAILED. (CopyOfcheck.Transformer_
22)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S22_repos_Transformer_22 transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 DSLink21;
0007: outputname 0 DSLink24;
0008:
0009: global {
0010: // Job parameter declaration
0011: string $TEST_FLAG;
0012: string RR;
0013: }
0014:
0015: initialize {
0016: // define our row rejected variable
0017: int8 RowRejected0;
0018:
0019: // define our null set variable
0020: int8 NullSetVar0;
0021:
0022: // Stage variable declaration and initialisation
0023: int32 StageVar0_StageVar;
0024: StageVar0_StageVar = ((get_partition_num() - get_num_of_partitions()) + 1);
0025: string StageVar0_tempflag;
0026: StageVar0_tempflag = "";
0027: }
0028:
0029: mainloop {
0030: // initialise our row rejected variable
0031: RowRejected0 = 1;
0032:
0033: // evaluate the stage variables first
0034: StageVar0_StageVar = (StageVar0_StageVar + get_num_of_partitions());
0035: StageVar0_tempflag = $TEST_FLAG;
0036:
0037: // evaluate constraint and columns for link: DSLink24
0038: if ((DSLink21.a == RR))
0039: {
0040: DSLink24.c = DSLink21.c;
0041: writerecord 0;
0042: RowRejected0 = 0;
0043: }
0044: }
0045:
0046: finish {
0047: }
0048:
*** End of Internal Generated Transformer Code
nrevezzo
Participant
Posts: 15
Joined: Mon Sep 08, 2003 2:36 pm

Post by nrevezzo »

This is a deficiency in DataStage. The compiler does not like the $ and produces the error.
You can not use an environment variable in the transformer stage it has to be a job level variable.
I believe I reported this problem to Ascential but I can't find the case # or their response.
nrevezzo
Participant
Posts: 15
Joined: Mon Sep 08, 2003 2:36 pm

Post by nrevezzo »

Here is the ecase assigned for the fix to this problem: ecase #58139.

This ecase was created 8/2004. I'm surprised it wasn't fixed in v7.5
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

nrevezzo wrote:Here is the ecase assigned for the fix to this problem: ecase #58139.

This ecase was created 8/2004. I'm surprised it wasn't fixed in v7.5
will this issue ( ecase #58139 ) be resolved in the next Datastage release ?

Thanks
Post Reply