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
;
$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;"
.
.
.
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.
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).