Question:
With other COBOLs I can specify a configuration file on the command line and runtime configuration variables in the environment.
How do I accomplish this with isCOBOL?
Answer:
You can specify a properties file on the command line as follows where FILENAME is the name of the properties file and PROGRAM is the name of the program:
iscrun -c FILENAME PROGRAMor
java com.iscobol.invoke.Isrun -c FILENAME PROGRAMWhen using the debugger, the properties must be specified after the -d:
iscrun -d -c FILENAME PROGRAMor
java com.iscobol.invoke.Isrun -d -c FILENAME PROGRAM
Notice that the properties file is specified as the value of the iscobol.conf property. You can also specify other properties and "environment" variables for the COBOL program directly on the command line.
For example, to setup your program for remote debugging you could set iscobol.rundebug=2 as follows:
iscrun -J-Discobol.rundebug=2 PROGRAMor java -Discobol.rundebug=2 com.iscobol.invoke.Isrun PROGRAM For another example, suppose your program has
ACCEPT ENV FROM ENVIRONMENT "env_var"You could set env_var on the command line as follows:
iscrun -J-Discobol.env_var=VALUE PROGRAMor
java -Discobol.env_var=VALUE com.iscobol.invoke.Isrun PROGRAMIf you want to set a property for the debugger itself, such as specifying memory sizes, set it on the java command line before the -d.
java com.iscobol.invoke.Isrun -Xmx512m -d -Xmx3g -c FILENAME PROGRAMIf you use version 2021R1 or later, you can set any configuration variable in your environment by using underscores instead of periods (because Windows doesn't allow periods in environment variables).
Set MYAPP_VAR=Company1And in your program:
accept var from environment "myapp.var"
Article ID: 31
Created: August 28, 2009
Last Updated: May 6, 2022
Author: Support KB Author
Online URL: https://support.veryant.com/phpkb/article.php?id=31