problem in using server 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
loric
Participant
Posts: 5
Joined: Tue Jul 19, 2005 5:10 am

problem in using server routine

Post by loric »

Hello,

i'm working on this routine (end,nomeFile_1,nomeFile_2) and i'm experimenting some problems.
My routine has 3 input parameters and it returns only one value (Ans)
I want two of these input parameters (nomeFile_1,nomeFile_2) to be my output parameters too,
and pass them to a job sequence.
The routine is below:

Input argument:
end
Input/output
nomeFile_1
nomeFile_2


MyRoutine = "My Routine"

PathName = 'pathList/file_name'

OpenSeq PathName To FileVar Else
Call DSLogWarn("Cannot open ":PathName, MyRoutine)
End
Loop
ReadSeq FileLine From FileVar
On Error
Call DSLogWarn("Error from ":PathName:" status=":Status(),
MyRoutine)
Exit
End
Then
Begin Case
Case FileLine matches 'pp':'...':end ; nomeFile_1 = FileLine[".",1,1]
Case FileLine matches 'ss':'...':end ; nomeFile_2 = FileLine[".",1,1]
Case @TRUE ; Ans = 'File not fou'
End Case
End Else
Exit ; * at end-of-file
End
Repeat
CloseSeq FileVar

Ans = nomeFile_1:";":nomeFile_2


How can i get the value of the modified input parameters in the job sequence?
Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Assuming you have version 7.5 or later:

Code: Select all

Field(RoutineActivity.$ReturnValue, ";", 1, 1)
and

Code: Select all

Field(RoutineActivity.$ReturnValue, ";", 2, 1)
However, your code isn't doing what you want it to do. The final assignment statement always prevents Ans from being "File not foun". Perhaps that assignment statement should read

Code: Select all

Ans = nomeFile_1 : ";" : nomeFile_2 : ";" : Ans
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
loric
Participant
Posts: 5
Joined: Tue Jul 19, 2005 5:10 am

thanks Ray!

Post by loric »

it works! :wink:
Post Reply