Inserting Parameter Value into Oracle Stage forHeaderTrailer

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
Raj6778
Premium Member
Premium Member
Posts: 6
Joined: Mon Oct 29, 2007 11:28 am

Inserting Parameter Value into Oracle Stage forHeaderTrailer

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

Post 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".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post 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.
Ross Leishman
Raj6778
Premium Member
Premium Member
Posts: 6
Joined: Mon Oct 29, 2007 11:28 am

Post 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
Raj6778
Raj6778
Premium Member
Premium Member
Posts: 6
Joined: Mon Oct 29, 2007 11:28 am

Post 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
Raj6778
Raj6778
Premium Member
Premium Member
Posts: 6
Joined: Mon Oct 29, 2007 11:28 am

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply