*:*****************************************************************************
hranice1 = "140101"
hranice1 = inputbox("od kdy vratit?", "vraceni archivace trzeb", m.hranice1, 99999, "", "")

do zurnal_log with "OPERA", "ANTI-ARCHIVACE TRZEB", "k " + m.hranice1 + " START"
had = CREATEOBJECT("had", "vraceni trzeb z archivace k " + m.hranice1 + "  txt-plt-pol-fin" )
had.show()
had.set_max( 7 )

DO jedensoubor WITH "sk_txt" 
had.set_txt1 ( "vraceni trzeb z archivace k " + m.hranice1 + "  plt-pol-fin" )
DO jedensoubor WITH "sk_plt"
had.set_txt1 ( "vraceni trzeb z archivace k " + m.hranice1 + "  pol-fin" )
DO jedensoubor WITH "sk_pol"
had.set_txt1 ( "vraceni trzeb z archivace k " + m.hranice1 + "  fin" )
DO jedensoubor WITH "sk_fin"
DO jedensoubor WITH "sk_sez"
do zurnal_log with "OPERA", "ANTI-ARCHIVACE TRZEB", "k " + m.hranice1 + " END"
RELEASE had

*:*****************************************************************************
PROC jedensoubor
PARAM soubor

had.increment
DO clos_data
USE (m.gccen_path + m.soubor)        EXCL IN 0 ALIAS sk
USE (m.gccen_path + m.soubor + "_a") EXCL IN 0 ALIAS sk_a

had.set_txt2 ( "copying from " + UPPE(m.soubor) + "_A" )
SELECT sk_a
COPY FOR BETWEEN(uzaverka, m.hranice1, "990000") TO (m.gcpri_path + m.soubor + "_aa")

had.set_txt2 ( "appending to " + UPPE(m.soubor) )
SELECT sk
APPE FROM (m.gcpri_path + m.soubor + "_aa")

had.set_txt2 ( "deleting in " + UPPE(m.soubor) + "_A" )
SELECT sk_a
DELETE FOR BETWEEN(uzaverka, m.hranice1, "990000")
had.set_txt2 ( "packing " + UPPE(m.soubor) + "_A" )
PACK
DO clos_data