I missed a closing paren after MIN(start_time)

 

    SELECT MIN(start_time), MAX(Customer_end_Time) INTO vminstart INDICATOR 
iv1, vmaxend INDICATOR iv2 +

      FROM AHL2 WHERE DEXTRACT(Customer_Start) = .vdateworked

 

From: [email protected] [mailto:[email protected]] On Behalf Of 
lwilson
Sent: Monday, July 24, 2017 7:56 PM
To: RBASE-L <[email protected]>
Subject: [RBASE-L] - Re: Do-Loop Processing Help

 

Buddy,

 

Thanks for the offer to help. 

 

I ran the script below and keep getting 

 

-ERROR- ENDWHILE, ENDSW or ENDIF missing in an input file ( 462)

 Switching input back to keyboard

 

What am I doing wrong?

 

Below is the Script I ran (slight adjustments for Column & table names:

*******************************************************************************

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 agent,Start_date +

    FROM ActualWorked

  OPEN c1

  FETCH c1 INTO +

    vagenttxt INDICATOR ivvar1, +

    vdateworked INDICATOR ivvar2

 

  WHILE SQLCODE <> 100 THEN

 

    SELECT MIN(start_time, MAX(Customer_end_Time) INTO vminstart INDICATOR iv1, 
vmaxend INDICATOR iv2 +

      FROM AHL2 WHERE DEXTRACT(Customer_Start) = .vdateworked

 

 

    UPDATE actualworked 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

 

***********************************************************

On Monday, July 24, 2017 at 12:27:23 PM UTC-4, lwilson wrote:

 

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.

Reply via email to