@ECHO OFF

rem *******************************************************************************
rem  Platform:      NT                                                            *
rem  Printstream:   PDF                                                           *
rem  Application:   SPL Bill Print                                                *
rem ==============================================================================*
rem  Master Command File called to execute DOC1 for SPL Bill Print                *
rem ==============================================================================*

rem do not change the following line
SET   SPLBILL_CALLED_SWITCH=Y

rem *******************************************************************************
rem    Modify the following file paths for each installation                      *
rem ==============================================================================*
rem      D1HOST                                                                   *
rem              - Names root directory where the DOC1 Generate was installed     *
rem              - Typical value:                                                 *
rem                D1HOST=C:\Program Files\DOC1 Suite\Production Engines          *
rem      D1APPATH                                                                 *
rem              - Names directory containing HIP, INI, CTL, ETS, OPS             *
rem              - Sample coding:                                                 *
rem                D1APPATH=C:\Program Files\DOC1 Suite\Designer\resource\fop     *
rem      PRODPATH                                                                 *
rem              - Names directory for output files from Sort and DOC1            *
rem              - Sample coding: PRODPATH=C:\Doc1 Production Files               *
rem      XTRCTPTH                                                                 *
rem              - Names directory containing SPL Bill Print Extract              *
rem              - Sample coding: XTRCTPTH=C:\SPL\EXTRACT                         *
rem *******************************************************************************

SET   "D1HOST=D:\spl\doc1\5.5.1\generate"
SET   "D1APPATH=D:\spl\doc1\5.5.1\AppFiles"
SET   "PRODPATH=D:\spl\cis\C205DEMO\splapp\billView"
SET   "WEBPATH=D:\spl\cis\C205DEMO\splapp\billView\"
SET   "XTRCTPTH=D:\spl\sploutput\C205DEMO"
SET   "SORTPATH=c:\windows\system32"
SET   "PADDR-PRTOUT-01=63.162.50.9"
SET   "PADDR-PRTOUT-02=63.162.50.9"
SET   "PADDR-PRTOUT-03=63.162.50.9"
SET   "PADDR-PRTOUT-04=63.162.50.9"
SET   "PADDR-PRTOUT-05=63.162.50.9"
SET   "PADDR-PRTOUT-06=63.162.50.9"
SET   "PADDR-PRTOUT-07=63.162.50.9"
SET   "PADDR-PRTOUT-08=63.162.50.9"
SET   "PADDR-PRTOUT-09=63.162.50.9"
SET   "PADDR-PRTOUT-10=63.162.50.9"

rem *******************************************************************************
rem    The following switches which enable certain steps to be bypassed           *
rem ==============================================================================*
rem      CODE1                                                                    *
rem              - May be:  Y or N                                                *
rem              - "N" allows Code-1 Plus to be bypassed                          *
rem      MSTREAM                                                                  *
rem              - May be:  Y or N                                                *
rem              - "N" allows MailStream Plus to be bypassed                      *
rem      ARCHIVE                                                                  *
rem              - May be:  Y or N                                                *
rem              - "N" allows 2nd execution of EMFE for Archive to be bypassed    *
rem      PRINTFILES                                                               *
rem              - May be:  Y or N                                                *
rem              - "N" prevents files from being sent to PADDR printer            *
rem      DELETEFILES                                                              *
rem              - May be:  Y or N                                                *
rem              - "N" prevents intermediate work files from being deleted        *
rem      SAVEFILES                                                                *
rem              - May be:  Y or N                                                *
rem              - "Y" Causes Final Print and Audit files to be saved in a new    *
rem                directory (new directory name is based on current date/time)   *
rem *******************************************************************************

SET   CODE1=N
SET   MSTREAM=N
SET   ARCHIVE=Y
SET   PRINTFILES=N
SET   DELETEFILES=Y

rem *******************************************************************************
rem    The following symbols are used for controls                                *
rem ==============================================================================*
rem      PSTREAM                                                                  *
rem              - Identifies the type of print description language for output   *
rem              - Possible values are AFP, PDF, or PostScript                    *
rem      RUN_TYPE                                                                 *
rem              - Distinguishes between online production vs batch production    *
rem              - Possible values are ONLINE and BATCH                           *
rem *******************************************************************************

SET   PSTREAM=PDF
SET   RUN_TYPE=ONLINE

rem *******************************************************************************
rem    The symbols identify application resource files for DOC1.  These values of *
rem    the file names should not be changed unless the files are either renamed   *
rem    or replaced.                                                               *
rem ==============================================================================*
rem   L O G F I L E                                                               *
rem   =============                                                               *
rem      LOGFILE                                                                  *
rem              - Name of a log file to be created by this process               *
rem              - Previous version of file will be replaced                      *
rem              - File will be written to %PRODPATH% directory                   *
rem              - Sample coding:  LOGFILE=spl-bill.log                           *
rem                                                                               *
rem    D O C 1   R E S O U R C E   F I L E S                                      *
rem    =====================================                                      *
rem      GEN_OPS                                                                  *
rem              - Names DOC1GEN Initialization file for Format step              *
rem              - Sample value: GEN_OPS=splbill_s5_v3_doc1gen.ops                *
rem              - File must be present in the %D1APPATH% directory               *
rem      GEN_HIP                                                                  *
rem              - Names DOC1GEN Application Rules (.HIP)                         *
rem              - Sample value: GEN_HIP=splbill_s5_v3_doc1gen_postscript.hip     *
rem              - File must be present in the %D1APPATH% directory               *
rem      GEN_ETS                                                                  *
rem              - Names Lookup file                                              *
rem              - Names Look-Up file converting Country Codes to Country Names   *
rem              - Sample value: GEN_ETS=splbill_s5_v3_doc1gen.ets                *
rem      GEN_CNTL                                                                 *
rem              - Names Look-Up file containing formatting control codes         *
rem              - Sample value:                                                  *
rem                GEN_CNTL=splbill_s5_v3_doc1gen_control_pdf.ets                 *
rem              - File must be present in the %D1APPATH% directory               *
rem      FRGN_PCE_INI                                                             *
rem              - Names DOC1PCE Initialization file for Foreign step             *
rem              - Sample value: FRGN_PCE_INI=splbill_s5_v3_frgnsplt_pce.ini      *
rem              - File must be present in the %D1APPATH% directory               *
rem      FRGN_PCE_CTL                                                             *
rem              - Names DOC1PCE Rules file for Foreign step                      *
rem              - Sample value: FRGN_PCE_CTL=splbill_s5_v3_frgnsplt_pce.ctl      *
rem              - File must be present in the %D1APPATH% directory               *
rem      SPCL_PCE_INI                                                             *
rem              - Names DOC1PCE Initialization file for Special Handling step    *
rem              - Sample value: SPCL_PCE_INI=splbill_s5_v3_spcsplt_pce.ini       *
rem              - File must be present in the %D1APPATH% directory               *
rem      SPCL_PCE_CTL                                                             *
rem              - Names DOC1PCE Rules file for Special Handling step             *
rem              - Sample value: SPCL_PCE_CTL=splbill_s5_v3_spcsplt_pce.ctl       *
rem              - File must be present in the %D1APPATH% directory               *
rem      CPRT_PCE_INI                                                             *
rem              - Names DOC1PCE Initialization file for Post Process step        *
rem              - Sample value: CPRT_PCE_INI=splbill_s5_v3_createprt_pce.ini     *
rem              - File must be present in the %D1APPATH% directory               *
rem      CPRT_PCE_CTL                                                             *
rem              - Names DOC1PCE Rules file for Post Process step                 *
rem              - Sample value: CPRT_PCE_CTL=splbill_s5_v3_createprt_pce.ctl     *
rem              - File must be present in the %D1APPATH% directory               *
rem      LOGOXML                                                                  *
rem              - Names XML file that identifies the bitmap used for a company   *
rem                logo and contains sizing attributes of the bitmap              *
rem              - Sample value: LOGOXML=splbill_s5_v3_doc1gen_logo.xml           *
rem              - File must be present in the %D1APPATH% directory               *
rem      MAXAUTO                                                                  *
rem              - Identifies the maximum number of sheets that a Bill may        *
rem                contain and still be considered an Automated Bill; if a Bill   *
rem                has more sheets than the MAXAUTO value, the Bill will be       *
rem                classified as an Oversized Bill                                *
rem              - Sample value: MAXAUTO=6                                        *
rem                                                                               *
rem    S P L   B I L L   P R I N T   F I L E                                      *
rem    =====================================                                      *
rem      SPL_UNSORTED_EXTRACT                                                     *
rem              - Names SPL Bill Print Extract                                   *
rem              - Typical coding SPL_UNSORTED_EXTRACT=bpxtr01.dat                *
rem                                                                               *
rem *******************************************************************************

REM set OUTPUTBASENAME=xx
SET   "LOGFILE=%OUTPUTBASENAME%.log"
IF .%OUTPUTBASENAME% == .                                          SET   "LOGFILE=spl-bill.log"

SET   "GEN_OPS=splbill_s5_v3_doc1gen.ops"
SET   "GEN_HIP=CCB_BILL_XML.hip"
SET   "GEN_ETS=splbill_s5_v3_doc1gen.ets"
SET   "GEN_CNTL=splbill_s5_v3_doc1gen_control_pdf.ets"
SET   "LOGOXML=splbill_s5_v3_doc1gen_logo.xml"
SET   "FRGN_PCE_INI=splbill_s5_v3_frgnsplt_pce.ini"
SET   "FRGN_PCE_CTL=splbill_s5_v3_frgnsplt_pce.ctl"
SET   "CHADR_PCE_INI=splbill_s5_v3_code1chng_pce.ini"
SET   "CHADR_PCE_CTL=splbill_s5_v3_code1chng_pce.ctl"
SET   "SPCL_PCE_INI=splbill_s5_v3_spcsplt_pce.ini"
SET   "SPCL_PCE_CTL=splbill_s5_v3_spcsplt_pce.ctl"
SET   "CPRT_PCE_INI=splbill_s5_v3_createprt_pce.ini"
SET   "CPRT_PCE_CTL=splbill_s5_v3_createprt_pce.ctl"
SET   "MAXAUTO=12"

SET   "C1PRM=splbill_s5_v3_code1.prm"
SET   "MSPRM=splbill_s5_v3_mstream.prm"

SET   "SPL_UNSORTED_EXTRACT=%INPUTBASENAME%.DAT"
IF .%INPUTBASENAME% == .                                           SET   "SPL_UNSORTED_EXTRACT=BPXTR01.DAT"

SET   "FNP="

IF    EXIST "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%"                    GOTO    HAVE-SPL-EXTRACT
ECHO No SPL Extract found "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%" - process bypassed
ECHO No SPL Extract found "%XTRCTPTH%\%SPL_UNSORTED_EXTRACT%" - process bypassed                    >> "%PRODPATH%\%LOGFILE%"
ECHO Process Ended with Completion Code 200                                                         >> "%PRODPATH%\%LOGFILE%"
GOTO  BILL-RUN-END

:HAVE-SPL-EXTRACT
CALL "%D1APPATH%\splbill_s5_v3_called_jobsteps.bat"

:BILL-RUN-END
