Windows Command Files
IF Command for Conditional Processing
  Table of Contents  v-24.01.01 - if_cmd01.htm 
  Introduction
  Input Data
  Output Results
  Job Scripts
  Windows CMD Files
  Ancillary Items
  The ENV1BASE Command
  The SIMONOTE Command
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will describe and demonstrate how to use a Job Script or Windows CMD file and the IF command to execute a repeatable task based on the results of the "IF" testing the produces a True or False value.

Windows is best known for its graphical user interface (GUI). However, many repeatable tasks need to be scripted and automated without operator intervention. Using Windows Command (or batch) files may simplify routine or repetitive tasks. A batch file is an unformatted text file that contains one or more commands and has a .BAT or .CMD file name extension.

When you type the batch file name at a Windows command prompt, Cmd.exe runs the commands sequentially as they appear in the file. The "IF" testing may alter the sequence of processing within the job script.

From Windows Explorer if you click (or possibly double-click) on the batch file name. The commands within the batch file will be sequentially executed as they appear in the file. The "IF" testing may alter the sequence of processing within the job script.

Note: The job scripts used by SIMOTIME for Windows Systems have been updated to use .CMD Files.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Input Data

The input data is included within the job script. The sequence of events within the job script execution is determined by the results of the "IF" testing.

Table of Contents Previous Section Next Section Output Results

The output data is posted to a Job Log file (JOBLOG_SIMONOTE.txt) that is an ASCII/Text file. The results may be reviewed with a Text Editor of choice.

Thu 12/29/2022 22:47:13.78 + ENV1BASE *
Thu 12/29/2022 22:47:13.79 + ENV1BASE ********************************************************************IF_CMDW1
Thu 12/29/2022 22:47:13.79 + ENV1BASE is preparing the System Environment...
Thu 12/29/2022 22:47:13.80 + SIMOLIBR is c:\SimoLIBR
Thu 12/29/2022 22:47:13.80 + MIFOSYS1 is EDEV
Thu 12/29/2022 22:47:13.81 + BASELIB1 is c:\SIMOSAM1\DEVL
Thu 12/29/2022 22:47:13.81 + SIMONOTE Job Log File is c:\SIMOSAM1\DEVL\LOGS\JOBLOG_SIMONOTE.txt
Thu 12/29/2022 22:47:13.83 + ENV1BASE is returning to caller
Thu 12/29/2022 22:47:13.83 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.84 * Job_Step 01 of 09, Preparing the System and Job Environments
Thu 12/29/2022 22:47:13.84 * Step_End, End of Job Step
Thu 12/29/2022 22:47:13.85 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.85 * Job_Step 02 of 09, A Simple IF command that has equal result
Thu 12/29/2022 22:47:13.86 * User_Tag, Before IF, ONE_CHR_A is A
Thu 12/29/2022 22:47:13.86 * User_Tag, Before IF, ONE_NBR_1 is 1
Thu 12/29/2022 22:47:13.86 * User_Tag, During IF, ONE_CHR_A
Thu 12/29/2022 22:47:13.87 * User_Tag, During IF, ONE_NBR_1
Thu 12/29/2022 22:47:13.87 * Step_End, End of Job Step
Thu 12/29/2022 22:47:13.88 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.88 * Job_Step 03 of 09, A Simple IF with ELSE command that has a not equal result
Thu 12/29/2022 22:47:13.89 * User_Tag, Before IF, ONE_CHR_A is A
Thu 12/29/2022 22:47:13.89 * User_Tag, Before IF, ONE_NBR_1 is 1
Thu 12/29/2022 22:47:13.89 * User_Tag, During IF, ONE_CHR_A A
Thu 12/29/2022 22:47:13.90 * User_Tag, During IF, ONE_NBR_1 1
Thu 12/29/2022 22:47:13.90 * Step_End, End of Job Step
Thu 12/29/2022 22:47:13.91 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.91 * Job_Step 04 of 09, A Simple IF with ELSE command that has a true result
Thu 12/29/2022 22:47:13.92 * Job-Info, the IF with ELSE is defined across mult1ple lines within CMD File
Thu 12/29/2022 22:47:13.92 * User_Tag, Before IF, ONE_CHR_A is A
Thu 12/29/2022 22:47:13.92 * User_Tag, Before IF, ONE_NBR_1 is 1
Thu 12/29/2022 22:47:13.93 * User_Tag, During IF, Matching Condition
Thu 12/29/2022 22:47:13.93 * Step_End, End of Job Step
Thu 12/29/2022 22:47:13.94 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.94 * Job_Step 05 of 09, Test if a file exist
Thu 12/29/2022 22:47:13.94 * User_Tag, the IF with ELSE is defined across mult1ple lines within CMD File
Thu 12/29/2022 22:47:13.95 * User_Tag, During IF, the EXIST test produced an expected true result
Thu 12/29/2022 22:47:13.95 * User_Tag, Delete the TCFILE01 and re-Test if a file exist
Thu 12/29/2022 22:47:13.96 * User_Tag, During IF, the EXIST test actually produced a false result
Thu 12/29/2022 22:47:13.96 * Step_End, End of Job Step
Thu 12/29/2022 22:47:13.97 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:13.97 * Job_Step, 06 of 09, Test the Exit Status of an executable process
Thu 12/29/2022 22:47:13.98 * User_Tag, The exit status is accessed via the ERRORLEVEL Environment Variable.
Thu 12/29/2022 22:47:13.98 * User_Tag, An executable process may be a Program or a Job Script.
Thu 12/29/2022 22:47:13.99 * User_Tag, During IF, the ERRORLEVEL test actually produced a false result of 1
Thu 12/29/2022 22:47:13.99 * Step_End, End of Job Step
Thu 12/29/2022 22:47:14.00 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:14.00 * Job_Step 07 of 09, Test NOT Function
Thu 12/29/2022 22:47:14.01 * User_Tag, Before IF, ONE_CHR_A is A
Thu 12/29/2022 22:47:14.02 * User_Tag, Before IF, ONE_CHR_B is B
Thu 12/29/2022 22:47:14.02 * User_Tag, During IF, the NOT test produced an expected true result of 1
Thu 12/29/2022 22:47:14.03 * Step_End, End of Job Step
Thu 12/29/2022 22:47:14.04 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:14.05 * Job_Step 08 of 09, Nested IF statements
Thu 12/29/2022 22:47:14.05 * User_Tag, Before IF, ONE_CHR_A is A
Thu 12/29/2022 22:47:14.06 * User_Tag, Before IF, ONE_NBR_1 is 1
Thu 12/29/2022 22:47:14.07 * User_Tag, During IF, the nested IFs produced an expected true result
Thu 12/29/2022 22:47:14.07 * Step_End, End of Job Step
Thu 12/29/2022 22:47:14.08 * --------------------------------------------------------------------------- *
Thu 12/29/2022 22:47:14.08 * Job_Step 09 of 09, End of Job Processing
Thu 12/29/2022 22:47:14.09 * Finished CmdName IF_CMDW1.cmd

Table of Contents Previous Section Next Section Job Scripts

A job script may be defined as a text file containing job setup information followed by job steps that identify programs to be executed along with parameters unique to the job step. A job script may be created using a text editor. The naming of a job script is determined by the Operating System. A simple job script may contain a single job step that performs a single function. A typical job script will contain multiple job steps executed in a predefined sequence. The status of each job step may be tested at the end of each job step.

Table of Contents Previous Section Next Section Windows CMD Files

The following Job Script or command file (IF_CMDW1.cmd) is used this test case on a Windows System using Micro Focus COBOL technology.

@echo OFF
     set CmdName=IF_CMDW1
rem  * ************************************************************************
rem  *                 IF_CMDW1.CMD - a Windows Command File                  *
rem  *           This program is provided by SimoTime Technologies            *
rem  *              (C) Copyright 1987-2023 All Rights Reserved               *
rem  *                Web Site URL:   http://www.simotime.com                 *
rem  *                      e-mail:   helpdesk@simotime.com                   *
rem  * ************************************************************************
rem  *
rem  * Text    - A Windows IF Command to alter Batch Job Processing
rem  * Author  - SimoTime Technologies and Services
rem  * Date    - Created 2003/11/11
rem  * Date    - Revised 2023/01/01
rem  * Version - 10.12.16
rem  *
rem  * This job script or command file is used as a test case on a Windows
rem  * System using Micro Focus COBOL technology. The primary objective is
rem  * to test the coding techniques for the IF statements when used in a
rem  * SIMOTIME Environment.
rem  *
rem  * Note: the syntax for an IF statement can be a little sensitive when
rem  * used in a Windows batch or command file.
rem  *
rem  * This job script calls the following Windows Command Files.
rem  * 1. ENV1BASE.cmd - this provides a single point for setting commonly
rem  *    used environment variables.
rem  * 2. SIMONOTE.cmd - this provides a consistent process for displaying
rem  *    messages to the screen and writing to a journal or log file.
rem  *
rem  * ********************************************************************
rem  *
     call ..\ENV1BASE %CmdName%
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 01 of 09, Preparing the System and Job Environments"
rem  *
     set ONE_CHR_A=A
     set ONE_CHR_B=B
     set ONE_NBR_1=1
     set ONE_NBR_2=2
     set TCFILE01=TC_DATA_FILE_01.txt
     set TCFILE02=TC_DATA_FILE_02.txt
     echo RECORD 01 of FILE 01>%TCFILE01%
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 02 of 09, A Simple IF command that has equal result"
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_A is %ONE_CHR_A% "
     call SIMONOTE "* User_Tag, Before IF, ONE_NBR_1 is %ONE_NBR_1% "
rem  * ..1....:....2....:....3....:....4....:....5....:....6....:....7....:....8....:....9....:.. *
     if  %ONE_CHR_A% == A (call SIMONOTE "* User_Tag, During IF, ONE_CHR_A %ONE_CHR_A %")
     if  %ONE_NBR_1% == 1 (call SIMONOTE "* User_Tag, During IF, ONE_NBR_1 %ONE_NBR_1 %")
rem  * The preceding two (2) IF statements have a space in position 87 as a work around
rem  * to avoid the Windows IF processing from producing an incorrect result.
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 03 of 09, A Simple IF with ELSE command that has a not equal result"
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_A is %ONE_CHR_A% "
     call SIMONOTE "* User_Tag, Before IF, ONE_NBR_1 is %ONE_NBR_1% "
rem  *
     if  %ONE_CHR_A% == B (call SIMONOTE "* User_Tag, During IF, %ONE_CHR_A%" ) else (call SIMONOTE "* User_Tag, During IF, ONE_CHR_A %ONE_CHR_A% ")
     if  %ONE_NBR_1% == 2 (call SIMONOTE "* User_Tag, During IF, %ONE_NBR_1%" ) else (call SIMONOTE "* User_Tag, During IF, ONE_NBR_1 %ONE_NBR_1% ")
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 04 of 09, A Simple IF with ELSE command that has a true result"
     call SIMONOTE "* Job-Info, the IF with ELSE is defined across mult1ple lines within CMD File"
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_A is %ONE_CHR_A% "
     call SIMONOTE "* User_Tag, Before IF, ONE_NBR_1 is %ONE_NBR_1% "
     if %ONE_CHR_A% == A (
        call SIMONOTE "* User_Tag, During IF, Matching Condition"
     )  else (
        call SIMONOTE "* User_Tag, During IF, NO Match Condition"
     )
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 05 of 09, Test if a file exist"
     call SIMONOTE "* User_Tag, the IF with ELSE is defined across mult1ple lines within CMD File"
     if exist %TCFILE01% (
        call SIMONOTE "* User_Tag, During IF, the EXIST test produced an expected true result"
     )  else (
        call SIMONOTE "* User_Tag, During IF, the EXIST test actually produced a false result"
     )

     call SIMONOTE "* User_Tag, Delete the TCFILE01 and re-Test if a file exist"
     if exist %TCFILE01% (erase %TCFILE01%)

     if exist %TCFILE01% (
        call SIMONOTE "* User_Tag, During IF, the EXIST test produced an expected true result"
     )  else (
        call SIMONOTE "* User_Tag, During IF, the EXIST test actually produced a false result"
     )
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step, 06 of 09, Test the Exit Status of an executable process"
     call SIMONOTE "* User_Tag, The exit status is accessed via the ERRORLEVEL Environment Variable.
     call SIMONOTE "* User_Tag, An executable process may be a Program or a Job Script.
     copy A to B
     if  "%ERRORLEVEL%" == "0" (
        call SIMONOTE "* User_Tag, During IF, the ERRORLEVEL test produced an expected true result of %ERRORLEVEL% "
     )  else (
        call SIMONOTE "* User_Tag, During IF, the ERRORLEVEL test actually produced a false result of %ERRORLEVEL% "
     )
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 07 of 09, Test NOT Function"
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_A is %ONE_CHR_A% "
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_B is %ONE_CHR_B% "
     if not "A" == "B" (
        call SIMONOTE "* User_Tag, During IF, the NOT test produced an expected true result of %ERRORLEVEL% "
     )  else (
        call SIMONOTE "* User_Tag, During IF, the NOT test actually produced a false result of %ERRORLEVEL% "
     )
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 08 of 09, Nested IF statements"
     call SIMONOTE "* User_Tag, Before IF, ONE_CHR_A is %ONE_CHR_A% "
     call SIMONOTE "* User_Tag, Before IF, ONE_NBR_1 is %ONE_NBR_1% "
     if %ONE_CHR_A%==A if %ONE_NBR_1%==1 (
        call SIMONOTE "* User_Tag, During IF, the nested IFs produced an expected true result"
     )  else (
        call SIMONOTE "* User_Tag, During IF, the nested IFs actually produced a false result"
     )
     call SIMONOTE "* Step_End, End of Job Step"
rem  *
     call SIMONOTE "* --------------------------------------------------------------------------- *"
     call SIMONOTE "* Job_Step 09 of 09, End of Job Processing"
     call SIMONOTE "* Finished CmdName %CmdName%.cmd "
     if not "%SimoMODE%" == "BATCH" pause

Table of Contents Previous Section Next Section Ancillary Items

This section describes additional items that are used with this suite of sample programs.

Table of Contents Previous Section Next Section The ENV1BASE Command

The following batch or command file (ENV1BASE.cmd) is used to set commonly shared environment variables.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2021 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Provide a single point to set common environment variables.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * Set the commonly used environment variables. This is used to provide
rem  * a single point for managing the commonly used environment variables.
rem  *
     set SimoLIBR=c:\SimoLIBR
     set BASELIB1=c:\SIMOSAM1\DEVL
     set BASELIB8=c:\SimoSAM8
     set BaseWIP1=c:\SimoSAM1\WIP1
     set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BASECAT=%BaseLib1%\DATA
     set UMAPALIB=%BASECAT%\ASC1
     set UMAPELIB=%BASECAT%\EBC1
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT
     set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.txt
     set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT
     set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     set SIMONOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.txt
     set USERPOST=%BASEAPP%\LOGS\ASSIGNED_USER_POST_FILE.txt
     if [%1]==[] goto NO_POST
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_%1.txt
     call SIMONOTE "+ ENV1BASE *"
     call SIMONOTE "+ ENV1BASE ********************************************************************%1"
     call SIMONOTE "+ ENV1BASE is preparing the System Environment..."
     call SIMONOTE "+ SIMOLIBR is %SIMOLIBR%"
     call SIMONOTE "+ MIFOSYS1 is %MIFOSYS1%"
     call SIMONOTE "+ BASELIB1 is %BASELIB1%"
:NO_POST
     call SIMONOTE "+ SIMONOTE Job Log File is %SIMONOTE% "
rem  *
     set MQBASE=C:\Program Files\IBM\WebSphere MQ
rem  *
rem  * Set the location for the Apache-Tomcat Server...
     set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52
rem     set CATALINA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112
rem  *
rem  * Set the Environment for the Java Environment...
rem     set JAVABASE=C:\APACHETC\apache-tomcat-7.0.52
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
     set SIMOTCAT=%CATALINA_HOME%\webapps\simotcat
     set SIMPACKS=%CATALINA_HOME%\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
rem  * Set the environment for the Micro Focus technology...
     set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer
     set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL Build Tools
     set MIFOESTU=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0
     set MIFOEMFE="C:\Program Files (x86)\Micro Focus\Mainframe Express"
rem  *
rem  * Large file support, performance tuning and record locking of the File Handler
     set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem  *
rem  * For IMS Support
     set ES_IMSLIB=%BASEAPP%\IMSLIB
     set ES_ACBLIB=%BASEAPP%\IMSLIB
rem  *
rem  * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES
     set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat
rem  *
rem  * Resource Allocation and Performance for SORT and non-Relational Data
rem  set MFJSENGINE=SYNCSORT
     set SORTSCHEME=1
     set SORTSPACE=750000000
     set TMP=C:\SORTWORK
rem  *
     set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
rem  * For CORE_ON_ERROR function, ABEND Dump
rem  *     set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem  *
rem  * Consolidated Trace Facility (CTF)
rem  *     set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg
rem  *     set MFTRACE_LOGS=c:\ctflogs
rem  *
rem  * For Job Restart, ABEND Recovery
     set MF_UCC11=Y
     set ES_JES_RESTART=Y
rem  *
rem  * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
     set ES_EMP_EXIT_1=mfbsiemx
     set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME%
     set MFBSIEOP_CMD=ENABLE
     set MFBSIEOP_CSV=ENABLE
     set MFBSIEOP_HTM=ENABLE
     set MFBSIEOP_XML=ENABLE
rem  *
rem  * Set Behavior and Trace Flags for GETJOBDD
rem  *   Position=12345678/12345678
     set JDDFLAGS=nnnWnnnn/YYnnnnnn
rem  *
rem  * If not already set then set the PATH for Micro Focus Directories
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "EDEV" goto JUMPEDEV
     if "%MIFOSYS1%" == "VCBL" goto JUMPVCBL
     if "%MIFOSYS1%" == "ESTU" goto JUMPESTU
     if "%MIFOSYS1%" == "EMFE" goto JUMPEMFE
:JUMPEDEV
     set path=%BASESYS%\LOADLIB;%MIFOEDEV%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOEDEV%\CPYLIB
     set MIFOBASE=%MIFOEDEV%
     goto JUMPPATH
:JUMPVCBL
     set path=%MIFOVCBL%\bin;%MIFOVCBL%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set MIFOBASE=%MIFOVCBL%
     goto JUMPPATH
:JUMPESTU
     set MIFOBASE=%MIFOESTU%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
:JUMPEMFE
     set MIFOBASE=%MIFOEMFE%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
rem  *
:JUMPPATH
     set SIMOPATH=Y
rem  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASEAPP%\LOADLIB\GNTS;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%\simpacks
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes\simpacks
rem  *
     if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN%
     if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\bin\mfcobol.jar
rem  *
     set JobStatus=0000
     call SIMONOTE "+ ENV1BASE is returning to caller"


Table of Contents Previous Section Next Section The SIMONOTE Command

The following batch or command file (SIMONOTE.cmd) is used to provide a consist methodology for displaying information to the screen and writing the same information to a log file with a date and time stamp.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *            (C) Copyright 1987-2019 All Rights Reserved            *
rem  *              Web Site URL:   http://www.simotime.com              *
rem  *                    e-mail:   helpdesk@simotime.com                *
rem  * *******************************************************************
rem  *
rem  * Text    - Display message on screen and write to a log file.
rem  * Author  - SimoTime Technologies
rem  *
rem  * This script may be called from other scripts and expects a single
rem  * parameter enclosed in double quotes. The double quotes will be
rem  * removed. Before writing to the log file a date and time stamp
rem  * will be inserted in front of the message text.
rem  *
rem  * Note: The tilde (~) removes leading/trailing double-quotes.
rem  *
if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
echo %date% %time% %~1>> %SimoNOTE%
echo %~1

Table of Contents Previous Section Next Section Summary

This document has been provided to describe and demonstrate how to use a Job Script or Windows CMD file and the IF command to execute a repeatable task based on the results of the "IF" testing the produces a True or False value. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
IF Command for Windows
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com