Processing files in a directory
Moderators: chulett, rschirm, roy
Need more help
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.
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.
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.
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.
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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
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.
You need quotes. Your param should look like
Code: Select all
dsjob -run -param 'FILENAME=/path/of/3 February 2006.csv'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
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 likeCode: Select all
dsjob -run -param 'FILENAME=/path/of/3 February 2006.csv'
These are primary questions and are discussed before. Try searching for them before asking.
RetCd will have the jobstatus.
Really, please search before asking.
Code: Select all
dsjob -run -jobstatus -param .....
RetCd=$?
Really, please search before asking.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
I will do that. Thank you.
DSguru2B wrote:These are primary questions and are discussed before. Try searching for them before asking.RetCd will have the jobstatus.Code: Select all
dsjob -run -jobstatus -param ..... RetCd=$?
Really, please search before asking.
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.
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.RetCd will have the jobstatus.Code: Select all
dsjob -run -jobstatus -param ..... RetCd=$?
Really, please search before asking.