Appendix F

Batch Command Reference

!

This batch command runs a specified script. The syntax is:

!command 

?

The ? command displays information about a command that you specify.

The syntax is:

?command 

If you do not specify a command in the command variable, the system displays information about all batch commands.

<

This batch command reads commands from the specified file and returns to the command line when finished. The syntax is:

<scriptname

This command can be nested.

>

This batch command prints output to a specified file or to the screen. To print output to a file, the syntax is:

>output_file

To print output to the screen, the command syntax is:

> stderr

>>

This batch command appends output to a specified file.

The syntax is:

>>output_file

addalertconfiguration

The addalertconfiguration allows you to configure alerts in batch mode.

The syntax is:

addalertconfiguration <alertcategoryname> "alertCategory"  <toleranceabsolute> toleranceAbsolute <tolerancepercent> tolerancePercent <numberofperiods> numberofperiods <useabsolute> activeflag 

where:

For example:

addalertconfiguration (alertcategoryname) "Demand" (toleranceabsolute) 20 (tolerancepercent) 40 (useabsolute) True

addcommodity

The addcommodity command adds a commodity to a model. You can also assign a planning unit of measure to the commodity. If you assign a planning unit of measure, it must be defined in the Units of Measure list. For example, to add the commodity named Apple_Pancake_Mix and describe the commodity as the packages for packing, with a planning unit of measure of cases, enter the following:

addcommodity <name> "Apple_Pancake_Mix" <description> "Apple pancake for packed mix" <family> "Pancake_Mix" <planningUom> "Case" 

addcurrency

The addcurrency command uses import files to update the Currency Table. You can use the addcurrency import command to specify data for the currency table. The syntax is:

addcurrency <currencyName> "Currency name" <currencyCode> "Code" <period> "period" <conversionRate> "rate"

For example, to add Canadian Dollar to the Currency Table and set the exchange rate, relative to the base currency at 1.56, enter the following:

addcurrency <currencyName> "Canadian Dollar" <currencyCode> "CDN" <period> "June 2001" <conversionRate> 1.56

addevent

The addevent command creates a new event. The syntax is:

addevent <eventName> "eventName" <eventType> "type"

where "type" can be "Planned" or "Unplanned". To add a description of the event, add the optional tag: <description> "description"

For example:

addevent <eventName> "Event 1" <eventType> "Planned" <description> "First of 5"

addeventchange

The addeventchange command performs a change on an event. The syntax is:

addeventchange <eventName> "scenarioName" <tags>  

where (tags) represents the tags used to specify the change criteria. These tags are dependant upon the node type and the type of query you want to perform. For example:

addeventchange <eventName> "Event 1" <type> "Demand" <min> "x*1.05" <max> "x*1.05"

addeventimport

The addeventimport command adds an import file to a scenario.

The syntax is:

addeventimport "scenarioName" "importfilename"

For example:

addeventimport "New Production Line" "C:\import_line.bat"

addeventmatch

The addeventmatch command performs a match for a specified event.

The syntax is:

addeventmatch <eventName> "eventName" <tags> 

where (tags) represents the tags used to specify the match criteria. These tags are dependant upon the node type and the type of query you want to perform.

For example:

addeventmatch <eventName> "Event 1" <type> "Demand" <name> *

addeventperiodrangetoscenario

The addeventperiodrangetoscenario command adds a period range to a scenario for an existing event.

The syntax is:

addeventperiodrangetoscenario <eventName> "eventName" <scenarioName> "scenarioName" <startPeriod> "period1" <endPeriod> "period2" 

The <endPeriod> tag is optional. If you do not specify an end period, the last period in the model is the default end period. Periods must be in the same format as periods in the model.

For example:

addeventperiodrangetoscenario <eventName> "Event 1" <scenarioName> "Demand + 5%" <startPeriod> "June 07" <endPeriod> "October 07"

addeventtoscenario

The addeventtoscenario command adds an existing event to a scenario.

The syntax is:

addeventtoscenario <eventName> "eventName" <scenarioName> "scenarioName" 

For example:

addevent <eventName> "Event 1" <scenarioName> "Demand + 5%"

addkpicfg

The addkpicfg command allows you to specify which type of chart to display in the Scenario Manager and whether or not to include penalty costs.

The syntax is:

addkpicfg <chartType> chartType <includePenalty> activeflag 

where chartType can be bar, pie, or polar and activeflag can be True or False.

For example:

addkpicfg <chartType> pie <includePenalty> False

addmenubutton

The addmenubutton command adds customized menus for running batch scripts to the Oracle Strategic Network Optimization interface by using the linx.startup file. In the linx.startup file, enter the following line:

addmenubutton "menu|item|subitem" path/file

where:

Quotation marks are required around menu|item|subitem only if a parameter contains a space. For example, to create the menu choice Reports>Utilization>Crew, which, when chosen, runs the crew_util.bat batch script, enter the following:

addmenubutton "Re&ports|Utilization|Crew" "d:\program files\sno\ startup\crew_util.bat" 

The ampersand (&) denotes that the p in Reports is a keyboard shortcut, and is underlined.

addprofile

The addprofile command creates a profile that can be published to a .csv., .xml, or .smart file.

The syntax is:

addprofile <profileName> "ProfileName" <profileDescription> "ProfileDescription" <outputFile> "OutputFilename" <scriptFile> "ScriptFilename" <smartGraph> "SmartGraphFilename"

For example:

addprofile <profileName> "SnoSourcingRecommendation" <profileDescription> "This profile publishes sourcing recommendations for SNO" <scriptFile> "Script_A.bat" <outputFile> "2005.xml" <smartGraph> "SNO_Smart2.smt"

The tags <profileDescription> and <scriptFile> are optional.

addriskstrategy

The addriskstrategy command adds a risk type in the Risk Registry. This risk strategy appears in nodes and arcs that have a Cost field.

The syntax is:

addriskstrategy <riskStrategyName> "riskstrategyname" <riskStrategyDescription> "riskstrategydescription" <riskStrategyMultiple> 1 <riskStrategyAddition> 0

For example:

addriskstrategy <riskStrategyName> "August_1" <riskStrategy Description> "Tropical Storm" ,riskStrategyMultiple> 2 <riskStrategy Addition> 10

"No Risk" is the default risk strategy name, and cannot be deleted from the Risk Registry. The "No Risk" risk strategy name is automatically created when a model is loaded. The default factor for riskStrategyMultiple is 1 and the default constant for riskStrategyAddition is 0.

addroot

The addroot command sets the appearance of the graphical display and is an alternative to using the View menu. It affects the display only and does not change the data in the model in any way.

For example, to display a view that has compressed nodes, fat arcs, and hidden unused arcs, enter the following:

addroot <CompressNodes> True <HideUnusedArcs> True <FatArcs> True

For each of the following optional tags, you must specify True or False:

The optional tag <reportBy> reportBy can also be added, where reportBy can be cost, profit, or riskadjustedcost. The optional tags <chartType> chartType and <includePenalty> activeflag can also be added, where chartType can be bar, pie, or polar and activeflag can be True or False.

The optional tag <mipInHeur> invokes Mixed Integer Programming in the CAM heuristic. The default value is 0. To turn on Mixed Integer Programming, import a file with the following line:

addroot <mipInHeur> 1

addscenario

The addscenario command creates a scenario.

The syntax is:

addscenario <scenarioName> "scenarioname"

To add a description of the scenario, add the optional tag:

<description> "description" 

To show the scenario in Kpi view, add the optional tag:

<showInKpiView> showinkpi 

To specify a color, add the optional tag:

<color> RGB in hex 

For example:

addscenario <name> "Scenario_A" <description> "Demand increase of 5%" <showInKpiView> showinkpi

addscenarioendscript

The addscenarioendscript command adds an end script file to a scenario.

The syntax is:

addscenarioendscript "scenarioname" "endscriptfilename" 

For example:

addscenarioendscript "Demand +5%" "C:\convert_smart.bat"

addscenariosmart

The addscenariosmart command associates a report with a scenario.

The syntax is:

addscenariosmart "scenarioname" "smartname" 

For example:

addscenariosmart "Demand +5%" "C:\demandfill.smt"

addscenariosolveres

The addscenariosolveres command stores the results of a solve when a scenario runs in batch mode. If the model is saved, this information is retained with the model. Do not specify this command as it returned by the solver.

The syntax is:

addscenariosolveres "scenarioname" TotalCost TransportationCost ProductionCost SupplyCost InventoryCost OtherCost LaborUtilization MachineUtilization DemandFillRate SolutionTime TimeLastSolved

addscenariostartscript

The addscenariostartscript command adds a start script file to a scenario.

The command syntax is:

addscenariostartscript "scenarioname" "startscriptfilename" 

For example:

addscenariostartscript "New Production Line" "C:\generate_import.bat"

addscenarioview

The addscenarioview command adds an existing view to a scenario.

The syntax is:

addscenarioview "scenarioname" " viewname" 

For example:

addscenarioview "New Production Line" "Line Level"

addUom

To add a unit of measure to the Units of Measure list, you use the addUom command.

The syntax is:

addUom "UnitOfMeasure" 

For example, to add a unit of measure named Pallet, enter the following:

addUom "Pallet"

addUomToCommodity

To add an alternative unit of measure to a commodity, you use the addUomToCommodity command. Any unit of measure you add to a commodity must already exist in the Units of Measure list.

The syntax is:

addUomToCommodity <commodityName> "CommodityName" <uom> "UnitOfMeasure" <uomFactor> factor <planningFactor> factor 

For example, to add a unit of measure named Pallet to a commodity named Apple_Pancake_Mix that has a planning unit of measure of Kg, and there are 60 Kg per pallet, enter the following:

addUom <commodityName. "Apple_Pancake_Mix" <uom> "Pallet" <uomFactor> 1 <planningFactor> 60

applysmartgraphs

The applysmartgraphs command applies active reports in batch mode and stores the results in a .smart file.

The command syntax is:

applysmartgraphsfilename.smart 

If you do not specify an output file, the results are stored in the file $HOME/linx.smart.

changeprofile

The changeprofile command modifies the information in a profile. The syntax is:

changeprofile <oldProfileName> "OldProfileName" <newProfileName> "NewProfileName" <newProfileDescription> "NewProfileDescription" <newSmartGraphToPublish> "NewSmartGraphToPublish" <newProfileScript> "NewProfileScript" <newProfileOutputFile> "NewProfileOutputFile" 

For example:

changeprofile <oldProfileName> "SnoSourcingRecommendation" <newProfileName> "Q2 SnoSourcingRecommendation" <newProfileDescription> "This profile publishes sourcing recommendations for SNO for Q2,2006" <newSmartGraphToPublish> "Sample.smt" <newProfileScript> "Script A" <newProfileOutputFile> "Q2_2006.xml"

copyright

The copyright command hides the splashscreen that appears when Oracle Strategic Network Optimization starts. The syntax is:

copyright n

coredump

In UNIX, if coredump is on, a core file is created when the application terminates unexpectedly.

The syntax is:

coredump <y/n>

where <y/n> specifies whether coredump is on or off. By default, coredump is on.

cplexdump

The cplexdump command creates either an MPS file, which provides the objective functions and constraints in a column format, or an LP, which provides the objective function and constraints in algebraic form.

The syntax is:

cplexdumpfilename <lp/mps>

where <lp/mps> specifies whether the file format is LP or MPS. For example:

cplexdump model.lp lp 

You must first use the generate command before using the cplexdump command.

cvreport

The cvreport command creates a report on the results of a solve in batch mode.

The syntax is:

cvreport filename -varInfo variables... -consInfo constraints... 

The filename is the file where the report is saved. Tabs always separate the output. The variables...are one or more of the following:

Value Meaning
x Value of variable
cost Cost of variable
redcost Reduced cost of variable
lb Lower bound
ub Upper bound
lowersa Lower cost sensitivity bound
uppersa Upper cost sensitivity bound
basis Basis code

If you do not want to report on any variables, omit the -varInfo parameter. The constraints are one or more of the following:

Value Meaning
slack The amount of slack from the right hand side
dual Dual cost
rhs Value of the right hand side
rhssalower Lower rhs sensitivity bound
rhssaupper Upper rhs sensitivity bound
basis Basis code

If you do not want to report on any constraints, omit the -consInfo parameter. For example, the following command creates a report in the file var.rpt for all variables for the reduced cost and the lower and upper cost sensitivity ranges:

cvreportvar.rpt -varInfo redcost lowersa uppersa

deletecurrency

The deletecurrency command uses import files to delete a currency from the Currency Table.

The syntax is:

deletecurrency <currencyCode> "code" 

For example:

deletecurrency "USD"

deleteevent

The deleteevent command series deletes an event.

The syntax is:

deleteevent <eventName> "eventName" 

For example:

deleteevent "Event 1"

deleteprofile

The deleteprofile command deletes a publish profile.

The syntax is:

deleteprofile "ProfileName" 

For example:

deleteprofile "SNO Profile Q2"

deleteriskstrategy

The deleteriskstrategy command deletes a risk strategy from the Risk Registry.

The syntax is:

deleteriskstrategy "riskstrategyname"

For example:

deleteriskstrategy "Tropical Storm"

deletescenario

The deletescenario command deletes a scenario.

The syntax is:

deletescenario "scenarioName" 

For example:

deletescenario "Demand +5%"

deleteUom

To delete a unit of measure from the Units of Measure list, you use the deleteUom command.

The syntax is:

deleteUom "UnitOfMeasure" 

For example:

deleteUom "Pallet"

deleteUomFromCommodity

To delete an alternative unit of measure from a commodity, use the deleteUomFromCommodity command.

The syntax is:

deleteUomFromCommodity <commodityName> "CommodityName" <uom> "UnitOfMeasure" 

For example, to delete a unit of measure named Pallet from a commodity named Cardboard Packages, enter the following:

deleteUomFromCommodity <commodityName> "Cardboard Packages" <uom> "Pallet"

It is not possible to delete the planning unit of measure from a commodity using this command.

detailedreport

After you solve a model, you can use the detailedreport command to view a detailed cost, profit, or risk adjusted cost report that shows the distribution of costs or profits by node type.

The syntax is:

detailedreport

discardbasis

The discardbasis command discards the solver basis in batch mode. The syntax is:

discardbasis

duplicatescenario

The duplicatescenario command duplicates a scenario in batch mode. The duplicated scenario has all the same attributes and associations as the original. However, a duplicated scenario is not updated when changes are made to the original. The syntax is:

duplicatescenario "scenarioName" 

For example:

duplicatescenario "Scenario_A"

exit

The exit command in batch mode stops the execution of all scripts, regardless of how many scripts are running. The syntax is:

exit

exportsmartgraph

The exportsmartgraph command exports data extracted from a model by the report file (filename.smt) to a comma separated value file.

The syntax is:

exportsmartgraph filename.smt filename.csv

If there are spaces in the names of the files, quotation marks are required.

exportsmartgraphxml

The exportsmartgraphxml command exports data extracted from a model by the report file (filename.smt) to a XML file.

The syntax is:

exportsmartgraph xmlfilename.smt filename.xml

If there are spaces in the names of the files, quotation marks are required.

fix

The fix command sets Fix fields to Yes for nodes and arc within a set.

The syntax is:

fixset

formatgraph

The formatgraph command in batch mode formats the contents of a block.

The syntax is:

formatgraph blockname 

If you do not specify a block name, the command formats the top-level view.

generate

The generate command creates the cplex.lp file for the model that you have loaded. This command must be used before the cplexdump command is used.

The syntax is:

generate

help

The help command, in batch mode, displays information about a command that you specify.

The syntax is:

helpcommand 

If you do not specify a command in the command variable, the system displays information about all batch commands.

import

The import command imports a file in batch mode.

The syntax is:

import filename.imp

inactivateallsmartgraphs

The inactivateallsmartgraphs command deactivates all reports in batch mode.

The syntax is:

 inactivateallsmartgraphs

loadsmartgraph

The loadsmartgraph command loads a report in batch mode. Reports have the .smt extension. The command syntax is:

loadsmartgraph filename.smt

memtest

The memtest command displays the total amount of memory on the system that is available to Oracle Strategic Network Optimization in batch mode. The command syntax is:

memtest

The command takes a while to run as it scrolls the amount, which is displayed in both bytes and megabytes.

modelprofile

The modelprofile command prints the model name, the model size, the number of arcs, nodes, commodities and periods, solver details and an estimated number of variables and constraints by node type and arc. The actual number of variables and constraints is provided by solver details for models that have been solved. It can also provide information about Block nodes in the model.

The syntax is:

modelprofile <y/n> filename 

where <y/n> specifies whether to generate Block node information that includes the Block node name and the node types and arcs that are contained in the Block node. If you do not specify a filename, this information is printed in the console. The following command prints model information including Block node details to a file named modelprofile.txt:

modelprofiley c:\modelprofile.txt

panicsave

If panicsave is on, a backup of the model called LinxSave.sym is performed when a controlled termination of the application occurs.

The syntax is:

panicsave <y/n> 

where <y/n> specifies whether panicsave is on or off. By default, panicsave is on.

printscenarios

The printscenarios command lists the events in a scenario.

The syntax is:

printscenarios 

problemstats

Oracle Strategic Network Optimization accepts a solution with unscaled infeasibilities because it is likely the feasibility violation is relatively minor. It might be possible for the solver to find a better solution even though the model contains unscaled infeasibilities, or it might be necessary to revise some of the costs in the model. The problemstats batch command can be used to locate this information.

The syntax is as follows:

problemstats

publishprofile

The publishprofile command is used to publish a profile to a .csv, .xml, or .smart file.

The syntax is as follows:

publishprofile "ProfileName"

quit

The quit command stops the current script in batch mode.

The syntax is:

quit

record

The record command records each noncomment batch command that Oracle Strategic Network Optimization runs. When used with parameters, the record command specifies the filename to which the system saves information. When used without parameters, the record command closes the file that is currently open.

The syntax is:

record filename

removemenubutton

The removemenubutton command deletes a menu option. In the linx.startup file, enter the following line:

removemenubutton "menu|item|subitem"

where:

Quotation marks are required around menu|item|subitem only if a parameter contains a space.

For example:

removemenubutton Solve|Configure 

removes the Configure option from the Solve menu.

renameUom

To rename a unit of measure in the Units of Measure list, you can use the renameUom command.

The syntax is:

renameUom "oldname" "newname" 

For example, if you want to rename the unit of measure from Kilogram to Kg, enter the following:

renameUom "Kilogram" "Kg"

restorebaseline

The restorebaseline command restores the baseline in a model in batch mode.

The syntax is:

restorebaseline

returnfromui

The returnfromui command returns the user to batch mode from interface mode. This command must be used before using the ui command. The syntax is:

 returnfromui y

runsenario

The runscenario command runs a scenario in batch mode.

The command syntax is as follows:

runscenario "/treeposition"

where "/treeposition" is the location in the scenario tree.

For Example:

runscenario "/Scenario_A/Scenario_2"

selectscenario

The selectscenario command selects a scenario.

The syntax is:

selectscenario "/treeposition"

where "/treeposition" is the location in the scenario tree.

setbaseline

The setbaseline command sets the baseline of a model in batch mode.

The syntax is:

setbaseline

setscenariodemandseries

The setscenariodemandseries command specifies the demand series to be used in a scenario.

The command syntax is:

setscenariodemandseries <scenarioName> "scenarioName" <demandseries> "demand" 

For example:

setscenariodemandseries <scenarioName> "Demand + 5%" <demandseries> "Demand Series #3"

setscenariosafetystockseries

The setscenariosafetystockseries command specifies the safety stock series to be used in a scenario.

The syntax is:

setscenariosafetystockseries <scenarioName> "scenarioName" <safetystockseries> "safety" 

For example:

setscenariosafetystockseries <scenarioName> "Demand + 5%" <safetystockseries> "Safety Stock Series 2b"

setsolveralgorithm

The setsolveralgorithm command specifies the type of linear program used in a solve.

The syntax is:

setsolveralgorithm linearprogramtype 

where linearprogramtype is one of the following:

setstringlength

The setstringlength command specifies the maximum number of characters that can be used in a node name.

The command syntax is:

setstringlength x

where x is the maximum number of characters that can be used. This number cannot exceed 255.

showlonelynodes

The showlonelynodes command prints the names and node types of all lonely nodes in the model. A node is lonely if arc connections exist but are hidden.

The syntax is:

showlonelynodes

solutionquality

The solutionquality command displays data about the maximum reduced-cost infeasibility, the maximum bound infeasibility, and the sensitivity of the model data. The syntax is:

solutionquality

solve

The solve command solves models or parts of models in batch mode with the current options.

The syntax is:

solve

To solve part of a model, you can restrict the solve to a particular set using the following command:

solvesetname 

where setname is the name of the set to which the solve is restricted.

solvereport

After you solve a model, you can use the solvereport command to view a summary cost, profit, or risk adjusted cost report of the solve. The syntax is:

solvereport

solverlog

The solverlog command directs Oracle Strategic Network Optimization to write the number of solver iterations in each stage of a solve to the lxsolve.log file, which is stored in the current working directory.

The syntax is:

solverlog y

symloadfile

The symloadfile command loads a symbolic file in batch mode. Symbolic-format files are saved with the .sym extension. The syntax is:

symloadfile filename.sym

symsave

The symsave command saves a file in symbolic format in batch mode. Symbolic-format files are saved with the .sym extension. The syntax is:

symsave filename.sym

timestamp

The timestamp command displays the total number of seconds that have elapsed since January 1, 1970.

The syntax is:

timestamp

ui

The ui command in batch mode starts the user interface. The syntax is:

ui

unfix

The unfix command sets Fix fields to No for nodes and arcs in one set or in an entire model. The command syntax to unfix the Fix fields for nodes and arcs in one set is:

unfix set 

The command syntax to unfix the Fix fields for nodes and arcs in the entire model set is:

unfix all

unloadsmartgraph

The unloadsmartgraph command unloads a report in batch mode. A report has the .smt extension.

The syntax is:

unloadsmartgraph filename.smt

unloadsmartgraphs

The unloadsmartgraphs command unloads all reports in batch mode. Reports have .smt extensions.

The syntax is:

unloadsmartgraphs

verbose

The verbose command specifies whether to print each command before running it in batch mode. To print commands before running them, enter:

verbose y 

To stop printing commands before running them, enter:

verbose n