I have written the following code to set the parameter to the value I need, but, although I'm getting a good return value, the value of the parameter isn't set. I can see it isn't getting set from the messages returned, but there are no errors returned and I can't tell WHY it isn't being set.
Can anyone give me some pointers on debugging this routine or tell me what I did wrong? I have searched posts and read documentation, but can't seem to find anything on this topic that helps. I've tried setting the parameter to a variable, a string, and a number and that doesn't seem to make a difference. (The message statements are simply there for debugging).
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
CallingProgName = "GetPayrollCRId"
If NOT(Initialized) Then
* Not initialised. Attempt to open the file.
Initialized = 0
Open "SDKPayPItoProcess" TO PayrollInstanceIDFile Else
* Open failed. Create the sequence file.
EXECUTE "CREATE.FILE SDKNumPaytoProcess 2 1 1"
Open "SDKPayPItoProcess" TO PayrollInstanceIDFile Else Before_SQL = -1
End
* Attempt to read the named record from the file.
Readv CalRunID From PayrollInstanceIDFile, JobName, 2 Else
CallingProgName = JobName
Message = "Failed to Retrieve CalRunID ": CalRunID : " Jobname is " : JobName
Call DSLogWarn(Message,CallingProgName)
End
End
Close PayrollInstanceIDFile
CalRunID = TrimB(CalRunID)
Open "HashCalRunIDs" TO CalRunIDFile Then
* Attempt to read the named record from the file.
Read PROCESS_INSTANCE from CalRunIDFile, CalRunID Then
If TrimB(Delete_Rows) = "Y" Then
Before_SQL = "DELETE FROM ": OWS_SCHEMA : "PS_GP_EPM_GUI_TMP WHERE CAL_RUN_ID = '": CalRunID : "'"
JobHandle = DSAttachJob("J_Stage_PS_GP_EPM_GUI_TMP", DSJ.ERRNONE)
Message = "1 " : JobHandle
Call DSLogInfo(Message,CallingProgName)
ErrCode = DSSetParam(JobHandle, 'DELETE_SQL',Before_SQL)
Message = "2 " : ErrCode
Call DSLogInfo(Message,CallingProgName)
ParmValue = DSGetParamInfo(JobHandle, "DELETE_SQL",DSJ.PARAMVALUE)
Message = ParmValue
Call DSLogInfo(Message,CallingProgName)
ErrCode2 = DSDetachJob(JobHandle)
Message = "3 " : ErrCode2
Call DSLogInfo(Message,CallingProgName)
End
End
Else
Message = "Read Failed " : PROCESS_INSTANCE
Call DSLogInfo(Message,CallingProgName)
Before_SQL = "Read Failed"
End
End
Else
Before_SQL = -1
End
Ans = 0
Message = Ans : " " : CalRunID
Call DSLogInfo(Message,CallingProgName)
Close CalRunIDFile
Code: Select all
TEST #1
*******
Arg1 = Y
Arg2 = psepm.
Arg3 = J_Cntrl_PS_Z_GP_CAL_INTRFC_2
Arg4 = New Value
Test completed.
Program "DSU.GetPayrollCRId": Line 6, Variable "Initialized" previously undefined. Zero used.
DSLogInfo called from : GetPayrollCRId
Message to be logged is...
> 1 2
DSLogInfo called from : GetPayrollCRId
Message to be logged is...
> 2 0
DSLogInfo called from : GetPayrollCRId
Message to be logged is...
> select count(*) from ps.psdbowner
DSLogInfo called from : GetPayrollCRId
Message to be logged is...
> 3 0
DSLogInfo called from : GetPayrollCRId
Message to be logged is...
> 0 BH 2005S07
Result = 0
Jeanne