/* ************************************************************************** */
/* DBG106CL:    Create database generation scripts                            */
/* 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 (&SCRIPT &LIBRARY &SCRIPTTYPE &PRIMARY1 &PRIMARY2 &PRIMARY3)
  DCL        VAR(&SCRIPT) TYPE(*CHAR) LEN(10)
  DCL        VAR(&SCRIPTTYPE) TYPE(*CHAR) LEN(5)
  DCL        VAR(&LIBRARY) TYPE(*CHAR) LEN(10)
  DCL        VAR(&PRIMARY1) TYPE(*CHAR) LEN(10)
  DCL        VAR(&PRIMARY2) TYPE(*CHAR) LEN(10)
  DCL        VAR(&PRIMARY3) TYPE(*CHAR) LEN(10)
  DCL        VAR(&RETURN) TYPE(*CHAR) LEN(7)
/* ************************************************************************** */
/*  START OF MAINLINE CODE                                                    */
/* ************************************************************************** */
  DSPFD      FILE(&LIBRARY/*ALL) TYPE(*MBR) +
               OUTPUT(*OUTFILE) FILEATR(*PF) +
               OUTFILE(QTEMP/DBGLIST)
  OVRDBF     FILE(DBGLIST) TOFILE(QTEMP/DBGLIST)
  CALL       PGM(DBG104R4) PARM(&SCRIPT &SCRIPTTYPE +
               &RETURN &PRIMARY1 &PRIMARY2 &PRIMARY3)
  DLTOVR     FILE(DBGLIST)
  DLTF       FILE(QTEMP/DBGLIST)
  IF         COND(&RETURN *EQ '*EXISTS') THEN(DO)
    SNDPGMMSG  MSGID(MIT0075) MSGF(DBGMSGF) MSGDTA(&SCRIPT) +
                 MSGTYPE(*ESCAPE)
  ENDDO
  ELSE       CMD(DO)
    SNDPGMMSG  MSGID(MIT0076) MSGF(DBGMSGF) MSGDTA(&SCRIPT) +
                 MSGTYPE(*COMP)
  ENDDO
ENDPGM:
  RETURN
ENDPGM

-- MartinRowe - 24 Jun 2005
Topic revision: r1 - 24 Jun 2005 - 05:08:02 - MartinRowe
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding DBG/400? Send feedback