How to read a seq file created by a DSGetLogSummary ??

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
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Format is is visible from the log info itself.

From the info shown in the log file, just use any name whatever you want and get the columns which you want.
E.g. first one seems to be a event number, then the timestamp and then the eventy type and then last one is the message.
Use the delimiter as '\' and then read the cols with whatever colname u want and then using copy stage you can drop the column which you do not want.
Regards,
S. Kirtikumar.
rajan.n
Premium Member
Premium Member
Posts: 96
Joined: Mon Oct 09, 2006 7:47 am

Post by rajan.n »

hi kirti kumar,
thanks for ur responce
i already tried that .that did not worked.
any how i was trying using with : as delimiter..,it is dividing the the line in to 5 diff coloumns where it finds ":", my result is to extract the last field. any how this is not the correct process but ,am doing it now. thanks a lot ,
but i need to learn y it has not allowed me with /.



Kirtikumar wrote:Format is is visible from the log info itself.

From the info shown in the log file, just use any name whatever you want and get the columns which you want.
E.g. first one seems to be a event number, then the timestamp and then the eventy type and then last one is the message.
Use the delimiter as '\' and then read the cols with whatever colname u want and then using copy stage you can drop the column which you do not want.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your basic premise, that the job log is a text file, is incorrect. It is a database table within the DataStage Repository. The dsjob command executes an appropriate query to retrieve the information, then reformats it. If you want that information into a text file, redirect stdout of your dsjob command. After that, you can use any utility you like (Excel?) to parse the delimited data.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Actually I was referring to the file created by the OP. I assumed he has used DSLogGetSummary and then stored in the info in the seq file. That is the reason I mentioned it as sequential file.

Rajan, have you written or using a routine to read the log files and then building the normal file from it?

If this is the case, then the mentioned approach should work for you. If it is not allowing you to use it as delimiter, then read the whole line as a single column. Then using string functions like field, substring you can extract the required info from it.
HTH.
Regards,
S. Kirtikumar.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Kirtikumar wrote:Rajan, have you written or using a routine to read the log files and then building the normal file from it?
I guess you haven't been following this little... 'exercise', eh? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
rajan.n
Premium Member
Premium Member
Posts: 96
Joined: Mon Oct 09, 2006 7:47 am

Post by rajan.n »

hi,
thnks for the reply,
i have writen routine . which creates a .txt file. teh fileincludes the warning msg of a job.
so now i want to extract only db warnings from that file.
what my logic is ..if any warning has sql state i need to extract them.







Kirtikumar wrote:Actually I was referring to the file created by the OP. I assumed he has used DSLogGetSummary and then stored in the info in the seq file. That is the reason I mentioned it as sequential file.

Rajan, have you written or using a routine to read the log files and then building the normal file from it?

If this is the case, then the mentioned approach should work for you. If it is not allowing you to use it as delimiter, then read the whole line as a single column. Then using string functions like field, substring you can extract the required info from it.
HTH.
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

I already had once created such routine for one my X assignments Craig!!!

Rajan, simple string find operations are required for this. Post the result if it worked or not.
Regards,
S. Kirtikumar.
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

We had a similar 'requirement' to create a log-file.
Convinced the client it wasnt possible as data stage is an application :D . All we dd was to write warning and error messages to a log file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Kirtikumar wrote:I already had once created such routine for one my X assignments Craig!!!
Me too!!! :wink:

Not what I meant. If you click on the OP's handle and then do a 'Find all posts by', you'll see that the last umpty posts they have made have all been about a Quest For Log Files. It's been... interesting.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply