Page 1 of 1

Getting Eventtype from RT_LOG file

Posted: Mon Jan 11, 2010 10:03 am
by DSUser2000
Using a Hashed File Stage it is possible to read alle fields without knowing how they are called. I found a field which I would call something like "eventtype". There are entries like TFCN000001 or TODC000085 in it which classify the messages (seem to be those codes for which message handlers can be created).
How can I get this field from a Universe DB stage (selecting the other fields is no problem, I have all the names)? I need to know the exact column name there but I don't know how to get it...

Posted: Mon Jan 11, 2010 10:22 am
by chulett
Give this a shot, see if it answers your question:

Code: Select all

LIST.DICT RT_LOG 

Posted: Mon Jan 11, 2010 11:10 am
by DSUser2000
Unfortunately it's not listed:

Code: Select all

DICT RT_LOG    18:00:50  01-11-10  Page    1

               Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth &
Name.......... Number Definition... Code........ Heading........ Format Assoc..

@ID            D    0                            RT_LOG          10'0'R S
TYPE           D    1                            Type            2R     S
WAVE.NO        D    2                            Wave No.        8R     S
TIMESTAMP      D    3                            Timestamp       19L    S
MSG.ARGS       D    5                            Message Args    15L    M
MSG.TEXT       D   10                            Message Text    60T    M
FULL.TEXT      I      SUBR("*DataSt              Full Text       60T    M
                      age*DSR_MESSA
                      GE",@ID,MSG.T
                      EXT,RAISE(MSG
                      .ARGS))
SEVERITY       I      FIELD("Info,W              Severity        8L     S
                      arning,Fatal,
                      Reject,Starte
                      d,Reset,Error
                      ,Debug",",",T
                      YPE)
@              PH     ID.SUP
Press any key to continue...
DICT RT_LOG    18:00:56  01-11-10  Page    2

               Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth &
Name.......... Number Definition... Code........ Heading........ Format Assoc..

                      SEVERITY
                      FULL.TEXT
                      WITH @ID LIKE
                      '0N' BY @ID

9 records listed.
It seems to be some kind of hidden field? However, it's definately there. If you look into the file itself via hex editor you can see the values which are seperated like every other column.

Posted: Mon Jan 11, 2010 4:05 pm
by ray.wurlod
You need to list the dictionary of YOUR hashed file, not of RT_LOG !

If you know the position of the field in the data record, you can create an entry using that information in the Columns grid of the Hashed File stage, giving as the column name any legal name.

The key column is position 0, the non-key columns are numbered from 1.

Posted: Mon Jan 11, 2010 4:15 pm
by DSUser2000
The output of the real hashed file is actually the same, I tried that before.

Posted: Mon Jan 11, 2010 4:24 pm
by ray.wurlod
So what do you mean by "Event Type"? The TYPE column contains an enumerated value that maps onto the Type column in Director (and which is displayed as Event Type in detail log view) - is this what you mean?

Posted: Mon Jan 11, 2010 4:36 pm
by DSUser2000
The TYPE column is basically redundant to SEVERITY as SEVERITY is created from it. This is not what I mean.
The kind of "event type" I mean has entries like "TFCN000001" which for example stands for the message that datastage has been started. So it's more or less redundant to the information in the MSG.TEXT column. I think it's a kind of mapping key to a list of messages which shall allow localization or so?
If you look for example here: viewtopic.php?t=100177 (first post) you can also see these "event types" displayed.

Posted: Mon Jan 11, 2010 5:34 pm
by ray.wurlod
TYPE is 5 for "Control", 1 for "Info", 7 for "Run Job" and so on. It does "double duty".

Posted: Mon Jan 11, 2010 7:40 pm
by DSUser2000
I know that as this mapping between TYPE and SEVERITY is basically in the table definition posted in my second post.

This "event type" (perhaps a bad name? "message code" or so is perhaps better?) would be a lot more detailed than TYPE and allows searching for specific messages. With TYPE you can only search for warnings in general but with this field you could search for example the specific warning about duplicate keys. Sure, you could also achieve this through searching for all matching TYPEs and then doing a full text search but this is not very efficient.

However, if it's not possible I'll have to live with that...

Posted: Mon Jan 11, 2010 11:40 pm
by ray.wurlod
OK, fields 4 and 8 both seem to contain the Message ID. Neither of these - as you noted - is mentioned in the file dictionary. However the expression EVAL "@RECORD<4>" can be used in a query to access the contents of field #4. Or use Position 4 in the columns grid of a Hashed File stage.

Posted: Tue Jan 12, 2010 3:13 am
by DSUser2000
In my files I can get it only using
EVAL "@RECORD<8>"
in the derivation field of the universe stage (perhaps depends on DS version?). It now works fine, thanks a lot!