Page 3 of 3

Posted: Tue May 15, 2007 8:20 am
by DSguru2B
You gave -warn two times. Only one is needed.

Need more help

Posted: Tue May 15, 2007 9:54 am
by sashah
I get Status code = -2 DSJE_BADSTATE when executing the DSJOB command in a Unix script. I am passing the file name to Sequential File stage in a loop. This is to merge all the files in a directory into one.
DSguru2B wrote:You gave -warn two times. Only one is needed.

Posted: Tue May 15, 2007 10:17 am
by DSguru2B
Compile the job. DSJE_BADSTATE is indicating that the job is not in a runnable state.

Posted: Tue May 15, 2007 10:21 am
by sashah
I did that and when I ran it I see this error in the director

|MLConvertibleHistoryLoad..Sequential_File_23.DSLink39: DSD.SEQOpen No Filename to open..|
Thank you
DSguru2B wrote:Compile the job. DSJE_BADSTATE is indicating that the job is not in a runnable state.

Posted: Tue May 15, 2007 10:39 am
by DSguru2B
Look in the first entry of the log and see if all the parameters are being passed properly, if any.

Posted: Wed May 16, 2007 7:45 am
by sashah
Thank you.

I get an error Status code = -9999 DSJE_DSJOB_ERROR when I am calling DSJob from a Unix script. This job only fails for the file with the name as 3 February 2006.csv. When I test the same from within Datastage it works fine.
Can someone please tell me what I is incorrect out here.
DSguru2B wrote:Look in the first entry of the log and see if all the parameters are being passed properly, if any.

Posted: Wed May 16, 2007 8:00 am
by DSguru2B
So you have a file with the name '3 February 2006.csv'? How are you opening this file in your script?
First of all you have spaces in the name of your file, not a good practice, for files on unix. You will need to enclose the name in quotes to perform any operation on it, or else it will not find the file.

Posted: Wed May 16, 2007 8:03 am
by sashah
I am passing the file path and file name as a parameter to the Sequential File stage using DSJob that is called from a unix script.
DSguru2B wrote:So you have a file with the name '3 February 2006.csv'? How are you opening this file in your script?
First of all you have spaces in the name of your file, not a good practice, for files on unix. You will need to enclose the name in quotes to perform any operation on it, or else it will not find the file.

Posted: Wed May 16, 2007 8:08 am
by DSguru2B
You need quotes. Your param should look like

Code: Select all

dsjob -run -param 'FILENAME=/path/of/3 February 2006.csv' 

Posted: Wed May 16, 2007 9:27 am
by sashah
Thank you. That worked. How do I get the status of DSJob in a variable and is there a parameter that I need to pass for DSJob to return the status.
DSguru2B wrote:You need quotes. Your param should look like

Code: Select all

dsjob -run -param 'FILENAME=/path/of/3 February 2006.csv' 

Posted: Wed May 16, 2007 10:21 am
by DSguru2B
These are primary questions and are discussed before. Try searching for them before asking.

Code: Select all

dsjob -run -jobstatus -param .....
RetCd=$?
RetCd will have the jobstatus.
Really, please search before asking.

Posted: Wed May 16, 2007 10:45 am
by ivannavi
Is a paralell job an option for you? I ask this because your post is in General forum. With paralell jobs it's easy to do what you request in your original post.

Posted: Wed May 16, 2007 10:53 am
by sashah
I will do that. Thank you.
DSguru2B wrote:These are primary questions and are discussed before. Try searching for them before asking.

Code: Select all

dsjob -run -jobstatus -param .....
RetCd=$?
RetCd will have the jobstatus.
Really, please search before asking.

Posted: Fri May 18, 2007 9:18 am
by sashah
I have a column in a CSV file that holds Decimal values. However there are some rows with N/A in it. Can I use the Digit function or is there something available that would ignore NA.
Thank you.
sashah wrote:I will do that. Thank you.
DSguru2B wrote:These are primary questions and are discussed before. Try searching for them before asking.

Code: Select all

dsjob -run -jobstatus -param .....
RetCd=$?
RetCd will have the jobstatus.
Really, please search before asking.

Posted: Fri May 18, 2007 9:39 am
by chulett
Sashah - we're well past the scope of your initial post here. You are allowed to have more than one post, ya know. :wink:

When you have new questions, start new threads please.