I have written a routine with one argument which returns a single value answer. I need help in how to use this as a before-job subroutine and how to retreive the answer for use within the job. The code for the routine (which is currently saved as a transform) follows --
OPEN 'company' to COMPANY_FILE THEN
CALL DSLogInfo('opening company','Routine is GetCompanyId')
END ELSE
CALL DSLogFatal('Unable to open company','Routine is GetCompanyId')
END
READV COMPANY_ID FROM COMPANY_FILE,Arg1, 1 THEN
END ELSE
CALL DSLogFatal('Record Not Found ': Arg1 :' company','Routine is GetCompanyId')
END
Ans=COMPANY_ID
Before Job Sub Routine
Moderators: chulett, rschirm, roy
Open the Routine, change the Type of the Routine from the Transform Function to Before/After Subroutine. It is one of the combo box available right next to the Routine Name.I need help in how to use this as a before-job subroutine and how to retreive the answer for use within the job
But To get the result it is advisable to use only as Transform Function otherwise you would need to write the return value to some temporary place may be sequential file from where you can use it within the job.
Last edited by loveojha2 on Tue Aug 08, 2006 5:33 am, edited 1 time in total.
Success consists of getting up just one more time than you fall.
Stay with using a function, use it as the initialization step of a Stage variable in a transformer. The derivation of the stage variable is just the stage variable itself. At startup, the function will be called, returning your value. The stage variable will always be that value. Now you can use it in derivations, key expressions, and constraints.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle