Passing parameters to jobs in batch

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

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
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

Which version of DataStage? There was a bug related to parameter passing in
an older version (I think it was 4.x or earlier) where strings containing
certain characters (we had problems with spaces in parameter values).
Certainly, this is fixed in the version we are currently using (5.2.1).

If you are using an old version, you try adding quotes to the string, but
this will cause problems in your job in a newer version

Eg ProsParam="'":trim(FileDate):"'"

Other than that, perhaps try setting the variable ProsParam to something
fairly bland (like a couple of letters and no date) and build up from there
to see exactly what causes the problem.


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:40 PM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch

This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

Hi David

I'm using version 6.0.1.5
I've tried adding quotes using the DQuote() and SQuote() routines but to no
avail...

Many thanks anyway..
Lawrence


-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:47
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


Which version of DataStage? There was a bug related to parameter passing in
an older version (I think it was 4.x or earlier) where strings containing
certain characters (we had problems with spaces in parameter values).
Certainly, this is fixed in the version we are currently using (5.2.1).

If you are using an old version, you try adding quotes to the string, but
this will cause problems in your job in a newer version

Eg ProsParam="'":trim(FileDate):"'"

Other than that, perhaps try setting the variable ProsParam to something
fairly bland (like a couple of letters and no date) and build up from there
to see exactly what causes the problem.


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:40 PM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch

This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

You are *sure* it is defined as a String? You've spelled the Parameter name
correctly or you would have gotten a different error. A string (mostly)
doesn't care what kind of values you put in it, so I'm surprised by this
error. I *could* see you getting this if it was defined as a Date.

Your other issue might be with your script. How are you "sure" you get the
correct output? Running it by hand doesn't really count, as the environment
it would run under when launched by a job isn't even close to a command line
lauch even if you source dsenv first. Add some checks and logging statements
for "FileDate" and "SystemReturnCode" to make sure it is getting set to what
you think it is getting set to. You may find the output of your script is
bad and that's what DataStage is complaining about.

-craig

-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com] On Behalf Of Ross, Lawrence
Sent: Monday, March 08, 2004 4:40 AM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

Guys, You may have tries this already, but I would start by running the same
bit of code but actually hardcoding the parameter value to be what you
expect from your Unix script. i.e. replace "ErrCode = DSSetParam(hJob1,
"pFileDate", ProsParam)" with "ErrCode = DSSetParam(hJob1, "pFileDate",
"04-03-07_15:00:00")".

If this works then we know that the problem is what's being output from the
Unix script. You can then concentrate your efforts there.

Regu

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: 08 March 2004 13:50
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


You are *sure* it is defined as a String? You've spelled the Parameter name
correctly or you would have gotten a different error. A string (mostly)
doesn't care what kind of values you put in it, so I'm surprised by this
error. I *could* see you getting this if it was defined as a Date.

Your other issue might be with your script. How are you "sure" you get the
correct output? Running it by hand doesn't really count, as the environment
it would run under when launched by a job isn't even close to a command line
lauch even if you source dsenv first. Add some checks and logging statements
for "FileDate" and "SystemReturnCode" to make sure it is getting set to what
you think it is getting set to. You may find the output of your script is
bad and that's what DataStage is complaining about.

-craig

-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com] On Behalf Of Ross, Lawrence
Sent: Monday, March 08, 2004 4:40 AM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


Department for Environment, Food and Rural Affairs (Defra)

This email and any attachments is intended for the named recipient only. Its
unauthorised use, disclosure, storage or copying is not permitted. If you have
received it in error, please destroy all copies and inform the sender. Whilst this
email and associated attachments will have been checked for known viruses
whilst within Defra systems we can accept no responsibility once it has left our
systems. Communications on Defra's computer systems may be monitored
and/or recorded to secure the effective operation of the system and for other
lawful purposes.

_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

Hi Regu and others..

I've already tried what you have suggested below and the second job
successfully picks it up.

I also tried running a different Unix command, a wc -l, and can successfully
pass this parameter through to my second job however when I run my "head"
command and try and pass this through it comes out as a blank. I've also
tried changing the cut parameters of my head command so that it picks up the
first part of the filename, i.e. "PR" but I'm still unable to see this in my
second job.

Is this a bug within datastage..?

I've tried writing the output of the head command to ds.loginfo and the
value appears correctly in the log but my second job just picks up a null
value. When I read the ErrCode value from my ds.setparam command it returns
-4 which translates to
"DSJE.BADVALUE ParamValue is not appropriate for that parameter
type"


I've now changed the way I do this and instead of writing the value of the
Unix head command straight out to a parameter value I'm now writing it to a
file and reading that value back in.??
This now works, and seems to be the way I'm going to have to do this...


Many thanks for your help
Lawrence



-----Original Message-----
From: Saliah, Regu (LBEU) [mailto:regu.saliah@DEFRA.GSI.GOV.UK]
Sent: 08 March 2004 14:05
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


Guys, You may have tries this already, but I would start by running the same
bit of code but actually hardcoding the parameter value to be what you
expect from your Unix script. i.e. replace "ErrCode = DSSetParam(hJob1,
"pFileDate", ProsParam)" with "ErrCode = DSSetParam(hJob1, "pFileDate",
"04-03-07_15:00:00")".

If this works then we know that the problem is what's being output from the
Unix script. You can then concentrate your efforts there.

Regu

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: 08 March 2004 13:50
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


You are *sure* it is defined as a String? You've spelled the Parameter name
correctly or you would have gotten a different error. A string (mostly)
doesn't care what kind of values you put in it, so I'm surprised by this
error. I *could* see you getting this if it was defined as a Date.

Your other issue might be with your script. How are you "sure" you get the
correct output? Running it by hand doesn't really count, as the environment
it would run under when launched by a job isn't even close to a command line
lauch even if you source dsenv first. Add some checks and logging statements
for "FileDate" and "SystemReturnCode" to make sure it is getting set to what
you think it is getting set to. You may find the output of your script is
bad and that's what DataStage is complaining about.

-craig

-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com] On Behalf Of Ross, Lawrence
Sent: Monday, March 08, 2004 4:40 AM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


Department for Environment, Food and Rural Affairs (Defra)

This email and any attachments is intended for the named recipient only. Its
unauthorised use, disclosure, storage or copying is not permitted. If you
have
received it in error, please destroy all copies and inform the sender.
Whilst this
email and associated attachments will have been checked for known viruses
whilst within Defra systems we can accept no responsibility once it has left
our
systems. Communications on Defra's computer systems may be monitored
and/or recorded to secure the effective operation of the system and for
other
lawful purposes.

_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

It is not possible to get DSJE.BADVALUE if the parameter type is String. I believe your parameter type is TimeStamp, in which case the format must be an ISO8601 TimeStamp (that is, YYYY-MM-DD HH:MM:SS. Yours has an underscore between the date and time components and only a two digit year.


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Passing parameters to jobs in batch

Post by admin »

Just another thought, if you can be bothered... you could try setting a
variable equal to your Unix command and echo that variable. Something
like....
UnixCommand = "export SYSVAR1=`head -1
":projectDir:"/controller/IEFListPR|cut -d/ -f 5|cut -c6-23`; echo
$SYSVAR1".

-----Original Message-----
From: Ross, Lawrence [mailto:LAWRENCE.ROSS@POLK.CO.UK]
Sent: 08 March 2004 15:32
To: 'DataStage Users Discussion List'
Cc: 'netechsupport@ascentialsoftware.com'; Griffiths, David
Subject: RE: Passing parameters to jobs in batch


Hi Regu and others..

I've already tried what you have suggested below and the second job
successfully picks it up.

I also tried running a different Unix command, a wc -l, and can successfully
pass this parameter through to my second job however when I run my "head"
command and try and pass this through it comes out as a blank. I've also
tried changing the cut parameters of my head command so that it picks up the
first part of the filename, i.e. "PR" but I'm still unable to see this in my
second job.

Is this a bug within datastage..?

I've tried writing the output of the head command to ds.loginfo and the
value appears correctly in the log but my second job just picks up a null
value. When I read the ErrCode value from my ds.setparam command it returns
-4 which translates to
"DSJE.BADVALUE ParamValue is not appropriate for that parameter
type"


I've now changed the way I do this and instead of writing the value of the
Unix head command straight out to a parameter value I'm now writing it to a
file and reading that value back in.??
This now works, and seems to be the way I'm going to have to do this...


Many thanks for your help
Lawrence



-----Original Message-----
From: Saliah, Regu (LBEU) [mailto:regu.saliah@DEFRA.GSI.GOV.UK]
Sent: 08 March 2004 14:05
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


Guys, You may have tries this already, but I would start by running the same
bit of code but actually hardcoding the parameter value to be what you
expect from your Unix script. i.e. replace "ErrCode = DSSetParam(hJob1,
"pFileDate", ProsParam)" with "ErrCode = DSSetParam(hJob1, "pFileDate",
"04-03-07_15:00:00")".

If this works then we know that the problem is what's being output from the
Unix script. You can then concentrate your efforts there.

Regu

-----Original Message-----
From: Craig Hulett [mailto:Craig.Hulett@comcast.net]
Sent: 08 March 2004 13:50
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


You are *sure* it is defined as a String? You've spelled the Parameter name
correctly or you would have gotten a different error. A string (mostly)
doesn't care what kind of values you put in it, so I'm surprised by this
error. I *could* see you getting this if it was defined as a Date.

Your other issue might be with your script. How are you "sure" you get the
correct output? Running it by hand doesn't really count, as the environment
it would run under when launched by a job isn't even close to a command line
lauch even if you source dsenv first. Add some checks and logging statements
for "FileDate" and "SystemReturnCode" to make sure it is getting set to what
you think it is getting set to. You may find the output of your script is
bad and that's what DataStage is complaining about.

-craig

-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com] On Behalf Of Ross, Lawrence
Sent: Monday, March 08, 2004 4:40 AM
To: 'DataStage Users Discussion List'
Subject: RE: Passing parameters to jobs in batch


This is defined as a string.

I've tried concatenating a couple letters to the front of my date to see if
this works but still get the same problem..



-----Original Message-----
From: David Barham [mailto:david@barham.hm]
Sent: 08 March 2004 11:31
To: DataStage Users Discussion List
Subject: RE: Passing parameters to jobs in batch


OK, I guess the obvious question is ... what type is your parameter
pFileDate defined as?


-----Original Message-----
From: datastage-users-bounces@oliver.com
[mailto:datastage-users-bounces@oliver.com]On Behalf Of Ross, Lawrence
Sent: Monday, 8 March 2004 9:26 PM
To: datastage-users@oliver.com
Subject: Passing parameters to jobs in batch

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


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users


Department for Environment, Food and Rural Affairs (Defra)

This email and any attachments is intended for the named recipient only. Its
unauthorised use, disclosure, storage or copying is not permitted. If you
have
received it in error, please destroy all copies and inform the sender.
Whilst this
email and associated attachments will have been checked for known viruses
whilst within Defra systems we can accept no responsibility once it has left
our
systems. Communications on Defra's computer systems may be monitored
and/or recorded to secure the effective operation of the system and for
other
lawful purposes.

_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
Locked