/* ************************************************************************** */
/* DBG005CL: Work with On-Line Documents */
/* Copyright (C) 2000 Martin Rowe <martin@dbg400.net> */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* ************************************************************************** */
PGM (&DOCLIBFILE &DOCUMENT &PGMMODE)
DCL VAR(&DOCLIBFILE) TYPE(*CHAR) LEN(20)
DCL VAR(&DOCLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&DOCFILE) TYPE(*CHAR) LEN(10)
DCL VAR(&DOCFILEDTL) TYPE(*CHAR) LEN(20)
DCL VAR(&IDXFILE) TYPE(*CHAR) LEN(10)
DCL VAR(&KEYFILE) TYPE(*CHAR) LEN(10)
DCL VAR(&RTNLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&KEYFILE2) TYPE(*CHAR) LEN(10)
DCL VAR(&DOCUMENT) TYPE(*CHAR) LEN(10)
DCL VAR(&PGMMODE) TYPE(*CHAR) LEN(4)
/* ************************************************************************** */
/* START OF MAINLINE CODE */
/* ************************************************************************** */
CHGVAR VAR(&DOCLIB) VALUE(%SST(&DOCLIBFILE 11 10))
CHGVAR VAR(&DOCFILE) VALUE(%SST(&DOCLIBFILE 1 10))
RTVDTAARA DTAARA(&DOCLIB/&DOCFILE) RTNVAR(&DOCFILEDTL)
CHGVAR VAR(&IDXFILE) VALUE(%SST(&DOCFILEDTL 1 10))
CHGVAR VAR(&KEYFILE) VALUE(%SST(&DOCFILEDTL 11 10))
CHGVAR VAR(&KEYFILE2) VALUE(%SST(&DOCFILEDTL 11 10))
IF COND(%SST(&KEYFILE2 8 1) = '1') THEN(CHGVAR +
VAR(%SST(&KEYFILE2 8 1)) VALUE('2'))
CHKOBJ OBJ(QTEMP/DBGOLD0W) OBJTYPE(*FILE)
MONMSG MSGID(CPF9801) EXEC(DO)
RTVOBJD OBJ(DBGOLD0W) OBJTYPE(*FILE) RTNLIB(&RTNLIB)
CRTDUPOBJ OBJ(DBGOLD0W) FROMLIB(&RTNLIB) +
OBJTYPE(*FILE) TOLIB(QTEMP)
ENDDO
OVRDBF FILE(DBGDFTD1) TOFILE(&DOCLIB/&DOCFILE)
OVRDBF FILE(DBGDFTH1) TOFILE(&DOCLIB/&IDXFILE)
OVRDBF FILE(DBGDFTK1) TOFILE(&DOCLIB/&KEYFILE)
OVRDBF FILE(DBGDFTK2) TOFILE(&DOCLIB/&KEYFILE2)
OVRDBF FILE(DBGOLD0W) TOFILE(QTEMP/DBGOLD0W)
IF COND(&DOCUMENT = '*ALL ') THEN(DO)
CALL PGM(DBG005R4) PARM(&DOCLIB &DOCFILE &PGMMODE)
ENDDO
ELSE CMD(DO)
CALL PGM(DBG020R3) PARM(&DOCUMENT &PGMMODE)
ENDDO
DLTOVR FILE(DBGDFTD1 DBGDFTH1 DBGDFTK1 DBGDFTK2 DBGOLD0W)
ENDPGM:
ENDPGM
--
MartinRowe - 23 Jun 2005