Here is a quick DECLARE Cursor
Hope this gives you a start
***************Start Here**************
SET VAR vagenttxt TEXT
SET VAR vdateworked DATE
SET VAR vminstart TIME
SET VAR vmaxend TIME
SET ERROR MESSAGE 705 OFF
DROP CURSOR c1
SET ERROR MESSAGE 705 ON
DECLARE c1 CURSOR FOR SELECT agentcolumn,dateworkedcolumn +
FROM actualworkedtbl
OPEN c1
FETCH c1 INTO +
vagenttxt INDICATOR ivvar1, +
vdateworked INDICATOR ivvar2
WHILE SQLCODE <> 100 THEN
SELECT MIN(startcall),MAX(endcall) INTO vminstart INDICATOR iv1, vmaxend
INDICATOR iv2 +
FROM productiontbl WHERE DEXTRACT(datetimecolumn) = .vdateworked
--Assuming your new columns StartOfFirstCall and EndOfLastCall are time and
in the ActualWorkedTbl
UPDATE actualworkedtbl SET startoffirstcall = .vminstart, endoflastcall =
.vmaxend WHERE CURRENT OF c1
FETCH c1 INTO +
vagenttxt INDICATOR ivvar1, +
vdateworked INDICATOR ivvar2
ENDWHILE
DROP CURSOR c1
LABEL done
CLEAR ALL VARIABLES
RETURN
**************End Here****************
From: [email protected] [mailto:[email protected]] On Behalf Of
lwilson
Sent: Monday, July 24, 2017 12:27 PM
To: RBASE-L <[email protected]>
Subject: [RBASE-L] - Do-Loop Processing Help
Do-Loop Help in Updating a Table
I know this can be done with a ‘Do-Loop.” However, as a returning RBase users,
candidly I have forgotten how.
I think it is combination of Cursor, While & Endwhile. Just not sure how to set
the script.
Can anyone provide a sample script for how to set this up.
Scenario:
Small Call Center with 15 Agents
Volume approx. 84,000 calls/year
Problem:
Validate that the Agents have worked their Scheduled shift/hours
Database Tables
Production table with all call activity 'AHL' (Multiple Calls per
day)
Date/Time of Call (DATETIME)
Start of Call Time (TIME)
End of Call Time (TIME)
Agent (TEXT)
'Actual_Work' (One record for each actual day worked for each Agent)
Agent (TEXT)
Date Worked (DATE)
Shift Ex. 7:30AM-3:30PM (TEXT)
Scheduled Start Time (TIME)
Scheduled End Time (TIME)
NEW COLUMNS TO BE UPDATED
Start_of_First_Call (first call of the day)
(TIME)
End_of_Last_Call (Last call for the day)
(TIME)
Once I get the table updated, I want to compare the ‘Scheduled’ Shift hours to
the Actual ‘Hours Worked.
The benchmark measures whether agents are on time for their shifts, whether
they go to lunch and take breaks according to the schedule. This is
particularly important in smaller call centers because there is not as much
room for error. Some small centers may only have 2 agents on call at any time.
The global metric is 95%.
--
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected]
<mailto:[email protected]> .
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.