Title: How do I specify properties or a properties file on the command line?
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 -J-Discobol.conf=FILENAME PROGRAM
or
java -Discobol.conf=FILENAME com.iscobol.rts.Isrun PROGRAM

When using the debugger, the properties must be specified after the -d or debugger class name (GraphDebugger). 

iscrun -d -Discobol.conf=FILENAME PROGRAM
or
java com.iscobol.debugger.GraphDebugger -Discobol.conf=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 PROGRAM
or
java -Discobol.rundebug=2 com.iscobol.rts.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 PROGRAM
or
java -Discobol.env_var=VALUE com.iscobol.rts.Isrun PROGRAM 

If you want to set a property for the debugger itself, such as iscobol.debug_code_prefix, set it on the java command line before the GraphDebugger class as in:

java -Discobol.debug_code_prefix=c:\p1\p2 com.iscobol.debugger.GraphDebugger -Discobol.conf=FILENAME PROGRAM 

Or if you are using iscrun -d then set it in the environment. For example:
set debug_code_prefix=c:\p1\p2
iscrun -d -Discobol.conf=FILENAME PROGRAM
Authored by: Veryant Support on Fri, Aug 28th, 2009 at 7:00 PM
This question has been viewed 7750 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=31

Powered by PHPKB Knowledge Base Software