Page 1 of 1

dsjob command getting hanged when -jobstatus option is used.

Posted: Mon Apr 30, 2012 2:08 pm
by saiwelcomes
Hi,

I have used dsjob command to trigger the job in my server routine.

First of all I am checking the whether the job is in compiled/finished/aborted status using dsjob -jobstatus command.

If the job is in aborted state, i am going to reset the job.

But my problem is the dsjob -jobstatus which i have used to get the status of the job is not returning me the result for long time more than 30mins and getting hanged.

Especially when i use the dsjob command with -file switch, it is hanging. I have stored the datastage credentials in a file and given the path to it.

What could be the issue. I need a very urgent help on this.

Thanks in advance.

Re: dsjob command getting hanged when -jobstatus option is u

Posted: Mon Apr 30, 2012 2:17 pm
by chulett
saiwelcomes wrote:I have used dsjob command to trigger the job in my server routine.

First of all I am checking the whether the job is in compiled/finished/aborted status using dsjob -jobstatus command.
That option is actually used to run a job and then wait until it is complete before passing back the status of the job. You need to be using "-jobinfo" instead and then grep'ing through the results to determine what happened the last time the job was run.

Posted: Mon Apr 30, 2012 2:26 pm
by saiwelcomes
Yes. I am sorry. I am using -jobinfo to get the status of the job. dsjob command is not resulting any status and getting hanged.

Posted: Mon Apr 30, 2012 3:16 pm
by chulett
Sorry, never seen an issue where a simple "-jobinfo" request would hang. Are you saying it always hangs for all jobs or you only have this problem with one particular job?

Posted: Mon Apr 30, 2012 8:32 pm
by PaulVL
Add more debugging statements to your routine.

Echo the command you are trying to submit (as built up by your routine). Then simulate that command on the command line with the same credentials you are using to execute the routine. remember that your routine will execute in your project directory.

Posted: Wed May 02, 2012 12:41 am
by saiwelcomes
Yes. I have placed many DSLogInfo command after each step in my routine.

This problem is occurring when -file switch is used to retrive the domain, server, user, password from a file.

Any help plz..

Posted: Wed May 02, 2012 3:55 am
by ray.wurlod
Show us the actual syntax that you are using. Your routine code might also be useful.

Posted: Wed May 02, 2012 4:29 am
by saiwelcomes
Hi ray,

This is the code snippet used to get the jobinfo in my routine.

cmd$DSENV = "cd '":p_DSHOME_DIR:"'":char(10) ;
cmd$DSENV := ". ./dsenv":char(10) ;
reconJob$Status = cmd$DSENV
reconJob$Status := "dsjob -file '":EV_SCRIPTS_DIR:"'/'":DS_ENV_INFO_FILE:"' '":DS_DOMAIN:"' '":DS_SERVER:"' -jobinfo '":DS_PROJECT_NAME:"' '":JobName:"'"
Call DSExecute("UNIX", reconJob$Status,OsOutput$Status, OsStatus$Status)


DS_ENV_INFO_FILE param is file with .sh extension having domain,server,user,password information.

Posted: Wed May 02, 2012 3:39 pm
by ray.wurlod
Can you capture the value of reconJob$Status before the call to DSExecute()? I'm not of a mind to try to balance your quote characters by eye.