Compilation error for job parameter in Transformer

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
wahi80
Participant
Posts: 214
Joined: Thu Feb 07, 2008 4:37 pm

Compilation error for job parameter in Transformer

Post by wahi80 »

Hi,

I have job shown as follows

Code: Select all

SeqIn ----> Transformer---->Seq1,Seq2


In derivation of transformer I have inserted a job parameter.

Code: Select all

Derivation:'HDR' : in_Hdr_Tlr.SUBMITTER_ID : Str('0',6-Len(in_Hdr_Tlr.SUBMITTER_ID))  : Str('0',10-Len(in_Hdr_Tlr.PDE_FILE_ID))  : in_Hdr_Tlr.PDE_FILE_ID : $PDE_RUNDATE : 'TEST' : Str(' ',481) 


Whenever the job parameter is an environment variable as shown above I get the compilation error below (Check line 54) . But when I change the job parameter to a local there is no problem.

Code: Select all

Output from transformer compilation follows:

##I IIS-DSEE-TFCN-00001 14:38:18(000) <main_program> 
IBM WebSphere DataStage Enterprise Edition 8.0.1.4866 
Copyright (c) 2001, 2005-2007 IBM Corporation. All rights reserved
 


##I IIS-DSEE-TUTL-00031 14:38:18(001) <main_program> The open files limit is 2048; raising to 2147483647.
##I IIS-DSEE-TOSH-00002 14:38:18(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 14:38:18(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 14:38:18(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 14:38:18(007) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##W IIS-DSEE-TFTM-00012 14:38:18(009) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1".
##E IIS-DSEE-TFTK-00001 14:38:18(010) <transform> Error when checking composite operator: Unexpected tokens: ; [line 12,character 7].
##E IIS-DSEE-TFPS-00012 14:38:18(011) <transform> Error when checking composite operator: Invalid local variable declaration: ; [line 12, character 7].
##E IIS-DSEE-TFTK-00001 14:38:18(012) <transform> Error when checking composite operator: Unexpected tokens: ; [line 54,character 191].
##E IIS-DSEE-TFPS-00027 14:38:18(013) <transform> Error when checking composite operator: Expected an operand; [line 54, character 189].
##E IIS-DSEE-TFPS-00038 14:38:18(014) <transform> Error when checking composite operator: Expected right paren; [line 54, character 191].
##E IIS-DSEE-TFPS-00038 14:38:18(015) <transform> Error when checking composite operator: Expected right paren; [line 54, character 192].
##E IIS-DSEE-TFPS-00038 14:38:18(016) <transform> Error when checking composite operator: Expected semi-colon; [line 54, character 218].
##E IIS-DSEE-TFPS-00038 14:38:18(017) <transform> Error when checking composite operator: Expected semi-colon; [line 54, character 260].
##E IIS-DSEE-TFSR-00019 14:38:18(018) <main_program> Could not check all operators because of previous error(s)
##E IIS-DSEE-TCOS-00029 14:38:18(019) <main_program> Creation of a step finished with status = FAILED. (PDE_009_CMS_File_Hdr_Tlr.xfm_Hdr_Tlr)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S1_PDE_009_CMS_File_Hdr_Tlr_xfm_Hdr_Tlr transform operator.
0003: //
0004: 
0005: // define our input/output link names
0006: inputname 0 in_Hdr_Tlr;
0007: outputname 0 xo_Hdr;
0008: outputname 1 xo_Tlr;
0009: 
0010: global {
0011: 	// Job parameter declaration
0012: 	string $PDE_RUNDATE;
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: 	// declare our intermediate variables for this section
0023: 	string InterVar0_0;
0024: 	string InterVar0_1;
0025: 	string InterVar0_4;
0026: 	string InterVar0_5;
0027: 	string InterVar0_6;
0028: 
0029: 	// initialise constant values which require conversion
0030: 	InterVar0_0 = "HDR";
0031: 	InterVar0_1 = "0";
0032: 	InterVar0_4 = "TEST";
0033: 	InterVar0_5 = " ";
0034: 	InterVar0_6 = "TLR";
0035: }
0036: 
0037: mainloop {
0038: 	// initialise our row rejected variable
0039: 	RowRejected0 = 1;
0040: 
0041: 	// declare our intermediate variables for this section
0042: 	int32 InterVar0_2;
0043: 	int32 InterVar0_3;
0044: 	string InterVar0_7;
0045: 	int32 InterVar0_8;
0046: 	string InterVar0_9;
0047: 	string InterVar0_10;
0048: 	int32 InterVar0_11;
0049: 	string InterVar0_12;
0050: 
0051: 	// evaluate columns (no constraints) for link: xo_Hdr
0052: 	InterVar0_2 = 6 - string_length(in_Hdr_Tlr.SUBMITTER_ID);
0053: 	InterVar0_3 = 10 - string_length(in_Hdr_Tlr.PDE_FILE_ID);
0054: 	xo_Hdr.Layout = (((((((InterVar0_0 + in_Hdr_Tlr.SUBMITTER_ID) + string_of_substring(InterVar0_1 , InterVar0_2)) + string_of_substring(InterVar0_1 , InterVar0_3)) + in_Hdr_Tlr.PDE_FILE_ID) + $PDE_RUNDATE) + InterVar0_4) + string_of_substring(InterVar0_5 , 481));
0055: 	writerecord 0;
0056: 	RowRejected0 = 0;
0057: 	// evaluate columns (no constraints) for link: xo_Tlr
0058: 	InterVar0_2 = 6 - string_length(in_Hdr_Tlr.SUBMITTER_ID);
0059: 	InterVar0_3 = 10 - string_length(in_Hdr_Tlr.PDE_FILE_ID);
0060: 	InterVar0_7 = in_Hdr_Tlr.BHD_REC_TOTAL;
0061: 	InterVar0_8 = 9 - string_length(InterVar0_7);
0062: 	InterVar0_9 = in_Hdr_Tlr.BHD_REC_TOTAL;
0063: 	InterVar0_10 = in_Hdr_Tlr.DET_REC_TOTAL;
0064: 	InterVar0_11 = 9 - string_length(InterVar0_10);
0065: 	InterVar0_12 = in_Hdr_Tlr.DET_REC_TOTAL;
0066: 	xo_Tlr.Layout = (((((((((InterVar0_6 + in_Hdr_Tlr.SUBMITTER_ID) + string_of_substring(InterVar0_1 , InterVar0_2)) + string_of_substring(InterVar0_1 , InterVar0_3)) + in_Hdr_Tlr.PDE_FILE_ID) + string_of_substring(InterVar0_1 , InterVar0_8)) + InterVar0_9) + string_of_substring(InterVar0_1 , InterVar0_11)) + InterVar0_12) + string_of_substring(InterVar0_5 , 475));
0067: 	writerecord 1;
0068: 	RowRejected0 = 0;
0069: }
0070: 
0071: finish {
0072: }
0073: 
*** End of Internal Generated Transformer Code
Is there a particular way that an environment variable should be used in the derivation column??

Regards
Wah
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi,

Use the GetEnvironment function and get rid of the $. It is not required. Do a search on GetEnvironment.

HTH
--Rich
Post Reply