RT_LOGNN latest run only

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
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

RT_LOGNN latest run only

Post by ashwin2912 »

Hi

I am running this command:

Code: Select all

$DSBIN/uv "select TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG32 where EVAL \"@ID\" NOT LIKE '//%' order by @ID;"
Is there any way i can filter out only those entries for the latest run of the job.

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

Post by ArndW »

The first entry of a job run sequence is where the TYPE column is equal to "5".
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Code: Select all

select 
   TIMESTAMP, 
   SEVERITY, 
   FULL.TEXT 
from 
   RT_LOG32 
where 
   EVAL \"@ID\" NOT LIKE '//%' 
   AND @ID > CAST(EVAL "FIELD(TRANS('RT_LOG32','//JOB.STARTED.NO',1,'X'), @SVM, 1)" AS DECIMAL)
order by 
   @ID
;
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You're really getting into this UniVerse/SQL now, aren't you? :D
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Maybe. That is what they asked for.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Certainly is. :D
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

Hi Kim,

First of all...thnx a lot

But can you throw some light on this error:

Code: Select all

$DSHOME/bin/uv "select TIMESTAMP, SEVERITY, FULL.TEXT from RT_LOG32 where EVAL \"@ID\" NOT LIKE '//%' AND @ID > CAST(EVAL \"FIELD('RT_LOG32','//JOB.STARTED.NO',1,'X')\" AS DECIMAL) order by @ID;"
Getting o/p:

Code: Select all

.
.
.
DataStage/SQL: CAST detected illegal data for the specified data type.
Program ".ITYPE.": pc = 0, Nonnumeric data when numeric required.  Zero used.
.
.
.

Also, can you tell where can I find documentation on this...I dont seem to find it in the DS PDF's.

Thanks,
Ashwin
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your query is not the same as Kim's. You left out @SVM, 1 as the second and third arguments of the field function.

This stuff is not in the public domain. That's why you can't find it in the PDFs. We've come to learn the structures by inspection (hacking?).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

Thnx Ray....
hmm...Inspection :twisted:
ashwin2912
Participant
Posts: 57
Joined: Wed Jan 26, 2005 10:22 pm
Location: India

Post by ashwin2912 »

Code: Select all

where EVAL \"@ID\" NOT LIKE '//%'

Code: Select all

CAST(EVAL \"FIELD(TRANS('RT_LOG32','//JOB.STARTED.NO',1,'X'), @SVM, 1)
Can u tell me what these actually do?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ashwin,

The EVAL statement evaluates a variable, so in this case it will check if the value of @ID is unlike '//%'.

The second statement is a bit trickier. The TRANS function is essentially a READ function, you give the filename, key and other attributes; the resultant record is a string separated by @FM and @VM characters, which the FIELD function then strips down to returning just the first value.

The EVAL, FIELD, TRANS I-type functions are UniVerse commands, they are not documented as part of the DataStage product but if you are still curious you can download all the UniVerse/DataStage database engine documents from IBM's websites (You can search this forum or IBM for links).
Post Reply