DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 5:26 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 5:31 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 5:39 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 5:46 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 6:06 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 7:49 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 8:05 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 9:32 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Mon Mar 08, 2004 1:34 pm Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Tue Mar 09, 2004 3:00 am Reply with quote    Back to top    

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

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
admin
Site Admin



Joined: 12 Jan 2003
Posts: 8720

Points: 10

Post Posted: Wed Mar 10, 2004 3:01 am Reply with quote    Back to top    

** Reply Requested When Convenient **

Hello everybody

When I read your problem and your solutions, my only answers are:

1. The value that you say Unix sends is NOT a date. There is a _ between the date and the time. So this value can be only a string.
2. If your DataStage Parameter has been defined as a date, (the error message tends to confirm you did define it as a date), obviously the value you try to pass will be rejected on the ground of inappropriate data type.
3. Either you change your input value to a real date by converting the _ into a blank then pass it through to the reading program. This can be done in a control job with one single function of Basic.
4. Or you define your parameter as String and accept whatever value arrives. But then you must in a DataStage transformer, take the _ out and check that the value is indeed a date. Perhaps this checking is unecessary if you are confident that the value is always a valid date.

Best regards

Jean-Pierre Haddad


Subject: RE: Passing parameters to jobs in batch
To: 'DataStage Users Discussion List'
Cc: "'netechsupport@ascentialsoftware.com'"
, "Griffiths, David"

Message-ID:
Content-Type: text/plain; charset="iso-8859-1"

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:


Mit freundlichen Grüssen
J-P H

/'^'\
( o o )
-oOOO--(_)--OOOo---------------------------------

Jean-Pierre Haddad
Software Engineer
Informationsbereitstellung, IAID

Helsana Versicherungen AG
Lagerstrasse 7, CH-8600 Dübendorf, Switzerland
Mail: Postfach, CH-8024 Zürich, Switzerland
Direct phone: +41.1.823.91.32 (5232)
Cell phone: +41.7.88.23 46.53
Fax: +41.1.823.91.44
E-Mail: jeanpierre.haddad@helsana.ch
_________________________________
*****
This message has been checked for all known viruses by our viruswall.
IT-Security Department, Helsana Versicherungen AG
*****
_______________________________________________
datastage-users mailing list
datastage-users@oliver.com
http://www.oliver.com/mailman/listinfo/datastage-users

_________________
PLEASE READ
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.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours