Unhandled failure (1) encountered calling routine

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

Post Reply
satyakunta
Participant
Posts: 5
Joined: Fri Jun 03, 2005 9:08 am

Unhandled failure (1) encountered calling routine

Post by satyakunta »

I have encountered an unsual problem with a sequnce job. I designed a sequence as follows:

S1
|
|
S2
|
|
Routine------------------------> S3---->S6
\
->S4----------> S5

My goal is to run the sequence with the routine activity to run the job S1->S2--> Routine -->S4 (S4 and S5 section shown above) for the initial load, and for the next run it should not run the S4 instead it has to skip it and run the S3 directly.

The routine i am using is to read a Seq file i am writing using the job s2 with a "0":
I have given the following conditions,
> if the return value is "0" it runs the S4 job and the during the same run (first run) it resets the Seqenctial file using job s5 to "1" .
>Thus my routine reads and returns the value "1" in the next run and apperently should run the job S3.

The first run is succesfull and for the next run it throws the following controller problem error:
Unhandled failure (1) encountered calling routine DSU.Routine.

Is the error message is something to do with the routine:

I am using the following routine:

Code: Select all

ROUTINE.NAME = 'CheckFileFlag'
FFILE = TRIM(FileName)

OPENSEQ FFILE TO F.SEQ THEN
	READSEQ SEQ.LINE FROM F.SEQ THEN
		Ans = TRIM(SEQ.LINE)
	END
END

9999 * END OF ROUTINE
Can anybody help me on this?


Thanks

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

Post by ray.wurlod »

Two problems.
1. Ans is not assigned a value unless a line is read from a successfully opened file.
2. If the file is opened, it must be closed.

Code: Select all

ROUTINE.NAME = 'CheckFileFlag' 
FFILE = TRIM(FileName) 

Ans = ""  ; * This way Ans always has a value

OPENSEQ FFILE TO F.SEQ THEN 
   READSEQ SEQ.LINE FROM F.SEQ THEN 
      Ans = TRIM(SEQ.LINE) 
   END 
END 

* Close file if it is open
IF FILEINFO(F.SEQ, 0) THEN CLOSESEQ F.SEQ

9999 * END OF ROUTINE
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