Copy log to a txt file ERROR

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Copy log to a txt file ERROR

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Try giving the server name, user name and password explicitly in the command.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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 
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just leave out (omit) the -type option to get all types.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That should be - as already noted - that you are using logsum rather than logdetail... yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just use the number, don't include the word 'event' on the command line.
-craig

"You can never have too many knives" -- Logan Nine Fingers
fmartinsferreira
Participant
Posts: 142
Joined: Wed Mar 24, 2004 10:51 am
Location: Brazil

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply