Question & Answer
Question
How do I save the log of a DataStage Job into a file using DataStage Director?
Answer
Full detailed job log is very important information for troubleshooting any DataStage or Information Analyzer job runtime issue.
Please follow below instructions to print job log to a file when IBM technical support requests to send a job log.
1. Log in to DataStage Director.
2. In Status view, select the job you want to view the log.
3. Switch to Log view using "Log" button on the toolbar or View > Log menu.
4. Choose View > Show All menu to display all log entries.
Alternatively, choose View > Filter Entries... menu (or press Control-T keys), in the Filter dialog box
select "Oldest" button in From radio button group,
select "Newest" in Through radio button group,
choose "Select all entries" in Limit group,
select all boxes in Type check box group.
select "Oldest" button in From radio button group,
select "Newest" in Through radio button group,
choose "Select all entries" in Limit group,
select all boxes in Type check box group.
Note: After this step, there must be check mark in front of "Show All" menu item.
5. Sort the log items in ascending time order.
If the header is not set to ">Occurred >On date", click "Occurred" until it changes to ">Occurred >On date".
6. Print log to file using "Print..." button on the toolbar or Project > Print... menu.
Select "All entries", "Full details", and "Print to file" in the Print dialog box, then click OK.
Enter the name of a text file to use in the "Print to file" dialog box.
7. Open the saved file in text editor like notepad.exe and check if the logs are saved correctly.
Full detailed job log should contain the "Starting Job" and "Finished Job" log entries.
Full detailed job log should contain the "Starting Job" and "Finished Job" log entries.
Note:
- For a multiple instance job, it is recommended to save each instance log in separate file.
You can save all instances logs in one file by selecting the root job, in that case please sort the log entries by job Invocation IDs instead of time.
- You can collect DataStage job log using DSEngine/bin/dsjob command as well.
"bin/dsjob -logdetail -full ProjectName JobName[.InvocationID]" command captures only the last run log.
To collect all runs log, use "bin/dsjob -logdetail -full ProjectName JobName[.InvocationID] OldestEventId NewestEventId" command as below.
(1) Get the oldest event ID for the job.
bin/dsjob -logsum -type STARTED ProjectName JobName 2>/dev/null | awk 'NR == 1 {print $1}'
bin/dsjob -logsum -type STARTED ProjectName JobName.InvocationID 2>/dev/null | awk 'NR == 1 {print $1}' # for multiple instance job
(2) Get the newest event ID for the job.
bin/dsjob -lognewest ProjectName JobName 2>/dev/null | cut -d' ' -f4
bin/dsjob -lognewest ProjectName JobName.InvocationID 2>/dev/null | cut -d' ' -f4
(3) Collect all log items between the 2 event IDs.
bin/dsjob -logdetail -full ProjectName JobName OldestEventId NewestEventId > /somewhere/job.log
bin/dsjob -logdetail -full ProjectName JobName.InvocationID OldestEventId NewestEventId > /somewhere/job.log
[{"Product":{"code":"SSVSEF","label":"IBM InfoSphere DataStage"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"All Editions","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Was this topic helpful?
Document Information
Modified date:
08 July 2021
UID
swg21574038