environment variable value in job

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
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

environment variable value in job

Post by dnat »

Hi,

I am passing an environment variable to a job and want to pass the value to one of the fields in the oracle stage. I am using Oracle load option, so i am passing the value in the transformer before that.
It is giving me compile error. can anyone help

Output from transformer compilation follows:

##I TFCN 000001 08:11:03(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:11:03(001) <main_program> orchgeneral: loaded
##I TOSH 000002 08:11:03(002) <main_program> orchsort: loaded
##I TOSH 000002 08:11:03(003) <main_program> orchstats: loaded
##I TFSC 000001 08:11:03(006) <main_program> APT configuration file: /landing01/dataint/Ascential/DataStage/Configurations/default.apt
##I TLIC 000002 08:11:03(000) <APT_LicenseCheckOp in APT_LicenseOperator,0> Node 'etldev1' has 12 physical processors.
##W TLIC 000003 08:11:03(001) <APT_LicenseCheckOp in APT_LicenseOperator,0> DataStage has found more CPU's on your system than your current license allows.
##W TLIC 000004 08:11:03(002) <APT_LicenseCheckOp in APT_LicenseOperator,0> Please contact Ascential Client Support or your Ascential Account Manager.
##W TCOS 000049 08:11:03(007) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##W TFCP 000000 08:11:03(009) <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:11:03(010) <transform> Error when checking composite operator: Unexpected tokens: ; [line 14,character 7].
##E TFCP 000012 08:11:03(011) <transform> Error when checking composite operator: Invalid local variable declaration: ; [line 14, character 7].
##E TFCP 000001 08:11:03(012) <transform> Error when checking composite operator: Unexpected tokens: ; [line 881,character 21].
##E TFCP 000027 08:11:03(013) <transform> Error when checking composite operator: Expected an operand; [line 881, character 19].
##E TFCP 000038 08:11:03(014) <transform> Error when checking composite operator: Expected semi-colon; [line 881, character 21].
##E TFSR 000019 08:11:03(015) <main_program> Could not check all operators because of previous error(s)
##E TCOS 000029 08:11:03(016) <main_program> Creation of a step finished with status = FAILED. (Stageload.Transformer_14)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S14_repos_Transformer_14 transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 ToSev2;
0007: outputname 0 Errorfile;
0008: outputname 1 Seqfile;
0009: outputname 2 DSLink21;
0010: outputname 3 DSLink24;
0011:
0012: global {
0013: // Job parameter declaration
0014: string $Prm_Batch_Id;
0015: }
0016:
0017: initialize {
0018: // define our row rejected variable
0019: int8 RowRejected0;
0020:
0021: // define our null set variable
0022: int8 NullSetVar0;
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi,

In the transformer do not use the $ for the environment variable.

Alternatively you can use GetEnvironment(Prm_Batch_Id).

HTH
--Rich
v2kmadhav
Premium Member
Premium Member
Posts: 78
Joined: Fri May 26, 2006 7:31 am
Location: London

Post by v2kmadhav »

hello

can you create a local parameter defaulted to $PROJDEF that you pass into the transformer rather than getting the env value itself?

This might help if you wanna run that job alone with a different set of values unlike the ones in your environment without editing your code.

cheers
Post Reply