Stage Routine in job sequencer

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
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Stage Routine in job sequencer

Post by CLOPES »

Hi all,

I have wroten a basic routine that read a flat file and return values in an array. If i test it in a "routine way" (with the test button) or if i use it in a job control of a job Server, it's ok.
The problem occurs if i want to call in a routine stage through a job sequencer. :?:
There's a warning:
SEQ_ODS_EXTR_SARCHEM..JobControl (@Routine_ReadParameters): Routine DSU.ReadParameters did not finish OK, return code = 'ENV
OSIRIS'
The Flat file begins with this parameter but there's a lot more.
It seems that the stage doesn't like arrays and it returns only the first line

Is it normal ? am i wrong ? or is it just a little bug DS ?

Here is the code :

************************************************************* Ans = ""
TabAns = ""
i = 1
NomRoutine = "ReadParameters"
OPENSEQ File TO ficIni THEN
LOOP
READSEQ ligneFicIni FROM ficIni
ON ERROR
msgRetour = "Erreur de lecture sur le fichier ":File
print "Erreur de lecture sur le fichier ":File
GOTO Erreur
END
THEN
IF COUNT(ligneFicIni,'=')=1 THEN
TabAns<i,1>= Trim(FIELD(ligneFicIni,'=',1))
TabAns<i,2>= Trim(FIELD(FIELD(ligneFicIni,'=',2),';',1))
i=i+1
END
END
ELSE
EXIT
END
REPEAT
END
ELSE
msgRetour = "Ouverture du fichier " : File : " impossible."
GOTO Erreur
END
GOTO Fin
Erreur:
CALL DSLogWarn( "test erreur =": msgRetour, NomRoutine )
Fin:
Ans = TabAns
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

None of the above. A job sequence will always treat a non-zero return value from a routine as a "failure". To avoid this, you need to explicitly put in place a Failure trigger from the Routine activity. This can go to the same Sequencer as the OK trigger if you like. Bonne chance!

Please format your code and enclose it in Code tags.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Searching for a common (non-unique) part of your error - "did not finish OK, return code =" for example - would have revealed many conversations on this topic. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
CLOPES
Participant
Posts: 52
Joined: Tue Jul 22, 2003 8:05 am
Location: France
Contact:

Post by CLOPES »

Yes i have searched for this error but my first question was :

Did the stage Routine accept arrays in a value return ?


Ray's reponse help me about the way to make sequencer jobs and i will make them as he told. :lol:
Post Reply