// Table Fields

// Work Fields
integer sl
integer li_OutFile
integer li_Page
string  ls_MyLine
integer li_lines
string  ls_spool
string  mon
string  yr
string  monyr
string  stfyn

// Get Month Year
Open(w_monyr) 
monyr = Message.StringParm
mon = mid(monyr,1,2)
yr  = mid(monyr,3,4)

// Get Staff Yes No
Open(w_stfyn) 
stfyn = Message.StringParm

// Execute SP
DECLARE **** PROCEDURE FOR 
    *****  @mm =:mon, @yy=:yr;
     
EXECUTE lvstf;

// Declare Cursor
    DECLARE emp_curs CURSOR FOR
       SELECT tktno
              **********;

    OPEN emp_curs;

    li_Page  = 0
    li_lines = 72
    ls_spool = "c:\Reports\************_" + string(today(),"dd-MMM-yy") + ".txt"
    
    li_OutFile =  FileOpen( ls_spool, LineMode!,Write!,LockWrite!,Replace!)
    
    pointer oldpointer // Declares a pointer variable
    oldpointer = SetPointer(HourGlass!)
    
    DO WHILE 1=1
    
        FETCH emp_curs
         INTO :tktno
            , ******************;

        If SQLCA.SQLCODE = 100 THEN
           EXIT
        End If

li_lines+=DTL

if li_lines > 68 then
   li_lines = HDR+DTL // 6(HDR) + 3(DTL)
   li_Page++
   
// Line 01  PAGE_HEADER
ls_MyLine = " "
ls_MyLine = f_InsStrInPos(ls_MyLine,char(12),1,1,"L") // Form Feed
ls_MyLine = f_InsStrInPos(ls_MyLine,string(today(),"dd-MMM-yy"),2,10,"L") // 1  D


***********
End If // Page Heading

// Line 01 DATA


    LOOP
    
       Close emp_curs;

_[0-9]+_[0-9]+ by NOTHING
(sum_ by (

       SELECT sum(lthrs)
              *******************
         INTO ************        
        FROM ************;

// Line 01 FOOTER


FileClose(li_OutFile)

SetPointer(oldpointer)

Commit;

f_printorsee(ls_spool)
     