Page 1 of 2

Error

Posted: Wed Nov 16, 2005 11:44 pm
by Jayesh_09
Hi

I'm getting the following error while running the job.


DataStage Job 1277 Phantom 3097
Program "DSU.GetNextElemSequence": Line 22, Improper data type.
Attempting to Cleanup after ABORT raised in stage COM_SERV_TEST..Transformer_22
DataStage Phantom Aborting with @ABORT.CODE = 3

Regards
JK

Posted: Thu Nov 17, 2005 12:31 am
by rleishman
You have an error in a Server Routine called GetNextElemSequence().

Go to Routines in the Navigator pane of Developer, and look for this routine. Look in the vicinity of Line 22 - this is where the error is occurring.

I think I've had this error before trying to do a hash file lookup with a NULL key. Your error may not be the same, but consider whether a NULL or other inappropriate value could be passed in to that line of the routine.

Posted: Thu Nov 17, 2005 9:32 am
by ray.wurlod
This error can also result from improper use of a non-opaque variable where an opaque variable (such as a file handle or a subroutine reference) is needed.

Posted: Thu Nov 17, 2005 4:09 pm
by Jayesh_09
Thank You very much.


Regards
JK

Posted: Thu Nov 17, 2005 4:27 pm
by Jayesh_09
Ray

Thanks for the reply.

Could you please give me some information on the following.

(improper use of a non-opaque variable where an opaque variable (such as a file handle or a subroutine reference)


Regards
JK

Posted: Thu Nov 17, 2005 4:33 pm
by Jayesh_09
Ray

I'm using this following routine to create a hash file in my hash_dir, but when in delete the hash from hash_dir and try creating hash_file with the same name i get the folloing error.


DataStage Job 1277 Phantom 13649
Program "DSU.GetNextElemSequence": Line 22, Improper data type.
Attempting to Cleanup after ABORT raised in stage COM_SERV_TEST..Transformer_22
DataStage Phantom Aborting with @ABORT.CODE = 3


Routine as follows.


$INCLUDE UNIVERSE.INCLUDE FILENAMES.H
Common /ElemSequencesGem/ Initialized, NextVal, SeqFile
If NOT(Initialized) Then
* Not initialised. Attempt to open the file.
Initialized = 1
OpenPath pHASH_DIR:'/':pFILE_NAME:'_':pBILL_CYCLE TO SeqFile Else
DataPathname = pHASH_DIR : UV.FSEP : pFILE_NAME:'_':pBILL_CYCLE
DictPathname = pHASH_DIR : UV.FSEP : "D_" : pFILE_NAME:'_':pBILL_CYCLE
Command = "CREATE TABLE " : pFILE_NAME:'_':pBILL_CYCLE
Command := " DATA " : DataPathname
Command := " DICT " : DictPathname
Command := " (field1 VARCHAR NOT NULL,"
Command := " PRIMARY KEY (field1));"
Call DSExecute("UV", Command, Output, ExitStatus)
OpenPath pHASH_DIR:'/':pFILE_NAME:'_':pBILL_CYCLE TO SeqFile Else Ans = -1
End
End

* Read the named record from the file.
* This obtains the lock (waiting if necessary).
Readu NextVal From SeqFile, aSequenceName Else
NextVal = 1
End

Ans = NextVal
NextVal = NextVal + 1

* Increment the sequence value, and write back to file.
* This releases the lock.
Write NextVal On SeqFile, aSequenceName Else Ans = -1


Regards
JK

Posted: Thu Nov 17, 2005 4:43 pm
by Bala R
Hope the hashfile was externally pathed and in case if it was not you used DELETE.FILE command when you deleted it.

Posted: Thu Nov 17, 2005 4:56 pm
by Jayesh_09
BALA

I used rm -rf hash_dir/hash_file_name | rm -f hash_dir/D_hash_file_name to delete the hashfile from the hash_dir and used DELETE.FILE to remove the VOC entry, but i still get the same error.


Regards
JK

Posted: Thu Nov 17, 2005 5:34 pm
by Bala R
DELETE.FILE won't help after you have deleted the dictionary and hash file manually. You have to edit the VOC file manually. Hope someone helps you out on that. Sorry.

Posted: Thu Nov 17, 2005 5:57 pm
by chulett
You've got the do the deleting in a complimentary manner to how the creation was done. When you create it with CREATE.FILE you can delete it with DELETE.FILE - however, when it's a 'CREATE TABLE' statement, you need to use a 'DROP TABLE' to delete it.

All without deleting anything at the O/S level first manually, of course.

Posted: Thu Nov 17, 2005 8:30 pm
by Jayesh_09
Craig


Can we use (DROP TABLE TABLE_NAME;)
in server routine or in Befor-job and After-job subroutine. Please advise.


Many Thanks
JK

Posted: Thu Nov 17, 2005 9:04 pm
by chulett
Sure... via the TCL option available in either method.

Posted: Thu Nov 17, 2005 9:20 pm
by Jayesh_09
Craig


I tried using TCL in Before-job subroutine, but the job aborts.

TCL = DROP TABLE TEST_01


Many Thanks

JK

Posted: Thu Nov 17, 2005 9:23 pm
by Jayesh_09
Craig

When i drop the table from UVSH i get the following message on the screen.

>DROP TABLE CUS_REF_99;
Dropping Table CUS_REF_99
rm: directory /usr/users/khartij/datastage/hash/CUS_REF_99 not removed. Permission denied
Could not delete file CUS_REF_99. continuing ...
rm: /usr/users/khartij/datastage/hash/D_CUS_REF_99 not removed. Permission denied
Could not delete file /usr/users/khartij/datastage/hash/D_CUS_REF_99. continuing ...


Many Thanks

JK

Posted: Thu Nov 17, 2005 9:34 pm
by ray.wurlod
The original problem seems to relate to the SeqFile variable in the ReadU statement. (Unrelated question: why use this name for a hashed file? It only confuses future developers.) For some reason there is a path through your code where SeqFile does not get a value (or Initialized has a non-zero value but the file is not open).

The subsequent questions about CREATE TABLE and DROP TABLE don't really belong in this thread. But "permission denied" is a fairly specific diagnostic message. Either operating system permissions or SQL privileges are preventing you from dropping the table.