Page 1 of 2

I-descriptor was not compiled

Posted: Tue Feb 06, 2007 5:54 pm
by cnguyen
I would like to get a list of log entries for a job which were generated after a point in time. I am using a UNIVERSE stage with the below SQL.

SELECT @ID, "TYPE", TIMESTAMP, EVAL "FULL.TEXT[1,8]", EVAL "@RECORD<7>" FROM UNNEST RT_LOG2547 ON FULL.TEXT WHERE @ID >= 0 AND TIMESTAMP >= '2007-02-05 07:03:30' AND ((FULL.TEXT LIKE "Starting Job%" or FULL.TEXT LIKE "Finished Job%" or FULL.TEXT like "Job%aborted.") and TYPE=5) or (FULL.TEXT like "%Stopped" and TYPE=1) ORDER BY @ID

The job runs fine for projects with small number of jobs but on one project where there are 1700+ jobs, it failed intermittently with the following errors.

The main objective is to find all "start" and "finish" entries so we can calculate actual runtime of the job.

Any idea on the error as well as possible solution is greatly appreciated.

Thanks

SQLSTATE=S1000, DBMS.CODE=40030
[DataStage][SQL Client][UNIVERSE]I-descriptor "@RECORD<7>" was not compiled.

DataStage Job 2768 Phantom 20765
@RECORD < 7 >
Job Aborted after Fatal Error logged.
Attempting to Cleanup after ABORT raised in stage mdsGetJobElapsedTime.1.findFinishes
DataStage Phantom Aborting with @ABORT.CODE = 1

Posted: Tue Feb 06, 2007 7:33 pm
by kduke
I have seen this before. I think you need to learn to create dictionary items and not use EVAL. It is less stable.

Posted: Tue Feb 06, 2007 7:35 pm
by ray.wurlod
Does this occur reliably or occasionally? Is there a pattern - for example does it occur for some values of job number in RT_LOGnnnn and not for other values?

Why are you using UNNEST (normalizing on FULL.TEXT)? I don't think it's necessary for selecting.

Posted: Wed Feb 07, 2007 1:45 am
by cnguyen
Thanks for the quick response. The job is scheduled to run at 6:00 everyday on all DataStage servers. It usually fails on Sunday morning and on large (500+ jobs) projects. I have not been able to establish a pattern and will continue to track this.

As far as using the UNNEST to normalize FULL.TEXT, we used the code from a sample job and did not know that was not neccessary. I will try without it.

Thanks

Posted: Wed Feb 07, 2007 1:53 am
by cnguyen
kduke wrote:I have seen this before. I think you need to learn to create dictionary items and not use EVAL. It is less stable.
Kim,

I only want to bring back the first 8 characters of FULL.TXT so the EVAL "FULL.TEXT[1,8]" entry. Also, I need to find the invocation id and hence the EVAL "@RECORD<7>" entry. Don't know of another way to do this beside the EVALs. I appreciate any suggestions that you can provide.

Thanks

Posted: Wed Feb 07, 2007 2:52 am
by ArndW
You could try using F7 instead of the EVAL statement to get field 7. I'm not at a client now to check, but am fairly certain that F1-F9 are declared for use as positional columns.

Posted: Wed Feb 07, 2007 4:37 am
by ray.wurlod
That only works in RetrieVe, not in DataStage SQL. What Arnd is referring to is that VOC contains D-type field descriptors F1 through F9, that can be used to refer to any field (from 1 to 9) in a record. You could certainly do this by specifying RT_LOGnnnn USING DICT VOC in your FROM clause; however, you could not then get at FULL.TEXT which is in DICT RT_LOG rather than in DICT VOC.

You could add a descriptor for field #7 to the log dictionary.

Code: Select all

INSERT INTO DICT RT_LOG(ID, CODE, LOC, NAME, FORMAT, SM) VALUES ('INV_ID', 'D', 7, 'Inv ID', '6R', 'S');


Now your query, with no EVALs, looks like this:

Code: Select all

SELECT @ID FMT '5R' COL.HDG 'Event', "TYPE", TIMESTAMP, SUBSTRING(FULL.TEXT FROM 1 FOR 8) FMT '8L' COL.HDG 'FullText', INV_ID FROM RT_LOG2547 WHERE CAST(@ID AS VARCHAR) NOT LIKE '//%' AND TIMESTAMP >= '2005-02-07 00:00:01' AND ((FULL.TEXT LIKE 'Starting Job%' OR FULL.TEXT LIKE 'Finished Job%' OR FULL.TEXT LIKE 'Job%aborted.') AND "TYPE" = 5) OR (FULL.TEXT LIKE '%Stopped%' AND "TYPE" = 1) ORDER BY @ID;

Posted: Wed Feb 07, 2007 5:24 am
by ArndW
Ray - thanks for pointing that out; I didn't realize that the SQL syntax was being used.

Posted: Wed Feb 07, 2007 2:50 pm
by cnguyen
We found out that "INVOCATION.ID" is one of the fields that we can use in the SQL. Also decided to bring the FULL.TEXT and not portion of it back. The new SQL now looks like.

Code: Select all

SELECT @ID, "TYPE", TIMESTAMP, "FULL.TEXT", "INVOCATION.ID" FROM #rtLogFile# WHERE @ID >= 0 AND TIMESTAMP >= '#CollectionTime#' AND ((FULL.TEXT LIKE "Starting Job%" or FULL.TEXT LIKE "Finished Job%" or FULL.TEXT like "Job%aborted.") and TYPE=5) or (FULL.TEXT like "%Stopped" and TYPE=1) ORDER BY @ID;
EVAL is not used any more. We have redeployed this change and will continue to monitor to see if the problem will reoccur. Many thanks to you all.

Ray, in your post you have the following code

Code: Select all

WHERE CAST(@ID AS VARCHAR) NOT LIKE '//%'
Can you let me know what is the effect of this condition?

Thanks

Posted: Wed Feb 07, 2007 4:45 pm
by ArndW
There are up to 3 log file entries that are used to hold internal data (including the purge settings) and that have different metadata than the other records. Since you don't want (or need) them, Ray added the filter to remove them. These records begin with "//"

Posted: Wed Feb 07, 2007 7:38 pm
by ray.wurlod
Luckily for you, the ASCII code for "/" is 47 and the ASCII code for "0" is 48, so that your filter (WHERE @ID >= 0) will also exclude the control records.

Posted: Wed Feb 07, 2007 10:50 pm
by cnguyen
Thanks for saving me some work. Just getting ready to add the filter below and found your latest reply. Ran the new code multiple times today against the largest project and the error has not occured. Will continue to monitor the jobs for a few more days.

Code: Select all

WHERE CAST(@ID AS VARCHAR) NOT LIKE '//%'

Posted: Wed Feb 07, 2007 11:56 pm
by ray.wurlod
The error won't occur. Because you have no EVAL expressions in your SQL, there are no I-descriptor expressions (which are introduced by EVAL) to compile.

Posted: Mon Feb 12, 2007 1:23 pm
by cnguyen
This issue has been resolved. The change to remove EVALs works. Many thanks to all for your help :D

Posted: Mon Feb 12, 2007 9:10 pm
by kduke
Ray I thought the slashes were backslashes?