Getting DSGetLogSummary in More readable format

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hemant_Kulkarni
Premium Member
Premium Member
Posts: 50
Joined: Tue Jan 02, 2007 1:40 am

Post by Hemant_Kulkarni »

char(13) : char(10) will give you desired line break
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Hi Hemant
My DSGetLogSummary Looks as follows
CompleteJobEventDetail = DSGetLogSummary(DSJ.ME,DSJ.LOGANY,StartTime,EndTime,0)
Where do i fit the line seperator.
DSMakeJobReport has the syntax to include a line break but DSGetLogSummary doesn't
Sorry if i sounded naive. i really didn't get where to use line seperator to get the required result

Thanks
Pavan
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Use CONVERT(@FM,CHAR(10),YourResultString) to convert all field marks to carriage returns in your returned string.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Replace the field marks with linefeed characters (Char(10)).

Code: Select all

Convert(@FM, Char(10), DSGetLogSummary(DSJ.ME,DSJ.LOGANY,StartTime,EndTime,0))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Great
Thanks a lot Ray and Arnd it worked.

The Log which i got out isn't complete log. it is more like an snap shot of the log
An Example log i got from DSGetLogSummary is as follows

Code: Select all

636\2007-06-13 11:10:55\5\MACBNT\2\Starting Job FIF_Prep_Desc_InProgress_YP.MACBNT. (...) 
637\2007-06-13 11:10:55\1\MACBNT\2\Environment variable settings: (...) 
638\2007-06-13 11:10:55\1\MACBNT\2\Parallel job initiated (...) 
In the above example where ever i had (...) gives me more info when i open it in the log.
But when i am writing it out i am expecting to get the whole information without the (...). Just so that i can go back if there is a problem and resolve it.
Is there any function i can use to get the whole log but not the snap shot

Thanks
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Suggest you look into DSGetLogEntry rather than DSGetLogSummary.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Chulett
If i am right i understand that DSGetLogEntry goes on the log with the Event id which i can get from DSGetNewestLogId. This will get me the latest event id but i am looking for the whole log.
I wondered if there is some way if i can get the event id's and hold them and fire my DSGetLogEntry with each event id but i don't guess it will work as my jobs are parallel and i am using an After Job Subrotuine to get this functionality of capturing the log.

Thanks
Pavan
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Capture the last or latest event id before the job is run and save it in a file. Now you can have your after job sub routine read this file to get the first event id for your run, get the last event id and then use the GetLogEntry in a loop starting from the first event id to the last event id, to get your entire log for the run.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Entries are probably still buffered for writing when you're executing your after-job subroutine. Add a SLEEP of at least two seconds duration. Even better, use a Routine activity after the Job activity in a job sequence; in an after-job subroutine you can never catch the "job finishing" message.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavan_Yelugula
Premium Member
Premium Member
Posts: 133
Joined: Tue Nov 23, 2004 11:24 pm
Location: India

Post by Pavan_Yelugula »

Thanks all
The Only things which are getting cut out from the DSGetLogSummary are the environment variable setting and the configuration file setting which my client is ok with.
So Right now we will be going forward with what we have in place and if need arise i will code to include with the event id's or with the sleep like ray suggested.

Thanks for all the help

Thanks
Pavan
Post Reply