Passing parameters to jobs in batch
Posted: Mon Mar 08, 2004 5:26 am
Dear All
I'm trying to pass a parameter from one job to another.
I have a Unix command which successfully returns an output as follows
"04-03-07_15:00:00"
I'm trying to pass this output into another job called
Batch::KalamazooProspects using DSSetParam. See code below.
When I run this and view the log for Batch::KalamazooProspects the parameter
has been set to null with DSSetParam returning a code of -4 (DSJE.BADVALUE
ParamValue is not appropriate for that parameter type)
UnixCommand = "head -1 ":projectDir:"/controller/IEFListPR|cut -d/ -f
5|cut -c6-23"
call DSExecute("UNIX", UnixCommand,FileDate,SystemReturnCode)
ProsParam=trim(FileDate)
* Setup Batch::KalamazooProspects, run it, wait for it to finish, and test
for success
hJob1 = DSAttachJob("Batch::KalamazooProspects", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: Batch::KalamazooProspects",
"JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "pFileDate", ProsParam)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: Batch::KalamazooProspects",
"JobControl")
End
Grateful for any help..
Regards
Lawrence
Lawrence Ross
Analyst Programmer
R.L.Polk & Co.
DDI: +44 (0) 1727 733742
Fax: +44 (0) 1727 734700
E-mail:lawrence.ross@polk.co.uk
Internet:
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you are not the intended addressee, you must
not disclose, copy or take any action in reliance of this transmission.
The Company reserves the right to monitor all telecommunications that make
use of or passes through the Company facilities. This includes, but is not
limited to, E-mail, Internet, Facsimiles, Company Telephones and Company
Mobile Telephones. Please be advised that your telecommunication may be
intercepted, read, copied, deleted or retrieved by authorised personnel,
other than the sender or recipient of the original telecommunication, as
the Company sees fit.
Although this message and its contents have been scanned for viruses and no
viruses were detected, no responsibility whatsoever is accepted by the
Company, or any of its offices or companies for any loss or damage
arising in any way from receipt or use thereof.
If you have received this email in error please delete this message and
notify the Polk System Administrator at postmaster@polkglobal.com.
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
I'm trying to pass a parameter from one job to another.
I have a Unix command which successfully returns an output as follows
"04-03-07_15:00:00"
I'm trying to pass this output into another job called
Batch::KalamazooProspects using DSSetParam. See code below.
When I run this and view the log for Batch::KalamazooProspects the parameter
has been set to null with DSSetParam returning a code of -4 (DSJE.BADVALUE
ParamValue is not appropriate for that parameter type)
UnixCommand = "head -1 ":projectDir:"/controller/IEFListPR|cut -d/ -f
5|cut -c6-23"
call DSExecute("UNIX", UnixCommand,FileDate,SystemReturnCode)
ProsParam=trim(FileDate)
* Setup Batch::KalamazooProspects, run it, wait for it to finish, and test
for success
hJob1 = DSAttachJob("Batch::KalamazooProspects", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: Batch::KalamazooProspects",
"JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "pFileDate", ProsParam)
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: Batch::KalamazooProspects",
"JobControl")
End
Grateful for any help..
Regards
Lawrence
Lawrence Ross
Analyst Programmer
R.L.Polk & Co.
DDI: +44 (0) 1727 733742
Fax: +44 (0) 1727 734700
E-mail:lawrence.ross@polk.co.uk
Internet:
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you are not the intended addressee, you must
not disclose, copy or take any action in reliance of this transmission.
The Company reserves the right to monitor all telecommunications that make
use of or passes through the Company facilities. This includes, but is not
limited to, E-mail, Internet, Facsimiles, Company Telephones and Company
Mobile Telephones. Please be advised that your telecommunication may be
intercepted, read, copied, deleted or retrieved by authorised personnel,
other than the sender or recipient of the original telecommunication, as
the Company sees fit.
Although this message and its contents have been scanned for viruses and no
viruses were detected, no responsibility whatsoever is accepted by the
Company, or any of its offices or companies for any loss or damage
arising in any way from receipt or use thereof.
If you have received this email in error please delete this message and
notify the Polk System Administrator at postmaster@polkglobal.com.
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users