Page 1 of 2

How to Capture job parameters during runtime..?

Posted: Fri May 02, 2008 7:16 am
by jimgowtham
Hi,

During runtime, Is there any way to capture job parameters and pass those job parameters from source file to Target file...?

Regards,
JIM

Posted: Fri May 02, 2008 7:29 am
by joesat
The different job parameters used along with a job will be displayed in the job logs. One can extract that specific log and write it to a sequential file.

Posted: Fri May 02, 2008 8:26 am
by jimgowtham
I have to capture those parameters during runtime; i.e single run. And propagate those parameters from the source file or DB Stage to target.

Posted: Fri May 02, 2008 8:27 am
by jimgowtham
I have to capture those parameters during runtime; i.e single run. And propagate those parameters from the source file or DB Stage to target.

Posted: Fri May 02, 2008 9:13 am
by DSguru2B
As mentioned, capture the first entry in the log. This entry will have all the parameter values used for that particular run.

Posted: Fri May 02, 2008 11:51 am
by throbinson
I must be missing something crucial to this discussion since it appears intuitively obvious. The parameter values are available at runtime. Simply reference them in the job and write them out to wherever you want. There is no no need to go back to the logs after the job has run.

Posted: Fri May 02, 2008 8:20 pm
by ray.wurlod
The crucial bit appears to be "capture". Does that mean "read them from a file"? If so, by what thought process are they being called "parameters"? Are they "job parameters" or something else?

Posted: Sun May 04, 2008 10:43 pm
by jimgowtham
Job parameter values are available only at runtime...How to reference them in DS JOBS...?

Posted: Mon May 05, 2008 12:01 am
by bikan
In most of stages ...where you specify property value ..there is provision to include job parameters as value..

For example in transformer you can pass job parameter to output column definition by going to derivation and by right clicking and selectiong job parameters.

refer documentation docs for more details

Regards
Sandeep Ranade

Posted: Mon May 05, 2008 12:03 am
by bikan
In most of stages ...where you specify property value ..there is provision to include job parameters as value..

For example in transformer you can pass job parameter to output column definition by going to derivation and by right clicking and selectiong job parameters.

refer documentation docs for more details

Regards
Sandeep Ranade

Posted: Mon May 05, 2008 12:55 am
by ray.wurlod
Having "captured" the parameters (or at least their values) what do you wish to do with them?

Posted: Mon May 05, 2008 1:59 am
by jimgowtham
As mentioned,I have used this pass job parameter in transformer.

My jobparameter is $GLB_ETL_BATCH with Default value as ETLBATCH.

However I am getting Job compile error as...

Output from transformer compilation follows:

##I TFCN 000001 13:23:50(000) <main_program>
Ascential DataStage(tm) Enterprise Edition 7.5.2
Copyright (c) 2004, 1997-2004 Ascential Software Corporation.
All Rights Reserved


##I TUTL 000031 13:23:50(001) <main_program> The open files limit is 100; raising to 65536.
##I TOSH 000002 13:23:50(002) <main_program> orchgeneral: loaded
##I TOSH 000002 13:23:50(003) <main_program> orchsort: loaded
##I TOSH 000002 13:23:51(000) <main_program> orchstats: loaded
##I TFSC 000001 13:23:51(003) <main_program> APT configuration file: /datastage/dsadm/Ascential/DataStage/Configurations/default.apt
##I TFSC 000000 13:23:51(004) <main_program>
This step has no datasets.

It has 1 operator:
op0[1p] {(sequential APT_CombinedOperatorController:
(APT_LicenseCountOp in APT_LicenseOperator)
(APT_LicenseCheckOp in APT_LicenseOperator)
) on nodes (
node1[op0,p0]
)}
It runs 1 process on 1 node.
##I TFOP 000094 13:23:51(000) <APT_LicenseCountOp in APT_LicenseOperator,0> Output 0 produced 1 records.
##I TLIC 000163 13:23:51(001) <APT_LicenseCheckOp in APT_LicenseOperator,0> Input 0 consumed 1 records.
##W TCOS 000049 13:23:51(005) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##W TFCP 000000 13:23:52(001) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1".
##E TFCP 000001 13:23:52(002) <transform> Error when checking composite operator: Unexpected tokens: ; [line 11,character 7].
##E TFCP 000012 13:23:52(003) <transform> Error when checking composite operator: Invalid local variable declaration: ; [line 11, character 7].
##E TFCP 000001 13:23:52(004) <transform> Error when checking composite operator: Unexpected tokens: ; [line 28,character 20].
##E TFCP 000027 13:23:52(005) <transform> Error when checking composite operator: Expected an operand; [line 28, character 18].
##E TFCP 000038 13:23:52(006) <transform> Error when checking composite operator: Expected semi-colon; [line 28, character 20].
##E TFSR 000019 13:23:52(007) <main_program> Could not check all operators because of previous error(s)
##E TCOS 000029 13:23:52(008) <main_program> Creation of a step finished with status = FAILED. (etlbatch.Transformer_4)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S4_etlbatch_Transformer_4 transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 DSLink409;
0007: outputname 0 DSLink6;
0008:
0009: global {
0010: // Job parameter declaration
0011: string $GLB_ETL_BATCH;
0012: }
0013:
0014: initialize {
0015: // define our row rejected variable
0016: int8 RowRejected0;
0017:
0018: // define our null set variable
0019: int8 NullSetVar0;
0020:
0021: }
0022:
0023: mainloop {
0024: // initialise our row rejected variable
0025: RowRejected0 = 1;
0026:
0027: // evaluate columns (no constraints) for link: DSLink6
0028: DSLink6.ETL_BATCH = $GLB_ETL_BATCH;
0029: writerecord 0;
0030: RowRejected0 = 0;
0031: }
0032:
0033: finish {
0034: }
0035:
*** End of Internal Generated Transformer Code

Posted: Mon May 05, 2008 3:47 am
by ray.wurlod
Did you use the Expression Editor to insert the job parameter reference into the expression?

Posted: Mon May 05, 2008 4:00 am
by jimgowtham
:D THANK Yuuuu.... :D It's Working..... :D

Posted: Mon May 05, 2008 4:02 am
by joesat
I am not sure what you did to make it work Jim :?: