Page 1 of 2

Copy log to a txt file ERROR

Posted: Thu Jun 26, 2008 11:41 am
by fmartinsferreira
Hi,

I'm trying to copy the complete(INFO | WARNING | FATAL | REJECT | STARTED | RESET | BATCH) log into a txt file and I'm having the following error:

ERROR: Failed to open project
Status code = 39204


My Project = DWProjetoDBM
My Job = Load_FTP_DSwitch
My Txt_target = C:\temp\test\DWProjetoDBMLog.txt

I'm using the following command:

C:\Ascential\DataStage\Engine\bin\dsjob -logsum -type INFO -max 30 DWProjetoDBM Load_FTP_DSwitch > C:\temp\teste\DWProjetoDBMLog.txt


Can anyone help me?

Regards,

Fernando

Posted: Thu Jun 26, 2008 12:33 pm
by DSguru2B
Try giving the server name, user name and password explicitly in the command.

Posted: Thu Jun 26, 2008 12:59 pm
by fmartinsferreira
DSguru2B wrote:Try giving the server name, user name and password explicitly in the command. ...
:oops: Sorry, but looking the dsjob sintax I did'nt see where i need to put server name, user name and password. :oops:

Regards,

Fernando

Posted: Thu Jun 26, 2008 1:07 pm
by DSguru2B
Use the following command and fill in the server name, user and password and remove the << and >>.

Code: Select all

C:\Ascential\DataStage\Engine\bin\dsjob -server <<Your Server>> -user <<Your User>> -password <<Your Password>> -logsum -type INFO -max 30 DWProjetoDBM Load_FTP_DSwitch > C:\temp\teste\DWProjetoDBMLog.txt 

Posted: Thu Jun 26, 2008 1:37 pm
by fmartinsferreira
DSguru2B wrote:Use the following command and fill in the server name, user and password and remove the << and >>.

Code: Select all

C:\Ascential\DataStage\Engine\bin\dsjob -server <<Your Server>> ...[/quote]

Now, worded with the following command:

C:\Ascential\DataStage\Engine\bin>dsjob -server myserver -user myuser -password mypassword -logsum -type INFO -max 30 DWProjetoDBM Load_FTP_DSwitch > C:\
temp\test\DWProjetoDBMLog.txt

But, I need the complete log (INFO | WARNING | FATAL | REJECT | STARTED | RESET | BATCH | ...)

I tryed:

C:\Ascential\DataStage\Engine\bin>dsjob -server myserver -user myuser -password mypassword -logsum -type INFO | WARNING -max 30 DWProjetoDBM Load_FTP_DSwitch > C:\
temp\test\DWProjetoDBMLog.txt

and

C:\Ascential\DataStage\Engine\bin>dsjob -server myserver -user myuser -password mypassword -logsum -type INFO WARNING -max 30 DWProjetoDBM Load_FTP_DSwitch > C:\
temp\test\DWProjetoDBMLog.txt

but, doesn't worded. :oops: 

Regards,

Fernando

Posted: Thu Jun 26, 2008 1:40 pm
by DSguru2B
So now, your command is working but your not happy with the output, right?
If that is the case then I think you need detailed log, use the -logdetail command instead of logsum and if you are on 7.5 or above, at the end you can give the event id numbers, so all the logs between those numbers will be generated. Read about it under Command Line Interface in your server edition developers guide.

Posted: Thu Jun 26, 2008 4:12 pm
by ray.wurlod
Just leave out (omit) the -type option to get all types.

Posted: Fri Jun 27, 2008 6:30 am
by fmartinsferreira
ray.wurlod wrote:Just leave out (omit) the -type option to get all types. ...
Hi Ray!

Worked, but omitting the -type option I haven't the complete Message, for example:

The complete message for the event 10 is:

Load_FTP_DSwitch..D_SWITCH:
SELECT S.SWITCH_KEY SWITCH_KEY,
S.DESCRIPTION DESCRIPTION,
S.CNL CNL,
S.SWITCH_CODE SWITCH_CODE,
S.SWITCH_ABBREVIATION SWITCH_ABBREVIATION,
S.DESCRIPTION_GIS DESCRIPTION_GIS,
S.STATUS STATUS,
S.FREE_CONNECTION_POINT FREE_CONNECTION_POINT,
S.USED_CONNECTION_POINT USED_CONNECTION_POINT,
S.TOTAL_CONNECTION_POINT TOTAL_CONNECTION_POINT,
S.ACTIVATION_DATE ACTIVATION_DATE,
S.DEACTIVATION_DATE DEACTIVATION_DATE
FROM D_SWITCH S
WHERE S.RECORD_STATUS = 1
AND S.START_DATE >= SYSDATE - 30
AND S.START_DATE < SYSDATE


With the command I only have:

Load_FTP_DSwitch..D_SWITCH:
SELECT S.SWITCH_KEY SWITCH_KEY, (...)

Regards,

Fernando

Posted: Fri Jun 27, 2008 7:35 am
by chulett
That should be - as already noted - that you are using logsum rather than logdetail... yes?

Posted: Fri Jun 27, 2008 11:30 am
by fmartinsferreira
chulett wrote:That should be - as already noted - that you are using logsum rather than logdetail... yes? ...
Yes, I was using -logsum!

But ..

My Project = DWProjetoDBM
My Job = Load_FTP_DSwitch

When i tryed to use the command:

dsjob -server myserver -user myuser -password mypassword -logdetail DWProjetoDBM Load_FTP_DSwitch

Give me the following message:

Invalid arguments: dsjob -logdetail [-useid] <project> <job|jobid> <event id>
Status code = -9999 DSJE_DSJOB_ERROR


How I need the all events, so I omitted <event id>, is it correct?

I'm thinking that i need to put <job|jobid>!

But when I try to get the jobid by
dsjob -server 10.32.14.140 -user fernandomf -password Gustavo10 -jobid DWProjetoDBM Load_FTP_DSwitch

Only show me Status code = 0 and not the jobid.

Regards,

Fernando

Posted: Fri Jun 27, 2008 12:07 pm
by chulett
Forget about 'jobid', it is not needed and only useful if you've assigned a job an 'alias/id' which not many peoples do, I'd wager. You missed the eventid which caused the syntax error. AFAIK, you need to get a list of event ids and then loop thru them getting the detail for each one.

Now, I've never seen a need to futz with this so could be completely wrong. I'll let others that have actually done this pop in with the gory details.

Posted: Fri Jun 27, 2008 12:36 pm
by fmartinsferreira
chulett wrote:Forget about 'jobid', it is not needed and only useful if you've assigned a job an 'alias/id' which not many peoples do, I'd wager. You missed the eventid which caused the syntax error. AFAIK, you need to get a list of event ids and then loop thru them getting the detail for each one.

Now, I've never seen a need to futz with this so could be completely wrong. I'll let others that have actually done this pop in with the gory details.
I put the event in the command, but get only the event 0.

Work
dsjob -server myserver -user myuser -password mypassword -logdetail DWProjetoDBM Load_FTP_DSwitch event0
Event Id: 0
Time : Fri Jun 27 09:20:25 2008
Type : RESET
User : fernandomf
Message : Log cleared by user
Status code = 0


Work
dsjob -server myserver -user myuser -password mypassword -logdetail DWProjetoDBM Load_FTP_DSwitch event10
Event Id: 0
Time : Fri Jun 27 09:20:25 2008
Type : RESET
User : fernandomf
Message : Log cleared by user
Status code = 0

Doesn't work
dsjob -server myserver -user myuser -password mypassword -logdetail DWProjetoDBM Load_FTP_DSwitch event 10
Invalid arguments: dsjob -logdetail [-useid] <project> <job|jobid> <event id>

Status code = -9999 DSJE_DSJOB_ERROR

Regards,

Fernando

Posted: Fri Jun 27, 2008 12:38 pm
by chulett
Just use the number, don't include the word 'event' on the command line.

Posted: Fri Jun 27, 2008 1:45 pm
by fmartinsferreira
chulett wrote:Just use the number, don't include the word 'event' on the command line. ...
Thanks a lot Chullet, now work! :D

dsjob -server myserver -user myuser -password mypassword -logdetail DWProjetoDBM Load_FTP_DSwitch 2

Now, my problem is make a routine that get all log entries and put it in a txt file.

Regards,

Fernando

Posted: Mon Jun 30, 2008 9:17 am
by DSguru2B
I mentioned earlier in my post that if you are on 7.5 or higher, you dont need to loop through the event ids. Give two event ids, it will generate the detailed log between those two event ids.