Page 1 of 2

dssetparm apt_config_file

Posted: Mon Aug 29, 2016 4:09 am
by wuruima
so sad I search in the forum so long time but cannot find any post.

I use a routine to run the DS job, now I want to specify the different APT fot different job, eg. file1.apt for job1, file2.apt for job2.

I hope I can set this by DSSETPARM like the user defined params but failed.

paramerr = DSSetParam (job2 , "$APT_CONFIG_FILE", '/sysp/DataStage81/InformationServer/Server/Configurations/file1.apt')

It still uses the default apt to run.

do I use the incorrect function to run?

Posted: Mon Aug 29, 2016 5:24 am
by chulett
Did you check 'paramerr' after the function call? What is 'job2'? It needs to be a handle to a job, not an actual job name, obtained using DSAttachJob.

Posted: Mon Aug 29, 2016 7:28 pm
by wuruima
get it.. i will check the paramerr

Posted: Mon Aug 29, 2016 7:56 pm
by wuruima
code=-3 [ParamName does not reference a known parameter of the job]
hi chulett,
this is the error it shows, could u please advise how to fix ?

Posted: Mon Aug 29, 2016 8:13 pm
by wuruima
it's not correct to set environment variable user ds set parm
I found this in the forum.
but I want the job to run for different apt. e.g. the routine starts job1 using apt1, starts job2 using apt2. what should i do ?

Posted: Tue Aug 30, 2016 1:48 am
by ArndW
Did you actually declare the APT_CONFIG_FILE parameter explicitly in your job?

Posted: Tue Aug 30, 2016 5:33 am
by chulett
Yes, it is both possible and you are using the correct function. As noted, you need to declare it as a job parameter in the job (this is one of several that should be in every job) to allow it to be overridden on a run-by-run basis as needed.

I also found this 'remark' in the latest documentation as shown here.

Remarks

The job specified by JobHandle must be locked, using DSLockJob, before the DSSetParam function is called.

That's a new one on me as I don't remember ever having to do that or even seeing that function before. :?

:idea: Please use the Reply to topic button to reply unless you really need to quote something... which is hardly ever the case. Saves me having to clean up all the over-quoting. Thanks.

Posted: Tue Aug 30, 2016 7:35 am
by ArndW
I believe that the DSLockJob() is when using the c interface, I can't see it mentioned for the BASIC calls documentation (11.3) and it isn't even defined - I get a compile error when I try to use it.

Posted: Tue Aug 30, 2016 8:48 am
by chulett
True... sorry, didn't realize I'd stumbled into the C API documentation. :(

Posted: Fri Sep 02, 2016 3:50 am
by ray.wurlod
You seem to have missed calls to DSAttachJob() and DSDetachJob().

Posted: Sun Sep 04, 2016 7:49 pm
by wuruima
i called DSAttachJob. And also add system variable in the parallel job.
But failed on set parm , saying no this parm.

Posted: Mon Sep 05, 2016 2:27 am
by ArndW
Are you 100% certain that you defined this parameter in the job (case sensitive)? Could you also post your DSAttachJob() call?

Posted: Tue Sep 06, 2016 3:33 am
by wuruima
yes.
define the system parm in the parallel job property;
DSAttachJob to get the parallel job handler;
DSSetParm to set parm to this system parm.

when run job, 'no this parm' error.

Posted: Tue Sep 06, 2016 3:34 am
by wuruima
btw, i set many parms to the parallel job. others are all okay, the system parm fail

Posted: Tue Sep 06, 2016 7:25 am
by chulett
I'm not sure why this is popping into my head but could you try not including the $ in your DSSetParam call? :?