How to Capture job parameters during runtime..?

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

jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

How to Capture job parameters during runtime..?

Post 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
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post 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.
Joel Satire
jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

Post 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.
jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

As mentioned, capture the first entry in the log. This entry will have all the parameter values used for that particular run.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

Post by jimgowtham »

Job parameter values are available only at runtime...How to reference them in DS JOBS...?
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post 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
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Having "captured" the parameters (or at least their values) what do you wish to do with them?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you use the Expression Editor to insert the job parameter reference into the expression?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jimgowtham
Participant
Posts: 34
Joined: Thu Feb 16, 2006 8:34 am
Location: mumbai

Post by jimgowtham »

:D THANK Yuuuu.... :D It's Working..... :D
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

I am not sure what you did to make it work Jim :?:
Joel Satire
Post Reply