Page 1 of 1

Inserting Parameter Value into Oracle Stage forHeaderTrailer

Posted: Mon Nov 19, 2007 7:24 pm
by Raj6778
I have a 4 jobs, 3 jobs which take a parameter from 4th job contrl, which is used in sql in each header, data and trialer job for each distinct value of parameter

I am trying to use utilityjobrun in basic transformer stage, I get fatal error mesage that the parameter not found in job,

UtilityRunJob("Header", 'Param1=':trim(lnk146.Record), 0, 0)
I am assuming the value is being assigned to Param1 in the ctrl job

Param1 is the parameter in sql query for header data and trailer jobs and is in where clause with #Param1#

I have tried a lot, not able to figure it out, please help very much appreciated

Alternatively, I am trying to use dsattachjob, dssetparam, dsjobrun, dswaitforjob and dsdettachjob in basic transformer stage, I am not getting the syntax correct, I am using 8.0.1 enterprise and follwoing is code

$INCLUDE DSINCLUDE JOBCONTROL.H

EntityVal=trim(link413.record)

DSAttachJob("Header_File", DSJ.ERRWARNING)

DSSetParam (Handle, "Param1", Parameter1)

DSRunJob(Handle, DSJ.RUNNORMAL)

DSWaitForJob (Handle)

DSDetachJob (Handle)

I have not yet included other 2 files data and trailer

pls let me know what wrong here, What should I be doing to accomplish this.

Please help, I tried to search the forum, not able to fig it out

Raj

Posted: Mon Nov 19, 2007 7:38 pm
by ray.wurlod
In your code you need to assign the result of DSAttachJob to your Handle variable.

Code: Select all

Handle = DSAttachJob("Header_File", DSJ.ERRWARNING) 
RealName = DSGetJobInfo(Handle, DSJ.JOBNAME)
If RealName = DSJE.BADHANDLE
Then
   Call DSLogFatal("Can not attach Header_File job", "MyCode")
   GoTo ErrorExit
End
The "parameter not found in job" reports that there is no parameter called "Param1" in the job called "Header".

Posted: Mon Nov 19, 2007 8:13 pm
by rleishman
If you want to see the correct syntax for using those commands, you can create a Job Sequence that does nearly - or a part of - what you want, and then view the generated code in the Jon Control of the Parameters dialog.

Posted: Tue Nov 20, 2007 9:49 am
by Raj6778
ray.wurlod wrote:In your code you need to assign the result of DSAttachJob to your Handle variable.

Code: Select all

Handle = DSAttachJob("Header_File", DSJ.ERRWARNING) 
RealName = DSGetJobInfo(Handle, DS ...[/quote]

Thanks Ray, I tried your code, only all the commands are being showed in red in the basic transformer, only RealName = DSGetJobInfo is correct, when I complie I get general sysntax error, I am not sure whats worng, any thoughts...

also alternatively I am getting error message when I use Utilityjobrun as 

Multifile_Job(BASIC_Transformer_497).#2.BASIC_Transformer_497 (fatal error from DSSetParam): Job control fatal error (-3)
(DSGetParamInfo) Parameter '0' not found in job Header_Setup

I dont understand what it means... pls help

Posted: Tue Nov 20, 2007 9:56 am
by Raj6778
ray.wurlod wrote:In your code you need to assign the result of DSAttachJob to your Handle variable.

Code: Select all

Handle = DSAttachJob("Header_File", DSJ.ERRWARNING) 
RealName = DSGetJobInfo(Handle, DS ...[/quote]

Thanks Ray, I tried your code, only all the commands are being showed in red in the basic transformer, only RealName = DSGetJobInfo is correct, when I complie I get general sysntax error, I am not sure whats worng, any thoughts...

also alternatively I am getting error message when I use Utilityjobrun as 

Multifile_Job(BASIC_Transformer_497).#2.BASIC_Transformer_497 (fatal error from DSSetParam): Job control fatal error (-3)
(DSGetParamInfo) Parameter '0' not found in job Header_Setup

I dont understand what it means... pls help

Posted: Tue Nov 20, 2007 9:58 am
by Raj6778
ray.wurlod wrote:In your code you need to assign the result of DSAttachJob to your Handle variable.

Code: Select all

Handle = DSAttachJob("Header_File", DSJ.ERRWARNING) 
RealName = DSGetJobInfo(Handle, DS ...[/quote]

Thanks Ray, I tried your code, only all the commands are being showed in red in the basic transformer, only RealName = DSGetJobInfo is correct, when I complie I get general sysntax error, I am not sure whats worng, any thoughts...

also alternatively I am getting error message when I use Utilityjobrun as 

Multifile_Job(BASIC_Transformer_497).#2.BASIC_Transformer_497 (fatal error from DSSetParam): Job control fatal error (-3)
(DSGetParamInfo) Parameter '0' not found in job Header_Setup

I dont understand what it means... pls help

Posted: Tue Nov 20, 2007 3:12 pm
by ray.wurlod
They are not intended - or indeed able - to be used directly in a BASIC Transformer stage, for example because DSAttachJob is a subroutine, not a function. My code is intended - as I believed yours was - to be used in a server job routine that was invoked from the BASIC Transformer stage.