Error

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Error

Post 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
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post 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.
Ross Leishman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post by Jayesh_09 »

Thank You very much.


Regards
JK
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post 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
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post 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
Bala R
Participant
Posts: 66
Joined: Mon May 30, 2005 9:52 pm

Post 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.
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post 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
Bala R
Participant
Posts: 66
Joined: Mon May 30, 2005 9:52 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure... via the TCL option available in either method.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post by Jayesh_09 »

Craig


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

TCL = DROP TABLE TEST_01


Many Thanks

JK
Jayesh_09
Participant
Posts: 21
Joined: Wed Apr 07, 2004 10:09 am
Contact:

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply