Page 1 of 1

Passing Invocation Id

Posted: Tue Jul 31, 2007 3:35 pm
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...

Posted: Tue Jul 31, 2007 3:47 pm
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.

Posted: Tue Jul 31, 2007 3:53 pm
by ArndW
When calling a job using the dsjob command line interface, specify "{JobName}.{InvocationID}" for the job name.

Posted: Tue Jul 31, 2007 3:54 pm
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;

Posted: Tue Jul 31, 2007 3:58 pm
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.

Posted: Wed Aug 01, 2007 7:33 am
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

Posted: Wed Aug 01, 2007 7:38 am
by chulett
Which is what Arnd posted yesterday.