Passing Invocation Id

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
travissolt
Participant
Posts: 51
Joined: Mon Feb 05, 2007 1:53 pm

Passing Invocation Id

Post by travissolt »

We are attempting to call DS JOBs from Appworx and have a perl script that will directly call a DS job name and kickoff the job. The issue we are having is that for our DSJOBs that require invocation id's we need to establish the invocation id variable in the perl script and I am unsure what stores that information in DS. Where is the generated invocation Id stored while a DSjob is processing? ex $ds_project stores the project name is there a corresponding $ds_invocation...
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ds_project seems to be your variable for the script and not a global one or one that holds the project name internally by the DSEngine. When you pass the invocation id via the script, you should store it in a variable and use that variable to retrieve the invocation id.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

When calling a job using the dsjob command line interface, specify "{JobName}.{InvocationID}" for the job name.
travissolt
Participant
Posts: 51
Joined: Mon Feb 05, 2007 1:53 pm

Post by travissolt »

We attempted to assign a variable and pass it back into the DSJOb but the invocation id is not really a parameter in the job properties. We can set a paramater and pass it out but it has to be pointed to somewhere in DS for it to be used. An example of some of the script is below I would think we would need to spell out where the invocation ID should be placed in the DS job run.


error("No par file defined\n") unless $ENV{par};
my $AW_HOME = $ENV{AW_HOME};
my $arg_delimiter = '=';
my $args = get_args($ENV{par}, $arg_delimiter);
my $BASE_DIR = $ENV{BASE_DIR} or error("BASE_DIR is not set.\n");
my $ds_job_prog = "$ENV{DSHOME}/bin/dsjob";
my $ds_job_name = $ENV{command};
my $ds_project = $args->{DSPROJECT} or error("Missing prompt DSPROJECT\n");
my $LOG_DIR = "$BASE_DIR/$args->{DSPROJECT}/logs/jobs";
my $ds_rc_threshold = $args->{DS_RC_THRESHOLD} || 2;
my $ds_logfile = "$LOG_DIR/${ds_job_name}_$ENV{jobid}.log";
my $awprint = "$ENV{AW_HOME}/c/awprint";
my ($script_name) = $0 =~ /([^\/]+$)/; # Pull out the base file name
my $exit_code = 0;
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

An invocation id is just a unique number or a character or a string of characters. It could be 1 or a or ALPHA. Before you pass the invocation id like ArndW showed, you could store it. Internally the DSEngine stores this info in the DSInvocationId macro.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
travissolt
Participant
Posts: 51
Joined: Mon Feb 05, 2007 1:53 pm

Post by travissolt »

We figured it out. Within Appworx instead of having a module with just a call for a JOBNAME we changed it to a call for the JOBNAME.INVOCATIONID. Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which is what Arnd posted yesterday.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply