Professional Documents
Culture Documents
EMME2 - MACROS-chap5
EMME2 - MACROS-chap5
5 Macros
Macros are used to provide “automatic” answers to the Emme dialog. A macro may contain a
sequence of dialog responses which is used frequently, thereby eliminating the need to enter the
individual answers every time. Macros are also very useful for implementing lengthy procedures,
especially those that are used with different sets of parameters or input data.
An Emme macro depends on information contained in sequential text files which, unlike the
Emme data files, are never read into the database. It is therefore easy to create or modify macros
and annotations using a text editor and to exchange them for use with different databases.
• Section 5.1 describes the capabilities of the Emme macro language, which is used to define mac-
ros, and the interactive commands available for debugging macros in single step tracing mode.
• The Emme package contains some macros that are supported by INRO. Section 5.2 describes
these macros (modifydb, split2layovers, emme2notify, emme2shp).
2007/02/23 5-1
Macro Language Emme Prompt Manual
A macro is a file which contains a sequence of answers to the questions posed in a given dialog.
The maximum macro line length is 128 characters. In its simplest form, a macro consists of a
sequence of predefined answers. Simple macro creation and recall, using only the macro save
(~>) and macro recall (~<) commands, is described on page 3-20. However, for users that need
to implement complex repetitive procedures, a powerful set of macro commands (see Table 5.1)
is available. By using features of the macro language such as the substitution mechanism, condi-
tional and branching commands, register arithmetic and feedback of macro result values via sca-
lars, it is possible to write more complex macros that generate answers which may vary from one
run to another (or from one database to another).
The actual dialog responses generated by a macro can be varied from one macro call to another
by using macro arguments specified in the macro call command or by using information entered
during macro execution in response to a terminal read command.
• Macros may be recalled with optional arguments. The arguments are used to substitute for the
positional parameters %1%, %2%, …, %32% that appear in the macro. The formal parameter %0% is
substituted by the current number of arguments (see Substitutions in macros on page 5-4). The
substitution mechanism may also be used while a macro is being created, that is, lines containing
formal parameters are first saved in the macro file and then the substitution using any arguments
from the macro save command is carried out, before the input line is used as a dialog response
or macro command. For example, a macro named vdpar which specifies the volume-delay func-
tion to be plotted together with the values for the different variables, may be created in the follow-
ing way :
%1%
fd1 = length * (2.4855 + (.005887 * (volau + volad) / lanes) ^ 3.6596)
Creation of a macro with Enter: Variable to plot on horizontal axis=volau
Enter: Range of volau ( 0.00, 100.00)=
initial parameters
Set of curves for a variable?n
Enter: volad=%2%
Enter: lanes=%3%
Enter: length=%4%
The values fd1, 0, 1 and 1 are the initial values for the macro parameters %1%, %2%, %3% and
%4%, to be used while the macro save command is active. The saved macro can then be recalled
for any function with the same keywords, by calling the macro with the new values. For example,
entering ~<vdpar fd2 1 2 1 will generate dialog answers using these new values :
< fd2
fd2 = length * (1.621 + (.002662 * (volau + volad) / lanes) ^ 3.5038)
Recall of a macro with new Enter: Variable to plot on horizontal axis= < volau
Enter: Range of volau ( 0.00, 100.00)= <
parameters
Set of curves for a variable? < n
Enter: volad= < 1
Enter: lanes= < 2
Enter: length= < 1
5-2 2007/02/23
Emme Prompt Manual Macro Language
~# comment Macro comment line (not copied to the terminal). See page 5-4.
~/ comment Comment line to be copied to the terminal, with (~/) or without (~~/) line
~~/ comment feed. See page 5-4.
~% Shift parameters down (%1% ← %2%, %2% ← %3% …).1 See page 5-2.
~+X…X…X… Compound command. Used to define one line of a macro file which is
composed of multiple dialog input lines. See page 5-8.
~! external cmd Command escape. Execute operating system command external cmd.
Operations on registers ~ reg ⊗ value Perform arithmetic operation on writable numeric register reg . The opera-
tor ⊗ can be :
= initialize reg to value (reg= value )
+ add value to reg (reg=reg + value )
− subtract value from reg (reg=reg - value )
∗ multiply reg by value (reg=reg * value )
/ divide reg by value (reg=reg / value )
% set reg to reg modulo value (reg=reg .mod. value )
& bitwise AND value to reg (reg=int(reg ) & int(value ))
| bitwise OR value to reg (reg=int(reg ) | int(value ))
See Read/write registers on page 5-13.
Test commands ~?reg ⊗ value Conditional command.1 Execute next line only if expression is true (~?) or
~?!reg ⊗ value false (~?!). The comparison operator ⊗ can be :
= equal
< less than
> greater than
& bitwise AND (for integer registers only)
Register reg must be one of the registers listed in Table 5.3.
See Tests in macros on page 5-7.
~?e Test for error condition.1 Execute next line only if an error condition has
~?!e (~?e) or has not (~?!e) occurred. See page 5-7.
Branching commands ~: label Define an address label (target for a branch command). See page 5-7.
~$ label Branch to the specified address label.1 Search starts at the beginning of
~$> label the macro file (~$), or from the current position (~$>). See page 5-7.
Input/output commands ~*prompt string Read one line from terminal, with optional prompt string. See page 5-4.
~< macro p1…pN Call macro as a sub-procedure of the current macro. See page 5-9.
~<<filename Open the macro filename. See page 5-10.
~@ Read one line from the macro filename opened using ~<<. See page 5-10.
~>>filename Append subsequent dialog answers and macro commands to file file-
name. See page 5-10.
~"text Append text to file filename opened using ~> or ~>>. See page 5-10.
2007/02/23 5-3
Macro Language Emme Prompt Manual
• The shift command (%) shifts down by one index all current arguments, providing a convenient
way to process arguments one by one. The first parameter is discarded, the second parameter
takes the place of the first, etc. This allows access to all parameters, using the positional
parameters %1%, %2%, …, %32%, even when a macro has been called with more than
32 arguments.
• A terminal read command (~*) provides an alternate way of defining parts of a macro at run
time. When it appears in a macro, the user is prompted to input one line from the terminal. This
line is processed instead of the terminal read command and macro processing continues normally
thereafter. If any text string follows the asterisk, it will be used as a prompt string; otherwise >>
will be used.
Comments in macros
The macro file can include comments. The ~# command is used to annotate or document the
macro program itself, whereas the ~/ or ~~/ commands are used to display comments on the ter-
minal while the macro is running. When the ~~/ variant is used, the comment line is not termi-
nated by a line feed, so that subsequent macro output is displayed on the same line (bit 1 of the o
register must be set; see Table 5.4). Note that trailing blanks are ignored.
Substitutions in macros
The macro language provides a general substitution mechanism that may be used to generate
answers which are not fixed. These answers are coded in the macro as substitution keys, which
are always surrounded by the % sign.
• Before being executed, each line of the macro is pre-processed, that is, any substitution key is
replaced by the appropriate value. The substitution keys, which are recognized and replaced
when they appear in a macro, are listed in Table 5.2.
• The string %%% can be used to force a % in the dialog input. For example, in order for a macro to
issue menu commands such as batchout=b%s%.%m% (see File naming of input and output on
page 3-30, and Module 0.00), it is necessary to prevent immediate substitution of %s% or %m% by
the current scenario and module number. In this case, the macro line would be :
batchout=b%%%s%%%.%%%m%%%
Within a compound macro line (see page 5-8), substitutions occur when the macro line is read
and again for each separate dialog input line generated. Therefore, for a parameter to be substi-
tuted at the dialog input line level, it must be specified with %%%, for example : %%%x%%%.
• Scalar substitution (%ms X%) provides access to the value of a scalar matrix specified by the
number X, if X is a number from 1 to 999, or of a scalar matrix whose number is specified by con-
tents of register X, if X is the letter x, y or z.
5-4 2007/02/23
Emme Prompt Manual Macro Language
Key Replaced by
%reg% Value of register reg. Value is a number for numeric registers or a text
string of up to 128 characters for text registers. See Table 5.3.
%gX% %rX% Value of floating point registers rX or gX, where X is a number from 1 to
250 or the letter x, y or z.
%msX% Contents of scalar matrix X, where X is a number from 1 to 999 or the let-
ter x, y or z (matrix number is contents of register x, y or z).
%tX.L% or %tX_L% The first L characters of text register tX, where X is a number from 0 to 9
or the letter c, e, l, p, s or u. See page 5-12.
%numsub.D_W% or Any numeric substitution with D decimals and right justified in W charac-
%numsub_W.D% ters.
• It is also possible to access the matrix name (%m TX.n%), description (%m TX.d%) and time
stamp (%m TX.t%) for any matrix m T, where T is the matrix type (f, d, o or s). By default, trailing
blanks are removed from the name and description. The time stamp can be used to test the exist-
ence of a matrix using such a substitution. In the following example, the time stamp of matrix mf9
2007/02/23 5-5
Macro Language Emme Prompt Manual
is read into register t1. The first character of register t1 is tested: if it is % (no substitution possi-
ble) the matrix does not exist; otherwise, a substitution occurred indicating that the matrix exists.
• Text substitution (%tx.L% or %tx_L%) provides access to substrings in text registers (see Text
registers on page 5-13). L is an integer number that defines the substring to be retained. When
L is positive (L > 0), the first L characters of the text register are retained. When L is negative
(L ≤ 0) the first L characters are skipped and only the characters that follow are retained. For
example, %t7_1% yields the first character of text register 7, and %t6.-10% yields the substring
from text register 6 starting at character 11 (first 10 characters are skipped, trailing blanks
removed).
• When using %msX%, %rX% and %gX% numeric substitutions, it is possible to specify the number
of decimals. The number of decimals is specified using a dot (.) followed by a digit D (D=0 … 9).
If D=9, the default automatic format conversion is used. If D=0, the nearest integer is substituted.
For example, if the value of g1 is 123.789, %g1.0% will be replaced by 124.
• When using numerical register or scalar (%msX%) substitutions, it is possible to specify the field
width. This can be done by using the underscore character ( _ ) followed by a number (maximum
99). The field width feature also applies to the scalar name (%msX.n%) and description
(%msX.d%) substitutions. Unless adjustment is explicitly specified, numeric registers are
right-adjusted whereas text registers are left adjusted in the specified field width. For example :
%x_10% will be replaced by the value of register x, right-adjusted in a fixed field of 10 characters;
%ms15.n_6% will be replaced by the name of scalar ms15, left adjusted in a fixed field width of
6 characters (instead of dropping the trailing blanks from the name).
• The specifications of the number of digits (using .D ) and of the field width (using _W ) are
independent. For example, both %ry_12.4% and %ry.4_12% will be replaced by the contents of
the floating point register whose number is specified by contents of register y, using a fixed field
width of 12 characters and a precision of 4 digits after the decimal point.
Text substrings are left or right-adjusted from the first non-blank character and padded, if neces-
sary, to the right for left justification or left for right justification. For example, in the following
macro, the matrix description for matrix mf1 is output using different types of text substitutions and
adjustments. Single quotes have been added to show the adjustment of the text within the speci-
fied field widths. The matrix description for mf1 is stored in text register t1. The contents of t1
are then displayed: in full ('%t1%'); in part using the left adjusted substitution %t1_<-4% (note
5-6 2007/02/23
Emme Prompt Manual Macro Language
the padding space to the right); in part using the right-adjusted substitution %t1_>5% (note the
padding space to the left).
Output from above macro. <~/'AM auto demand from survey (vehicles)'
<~/'observed auto demand (vehicles) '
<~/' 1976'
Tests in macros
• There are two conditional commands : ~? condition and ~?! condition. ~? is used to execute the
next line only if condition is true, skipping it otherwise. ~?! is used to execute the next line only
when condition is false (! is the logical negation operator). The condition has the format
reg ⊗ value where ⊗ may be a comparison (>, =, <) or, for integer registers only, a bitwise AND
(&) operator (true if non-zero). For example, the command ~?x>3 appearing in a macro will
cause the next line to be executed only if register x contains a value that is greater than 3.
A condition of the form ~?e will cause the next line to be executed only if an error was detected
while processing the previous input line. This allows an error, which would normally cause the
macro processing to stop immediately, to be trapped and corrected.
• A macro may contain label (~:label ) and branch commands (~$ label and ~$> label ). Note that
label consists of all remaining characters on the line. When a macro branch statement is exe-
cuted, the search for the label is sequential and starts at the beginning of the macro file for the
~$ label command (allowing forward and backward branching), or immediately after the forward
branch command ~$> label (allowing only forward references). If it can be used, a forward branch
(~$>) is more efficient. Label and branch commands are especially useful in combination with the
conditional commands discussed above. For example, the following will cause the macro to
branch to label loop if register x is equal to zero, or to continue otherwise.
2007/02/23 5-7
Macro Language Emme Prompt Manual
A compound macro command (~+) can be used to concatenate several macro lines into one line
in a macro file. The macro lines are separated by a character (X ) which immediately follows the
compound command. Thus a compound macro line has the following format :
where X can be any character and line1 , line2 ,… lineN are each a macro line. The character
used as separator must be chosen such that it does not appear in the macro lines. A label com-
mand (~:) cannot be used in a compound macro line.
Some advantages of using compound macro commands to form macro lines each containing sev-
eral input lines are :
• Dialog input lines that logically belong together can be grouped and long macros become shorter
and more efficient. The following examples show the initialization of a matrix, first with one dialog
response per line, and then using a compound macro statement with the # character as
separator.
• One conditional command can be applied to several dialog input lines and/or macro commands.
A conditional command (~?), which occurs immediately before a compound command, is applied
to the entire compound macro line. If a conditional command appears within a compound macro
line, it is applied to the next part of the compound macro line, that is, to the dialog input line or
macro command which immediately follows the conditional command. If the conditional com-
mand was the last part of a compound macro line, the conditional command is applied to the fol-
lowing line in the macro file.
• Loops that can be coded on a single line are executed more efficiently.
An empty branch statement (~$ without a label) is interpreted as a branch back to the start of the
compound macro line. This allows implementation of very efficient small loops since no backward
branching is required. Regular branch commands (~$) to a specified label can also appear in a
compound macro line. The following macro, which copies g-registers into r-registers, uses an
empty branch statement to loop back to the beginning of the line until all 250 registers have been
copied.
5-8 2007/02/23
Emme Prompt Manual Macro Language
compound line in the macro below is read, %1% is substituted by the specified macro parameter (in
this example, a matrix) resulting in the string %mTX.n%. This string is subject to substitution again
when the ~/ command is executed. If the string fs%%1%.n% was included in a regular command
line (without compound command) only the substitution of %1% would be performed.
The macro below shows two series of text substitutions: one with, and one without a compound
command line. The name and description of a matrix that is specified as a macro parameter are
stored in text registers t1 and t2 by the first series which uses compound command lines, but in
the second series only the macro parameter substitution takes place.
Multilevel substitution:
• with → ~+;~t1=%%1%.n%
~+;~t2=%%1%.d%
~/%t1% %t2%
• without
a compound command.
→ ~t1=%%1%.n%
~t2=%%1%.d%
~/%t1% %t2%
The output below, shows how the nested substitutions are interpreted. The nested substitutions
with compound command lines will print the name and description for matrix mo3, while the sec-
ond series of substitutions (using a regular command line) prints out text strings with mo3 substi-
tuted for %1%.
Nested macros
• Each called macro gets its private set of register values (see Macro registers ) with initial values
inherited from the calling macro. This implies that parameters and state information may be
passed to the called macro through these registers and the global registers (see below). It also
implies that the called macro should explicitly initialize the registers it uses.
• Except for numeric registers gX and text register t9, read/write registers (see page 5-13) are local
variables. Therefore, a called macro can modify these registers with no consequence for the call-
ing macro. Upon return, the calling macro continues with its own set of register values.
• Numeric registers gX and text register t9 are global registers, that is, their values are common to
all levels of macros. These global registers can be used to pass return values to a calling macro.
(Note that the numeric registers gX are initialized to zero whenever a new module is entered.)
• Each macro level can have its own separate file open for reading (see open read file command on
page 5-10). Like numeric and text registers, if a macro calls another macro, the open read file is
inherited by the lower level macro. This means that the lower level macro can actually use ~@
commands and continue to read the file from the position the file was in (in the upper macro) when
the lower macro was called. However, this will not change the file position in the upper level
2007/02/23 5-9
Macro Language Emme Prompt Manual
macro upon return from the lower level. Hence, the state of an open read file is always preserved
when calling lower level macros, regardless of whether these macros open other read files them-
selves, or perform read operations on the open file they inherited.
• Similarly, each macro level can also have its own separate file open for writing (see append to file
command on page 5-10). If a macro calls another macro, the open output file is inherited by the
lower level macro. The lower level macro will continue to write to the open output file from the
position the file was in (in the upper macro) when the lower macro was called. However, this will
not change the file position in the upper level macro upon return from the lower level. Hence the
state of an open output file is always preserved when calling lower level macros, regardless of
whether these macros open other output files themselves, or perform append operations on the
open output file they inherited.
• There is no limit on the number of levels of macro calls. Recursive calls to macros are allowed.
• The open read file command (~<<filename ) specifies the name of a file that is to be read using
the file read command ~@ (see below). The file will remain open until one of the following condi-
tions is met:
• a file read command ~@ fails because the end of file has been reached or because of an I/O
error
• The file read command (~@) reads the next input line from the file previously opened with the
open read file command (~<<). The ~@ command is similar to the terminal read command (~*), in
that it can be used alone when the line is to be interpreted as a dialog answer or macro command
line, or in combination with the set text register commands (see Text registers on page 5-13).
If there are no more input records available, or if an I/O error occurs when attempting to read a
record, an error flag is set. This causes the macro to terminate unless the error register is tested
immediately after an invalid file read command (with ~?e, for example – see Tests in macros on
page 5-7).
• The append to file command (~>>filename ) opens the file filename and appends subsequent
dialog answers and macro command lines to the contents of filename until the next ~> or ~>>
command. If filename does not exist, the ~>> command behaves exactly as the macro save (~>)
command.
This command can be used, in combination with the quoted output command (see below), to gen-
erate any text file, including other macros or trace files for off-line debugging.
• The quoted output command (~") can be used to generate any text file from within a macro. It
has no effect on the macro that is currently running. However, when this command is executed
while a macro save (~>filename ) or a macro append (~>>filename ) command is active, only the
characters following the leading ~" of this command, if any, are transcribed into the output file
record. Note that trailing blanks are ignored.
5-10 2007/02/23
Emme Prompt Manual Macro registers
There are three types of macro registers : read-only numeric registers, read/write numeric (integer
and floating point) and text registers, and the special register p. Text registers have a maximum
length of 128 characters.* The registers are listed in Table 5.3.
Read-only registers
• Register d contains an integer value of the form yymmdd (switch 25 off) or yyyymmdd (switch 25
on), where yy[yy] indicates the year (2 or 4 digits), mm indicates the month (01-12) and dd indi-
cates the day of the month (01-31).
• Register e contains the number of the last error (warning or fatal) which occurred, as described in
Appendix A. It is particularly useful for checking if errors occurred while reading a batch input file,
since such errors will not stop the macro.
• Register f contains an integer which represents the bit pattern corresponding to the current state
of the flags of the current scenario (for description of the bit pattern, see scenario parameter
istats on page C-11). For example, to test if the current scenario contains a valid auto assign-
ment (bit 10 on) and is ready for a transit assignment (bit 6 on), the value of register f should be
compared (bitwise AND) to 1088 (2^6 + 2^10).
f read-only Current state of the flags of the current scenario (bit map).
g0 read-only Value of the bucket rounding residue when using the bint() intrinsic
function (see Section 3.7.2, page 3-57)
g1 … g250 read/write Global floating point registers that can be used to access the
get()/put() stack values or the third dimension balancing
coefficients.
Initialized to zero whenever a new module is entered.
* Since the macro line length is also limited to 128, it is normally not possible to attain this maximum.
2007/02/23 5-11
Macro Language Emme Prompt Manual
q read-only Type of current dialog question (0 : Enter, 1 : yes /no, >1 : Select ,
−1 : bit 6 on).
• Register i contains an integer which represents the bit pattern corresponding to the current state
of all switches (for description of the bit pattern, see global parameter ishort on page C-8).
• Register m contains the current module number as a 3 digit integer. It can be used to test if a
macro is called within the right module and, for example, stop with a message if not. For example,
~?m=000 tests if the current module is 0.00 (main menu).
Register q can be tested to determine the type of question being asked, in order to synchronize
the macro when the dialog may vary, depending on the context (for example, when preparing an
auto assignment on a scenario that may have already been assigned).
• Register v contains the version of the current module. This allows macros to be programmed to
run on different releases/versions of Emme. The version number is stored as R x 100 + L, where
R is the Release number and L is the Level. For example, knowing that the possibility to store the
5-12 2007/02/23
Emme Prompt Manual Macro registers
first waiting times in the transit assignment was introduced in version 4.3 (%v% = 403) of
Module 5.11, one could add the following test after the specification of the total waiting time
matrix :
Read/write registers
The values of read/write registers can be manipulated using ~ reg ⊗ value commands (see
Table 5.1). The current values of these registers are kept from one module to another, except for
the numeric registers gX which are initialized to zero whenever a new module is entered.
• Text registers
Text registers, t1 to t9, can hold up to 124 (128 - length of the assignment command ~t n =) char-
acters of text each. They are set using the ~t n = text command and inserted into a line using the
substitution %t n %. In addition, writable text registers can be compared (lexical collating
sequence) using the conditional commands ~?t n = text, ~?t n >text and ~?t n < text, as well as the
converse form : ~?!. It is also possible to use ~t n =~*, which prompts the user for text that is
stored in the text register for later use, or ~t n =~@, which stores the result of the file read com-
mand (see page 5-10) in the text register, but the text is not passed to Emme as dialog input in
either case.
Text register t0 can also be accessed using the same commands, but it contains the current
macro arguments. Register t0 can be modified, either by using the shift command (see
page 5-4), or by using the assignment command (~?t0= text ), effectively replacing the current
macro arguments. This allows a text item to be separated into its individual fields since the fields
in t0 can be referenced using %1% %2% … %32%. Note that, although not accessible to the user,
the name of the macro is also stored in t0. Therefore, the effective number of characters that t0
can hold is 128 - length of macro name (including the path).
• Numeric registers
Five integer registers, named o, p, x, y or z, and two sets of floating point registers, named r1
to r250, and g1 to g250, can be used to do arithmetic operations. The operations available for
these numeric registers are :
2007/02/23 5-13
Macro Language Emme Prompt Manual
• Division by the specified value. If the specified value is equal to 0, the operation is ignored
and the value of the register is not changed.
Example : ~r2/5 will divide the current value of register r2 by 5.
• Modulo operation (remainder from division). If the specified value is equal to 0, the operation
is ignored and the value of the register is not changed.
Example : ~x%5 will set register x to the current value of x, modulo 5.
• When floating point values are used in a bitwise operation, these values are first converted to
integer before the operation is actually performed, and the floating point register is set to the
value of the resulting integer.
• Each floating point register contains a single precision (32-bit) floating point value, which
– 38
implies that its precision is limited to 6 or 7 digits and the range is approximately 1.17 ×10
38
to 3.40 ×10 (see Computation limitations on page 3-30).
• Floating point registers can be used to hold integer values and to perform arithmetic using
integers. However, when handling large numbers (>4194303), rounding errors might occur.
In this case, it is better to use the generic integer registers x, y and z, which can hold integers
up to 2147483647.
• When using conditional commands on floating point registers, care should be taken in the
equality comparison. Fractional values that are the result of floating point operations are sub-
ject to rounding errors.
• Whenever a floating point value is converted from its binary form to a decimal representation
(or vice versa), rounding errors can occur. This occurs in substitutions and, for rX registers,
when the macro changes modules or calls nested macros, in which case the rX values are
written in the file usemacro as decimal values.
• The use of engineering notation (switch 22 on) can reduce the risk of generating format over-
flows when large floating point values are displayed (or converted to decimal representation).
• Although g-registers can be used to store the results of arithmetic operations, they are mainly
used to access the get/put stack values or the third dimension coefficients.
• G-registers are initialized to zero whenever a new module is entered. If the values are to be
used after exiting the module, they must be copied to registers rX or to an external file (see
Reading/writing to external files on page 5-10). For example :
5-14 2007/02/23
Emme Prompt Manual Macro registers
• Register ‘o’
Register o can be used to control the dialog output (for example, hiding parts of the standard dia-
log in order to generate customized dialog where necessary). Since disabling the dialog also
turns off the standard erasing of the terminal, it is also possible to erase the screen by setting the
o register.
The setting of the o register takes effect immediately and remains until the macro is completed or
until the register is reset (by the macro or automatically). However, it is recommended that bit 0 of
register o only be set at the beginning of a module (Primary select ) or at the main menu level
since, for some sub-dialogs, the effect is delayed until the end of the sub-dialog.
Register o is interpreted as a bit pattern. By default, all bits are off. The action of setting the indi-
vidual bits is described in Table 5.4. The bits marked with a ✓ are automatically reset (set off) as
soon as the desired operation is completed. Bit number n can be set by using the corresponding
decimal value (2^n ) in a macro command, for example ~o|8 sets bit 3.
The option to redirect the dialog output to a temporary scratch file (bit 0 on) together with the func-
tions provided by bits 9 through 12 enable a macro to process a section of dialog output. The out-
put can be read into the global text register t9 by setting bit 11 of the o register.
The o register can also be used to run a macro in a step-by-step mode to facilitate macro debug-
ging (see Single step tracing mode for macro debugging on page 5-18).
6 64 Read extra input line before programmed pauses and before leaving a
module.
11 ✓ 2048 Read the next record from the scratch file into register t9.
13 ✓ 8192 Read plot area and window coordinates and write to text register t9
(see Section 5.1.3)
2007/02/23 5-15
Macro Language Emme Prompt Manual
Register ‘p’
Register p provides read-only access to global and scenario parameters (refer to Appendix C for
the description of these parameters) and to certain system parameters described below. The use
of the p register is slightly different from other numeric registers : p is assigned the address of the
parameter to be accessed (using the standard register commands ~p=N, ~p+N, etc.). When %p%
is used, the value of the specified parameter is substituted (not its address). For example, ~p=51
sets p to 51 but ~z=%p% sets register z to the value of global parameter 51, that is, the maximum
number of scenarios which can be defined in the database. In conditional macro commands
(~?reg ⊗ N ), the integer N is compared to the value of the parameter accessed by p (not the
value of p itself). For example, if p=51, the test ~?p=4 compares the value of global parameter 51
to 4. The addresses and parameters accessible via the p register are listed in Table 5.5.
The following illustrates a macro containing a command escape to remove the reports file. The p
register is set to the address 2004 which contains the type of operating system. It is then possible
for the macro to execute the appropriate “remove” command, depending on the operating system
on which the macro is running :
Address Contents
1-80 Global parameters : for example, database dimensions, report page number,
terminal, report and plot file used. See Global parameters on page C-6.
101-200 External scenario numbers : 0= scenario slot empty (currently not defined),
–1=scenario slot not available in database (slots 101+maximum number of sce-
narios to 200).
1001-1080 Scenario parameters (parameter number + 1000) : for example, assignment
stopping criteria. See Scenario parameters on page C-10.
2005 Cumulative CPU time (in 1/10 secs) since creation of database (or since reset).
2006 Current year (2-digits yy, switch 25 off; 4-digits yyyy, switch 25 on)
5-16 2007/02/23
Emme Prompt Manual Macro registers
Address Contents
2025 No. of invalid error checks detected in current module (internal error)
2007/02/23 5-17
Macro Language Emme Prompt Manual
Address Contents
2120 Internal file for class specific auto volumes available (0=no, 1=yes)
Single step tracing mode (or debug mode) can ease the process of macro debugging by allowing :
• Execution of a macro in a step-by-step mode, prompting the user before each macro line (dis-
played on the terminal) is executed
• Error recovery by falling back to single step tracing mode in case of error or interruption
• Single step tracing mode is activated by setting bit 3 of the o register on. When activated, this
mode takes effect at the level of each macro line echoed on the dialog output with <… (the echo
of a macro line depends on the setting of switch 15, and of bits 1 and 2 of register o). Each macro
line that is subject to debug mode is displayed as usual, followed by the corresponding macro line
number between tildes (or ~Line : character~ for compound macro commands). The user must
enter a carriage return (↵) to process the line.
• At the debug mode prompt ~, it is possible to enter one of the debugging commands described in
Table 5.6. These commands allow the contents of the registers to be displayed and modified.
Setting the value of t0 also implies that the macro parameters %1%, %2%, … are changed.
The :r, :s, and :i commands allow limited editing of the dialog input generated by the macro.
Thus, the macro can continue even after a problem has occurred. The changes do not become
part of the macro. Note that the entire debugging command is subject to macro substitution, that
is, %…% sequences will be substituted as if they appeared in the macro itself.
5-18 2007/02/23
Emme Prompt Manual Generate graphical input sequences from within a macro
• Bit 4 of the o register functions as a “fallback to debug mode” flag. If bit 4 is set, and an error or an
interrupt occurs during macro execution, macro processing continues but single step tracing mode
is entered. This feature can be very useful when updating macros for new releases. To
leave debug mode and return to fallback mode use the continue command (:c).
The o register value is local to each called macro (see Nested macros on page 5-9). Therefore,
the :c command only takes effect within the current macro so that execution can be “continued”
through a called sub-macro but will return to single step tracing mode in the calling macro.
Command Action
reg Display current value of the macro register reg (numeric or text).
r (or r*) Display the current values of all non-zero floating point registers.
g (or g*) Display the current values of all non-zero global numeric registers.
:c Continue macro without single stepping; o register bit 3 is reset and bit 4 (fallback)
is set.
:i text Insert text as an answer before the current line (not valid in compound commands).
:l List context around the current line (the three preceding lines, the current line and
the three following lines). The current line is indicated by the character >.
:lN List N following (N > 0) or preceding (N < 0) lines in macro, including the current
line.
:p Give line numbers and file names of all macros currently active.
To automate graphical input, or GIN, sequences from within a macro, bit 7 of the o register must
be set. When bit 7 is set and the macro comes to a point in a module where it would normally dis-
play the crosshair cursor in a plot or interactive graphic worksheet to wait for a GIN sequence,
then:
2007/02/23 5-19
Macro Language Emme Prompt Manual
• this line is parsed using Emme free format rules for the fields x y char hu, where:
• if the coordinates specified are user coordinates, they are converted to hardware coordinates
• the resulting hardware coordinates and GIN command are returned to the calling module, as
if they would have been entered manually with the crosshair cursor.
• If an error is detected when parsing the line, for example, the contents of the line does not
match the specified format or the coordinates are not within the screen viewport, an error is
generated.
For example, the following macro sequence is used to generate a transcript file in Module 6.15
containing paths from node 4 to all other nodes using GIN sequences. First the path from node 4
to node 118 (X-Y coordinates 633784, 5535117), then all paths from node 4 are sent to the tran-
script file. Note, the module parameter Generate transcript of interactive queries into the batch
output file? must be set to yes to be able to write path information to the specified transcript file.
With the possibility of generating GIN sequences from within macros, it is also possible to obtain
information on the active plot area (or viewport) and the corresponding window. This information
would make it possible to determine the enlargement scale used in a plot, or to determine if a
given point is contained within the current window or not.
To obtain the current plot area and window coordinates from within a macro, bit 13 of
the o register must be set. When this bit is set, the coordinates are returned to text register t9 in
the order shown below, and bit 13 is reset.
5-20 2007/02/23
Emme Prompt Manual Tips on macros
where (xhl, yhl ) and (xhh, yhh) are the hardware coordinates of the lower left and upper right
corners of the current plot area, and (xuh, yuh) and (xuh, yuh) are the user coordinates of the
lower left and upper right corners of the current window. Note that this information should only be
retrieved while the module is in graphic mode.
2007/02/23 5-21
Macro Language Emme Prompt Manual
Macro updates
5-22 2007/02/23
Emme Prompt Manual Supported Macros
The macros distributed in the macros directory of the Emme program environment are part of the
Emme system like any program distributed in the programs directory. INRO supports these
macros in their original form only and is not responsible for any variants.
When an Emme database is created, the database dimensions are specified by the user. The
macro modifydb, located in the macros subdirectory, provides a means for subsequently chang-
ing some of these dimensions.
The dimension to be modified and its associated values are specified as macro parameters : a
keyword which specifies the dimension, followed by values that specify the change. Any increase
must remain within the maximum dimensions allowed by the Emme licence size. These dimen-
sions appear in parenthesis in the dialog when creating a new database (see Module 0.01). Note
that the size of the resultant database is also subject to the usual restrictions on database size
(see Database size on page 2-11). Since modifydb does not test the size of the resultant data-
base, it is possible to create a database which will be unusable.
Since the modify operation will result in a larger database, it is the user’s responsibility to make
sure that enough disk space is available. Also note that the operation of this macro should never
be interrupted, as it might leave the database in an unusable state. ALWAYS MAKE A COM-
PLETE BACKUP OF THE DATABASE BEFORE RUNNING THIS MACRO!!!
modifydb is called in the same way as any other Emme macro (see Calling a macro via the
Emme command on page 2-5, and Saving and recalling macros on page 3-20). Note that this
macro cannot be run on EMME/2 systems, Release 5.2 and earlier. Also, it is recommended
switches 15 and 30 be set to off before running this macro. If switch 15 is on, the macro will gen-
erate voluminous output (standard dialog). If switch 30 is on, the macro will generate a large
number of diagnostic error messages in the errors file.
Once the macro starts to modify the database, a message warns the user not to interrupt the
macro. Some of the changes are time-consuming and the user should always wait for the final
summary message which indicates that the dimension(s) has been changed (see following
examples).
The first macro parameter is a keyword that defines which dimension(s) to modify. A call to mod-
ifydb can contain only one keyword. Available keywords are :
• moreturn : increase maximum number of turn table entries (see page 5-30)
2007/02/23 5-23
Supported Macros Emme Prompt Manual
• morefunc : increase maximum number of functions and/or operators (see page 5-32)
Most options require the user to specify the old and new values for the dimension(s) to be
changed. Note that the new value must be greater than the old value but should not exceed the
maximum allowed by the Emme licence size. The values follow the keyword and are separated by
blanks. (Note that, a value must be specified as a string of digits, without separator; for example,
4000 but not 4,000 or 4 000.) The values denoted as current can be obtained using the dim menu
command.
If an option is called with the keyword only, a short explanatory message, giving more detailed
information regarding the option, is displayed.
Once the modifydb keywords and values have been verified, the user is asked to confirm the
dimension changes.
When increasing the number of nodes, links and segments, the extra attributes for the corre-
sponding elements are added automatically, using the default extra attribute value, for all
scenarios. If the extra attribute table of a scenario is too full to be adjusted, an error message is
generated and the user has to adjust the extra attribute table of this scenario manually (using
Module 2.42). The user may delete unnecessary attributes or increase the size of the extra
attribute table (using the option morextra of modifydb) before doing the adjustment in
Module 2.42. It is essential to perform this adjustment before making any network modification.
5-24 2007/02/23
Emme Prompt Manual Modifydb : modify dimensions of an Emme database
Macro command :
~<modifydb morescen oldscen newscen
Option values :
oldscen : current maximum number of scenarios in database
newscen : new maximum number of scenarios in database
The following example increases the maximum number of scenarios in the database from 3 to 5.
**********************************************************************
Wait for this message → MACRO "MODIFYDB MORESCEN" HAS COMPLETED NORMALLY. THE DATABASE
NOW ALLOWS A MAXIMUM OF 5 SCENARIOS (PREVIOUSLY 3).
**********************************************************************
2007/02/23 5-25
Supported Macros Emme Prompt Manual
Macro command :
~<modifydb morelink oldlink newlink
Option values :
oldlink : current maximum number of links
newlink : new maximum number of links
The following example will increase the maximum number of links from 3000 to 3500.
**********************************************************************
Wait for this message → MACRO MORELINK HAS COMPLETED WITH 0 ERRORS. THE DATABASE
NOW ALLOWS A MAXIMUM OF 3500 LINKS (PREVIOUSLY 3000).
**********************************************************************
5-26 2007/02/23
Emme Prompt Manual Modifydb : modify dimensions of an Emme database
Macro command :
~<modifydb morenode oldnode newnode
Option values :
oldnode : current maximum number of nodes (including centroids)
newnode : new maximum number of nodes (including same number of centroids)
The following example will increase the maximum number of nodes (including centroids) from
1200 to 1500. Note that, both the current and new number of nodes include centroids and only
the maximum number of regular nodes increases.
**********************************************************************
Wait for this message → MACRO MORENODE HAS COMPLETED WITH 0 ERRORS. THE DATABASE
NOW ALLOWS A MAXIMUM OF 1500 NODES (PREVIOUSLY 1200).
**********************************************************************
2007/02/23 5-27
Supported Macros Emme Prompt Manual
Macro command :
~<modifydb morevehs oldvehs newvehs
Option values :
oldvehs : current maximum number of transit vehicles
newvehs : new maximum number of transit vehicles (must not exceed 999)
The following example will increase the maximum number of transit vehicles from 30 to 50.
**********************************************************************
Wait for this message → MACRO MOREVEHS HAS COMPLETED NORMALLY. THE DATABASE NOW
ALLOWS A MAXIMUM OF 50 TRANSIT VEHICLES (PREVIOUSLY 30).
**********************************************************************
Macro command :
~<modifydb moreline oldline newline
Option values :
oldline : current maximum number of transit lines
newline : new maximum number of transit lines
The following example will increase the maximum number of transit lines from 150 to 250.
5-28 2007/02/23
Emme Prompt Manual Modifydb : modify dimensions of an Emme database
**********************************************************************
Wait for this message → MACRO MORELINE HAS COMPLETED WITH 0 ERRORS. THE DATABASE NOW
ALLOWS A MAXIMUM OF 250 TRANSIT LINES (PREVIOUSLY 150).
**********************************************************************
Macro command :
~<modifydb moresegs oldsegs newsegs
Option values :
oldsegs : current maximum number of transit segments
newsegs : new maximum number of transit segments
The following example will increase the maximum number of transit segments from 5000 to 6000.
2007/02/23 5-29
Supported Macros Emme Prompt Manual
**********************************************************************
Wait for this message → MACRO MORESEGS HAS COMPLETED WITH 0 ERRORS. THE DATABASE NOW
ALLOWS A MAXIMUM OF 6000 TRANSIT SEGMENTS (PREVIOUSLY 5000).
**********************************************************************
Macro command :
~<modifydb moreturn oldturn newturn
Option values :
oldturn : current maximum number of turn table entries
newturn : new maximum number of turn table entries
The following example will increase the maximum number of turn table entries from 1000 to 1200.
5-30 2007/02/23
Emme Prompt Manual Modifydb : modify dimensions of an Emme database
**********************************************************************
Wait for this message → MACRO MORETURN HAS COMPLETED NORMALLY. THE DATABASE NOW ALLOWS
A MAXIMUM OF 1200 TURN TABLE ENTRIES (PREVIOUSLY 1000).
**********************************************************************
Macro command :
~<modifydb moremat mattyp oldmat newmat
Option values :
mattyp : matrix type (mf, mo, md or ms)
oldmat : current number of matrices of type typ in database
newmat : new number of matrices of type typ in database
2007/02/23 5-31
Supported Macros Emme Prompt Manual
The following example will increase the maximum number of full matrices in the database from 10
to 12.
**********************************************************************
Wait for this message → MACRO "MODIFYDB MOREMAT" HAS COMPLETED NORMALLY. THE DATABASE
NOW ALLOWS FOR: SCALAR MATRICES: ms1 - ms99
ORIGIN MATRICES: mo1 - mo99
DESTINATION MATRICES: md1 - md99
FULL O-D MATRICES: mf1 - mf12
**********************************************************************
Macro command :
~<modifydb morefunc oldfnc oldop newfnc newop
Option values :
oldfnc : current maximum number of functions per class
oldop : current maximum number of operators per function class
newfnc : new maximum number of functions per class (must not exceed 99)
newop : new maximum number of operators per function class (must not exceed 2000)
The following example will increase the maximum number of functions per class from 50 to 60 and
the maximum number of operators per function class from 500 to 1000.
5-32 2007/02/23
Emme Prompt Manual Modifydb : modify dimensions of an Emme database
**********************************************************************
Wait for this message → MACRO MOREFUNC HAS COMPLETED NORMALLY. THE DATABASE NOW ALLOWS
A MAXIMUM OF 60 FUNCTIONS AND 1000 OPERATORS PER FUNCTION CLASS.
**********************************************************************
Macro command :
~<modifydb addus123
This command adds segment user data items us1 … us3 to a database that was created without
them. The macro ends with the following message :
modifydb:
add segment user data **********************************************************************
Wait for this message → MACRO ADDUS123 HAS COMPLETED NORMALLY. THE DATABASE NOW
CONTAINS USER SEGMENT DATA ITEMS US1, US2 AND US3.
**********************************************************************
Macro command :
~<modifydb addlabel
This command adds 4-character node labels to a database that was created without them. The
labels are initialized to blanks. The macro ends with the following message :
modifydb:
add node labels **********************************************************************
Wait for this message → MACRO ADDLABEL HAS COMPLETED NORMALLY.
THE DATABASE NOW CONTAINS NODE LABELS (INITIALIZED TO ' ').
**********************************************************************
2007/02/23 5-33
Supported Macros Emme Prompt Manual
Macro command :
~<modifydb morextra oldsize newsize
Option values :
oldsize : current size (in words) of extra attribute table
newsize : new size (in words) of extra attribute table
Note that, while in Module 2.42 the maximum size that can be specified is 536870911 words per
scenario, modifydb will accept a maximum value of 536870911* words for the entire database;
that is, the maximum number of words that can be specified per scenario is 536870911/number of
scenarios.
The following example will increase the size of the extra attribute table from 30825 to 32000,
which allows for the definition of 3 attributes of each type for the Winnipeg demonstration data-
base (see Module 2.42, page 4-141).
About to increase the size of the extra attribute table from 30825 to
32000 words per scenario.
This operation will increase the size of the database by 23500 bytes.
Do you really want to proceed?y
`MODIFYDB MOREXTRA 30825 32000' is now running - DO NOT INTERRUPT!!!
1) Adjusting size of internal file 59
2) Shifting records in file 59 to correct position and initializing gaps
3) Redefining record structure of internal file 59
**********************************************************************
Wait for this message → MACRO MOREXTRA HAS COMPLETED NORMALLY. THE DATABASE NOW
HAS AN EXTRA ATTRIBUTE TABLE WITH 32000 WORDS PER SCENARIO.
**********************************************************************
Macro command :
~<modifydb logbook oldsize newsize
* This limit assumes that a database with the 32-bit directory structure (introduced in Release 9) is used. If
using a database which was created with Release 8 or earlier, a more restrictive limit may apply.
5-34 2007/02/23
Emme Prompt Manual Split2layovers: split transit lines with layovers into separate lines
Option values :
oldsize : current size (in words) of log book
newsize : new size (in words) of log book (must not exceed 5000).
When using this option, the contents of the log book are initialized, that is, all existing entries will
be lost. Note that , unlike other options of modifydb, the size of the log book can be increased or
decreased. However, a decrease in the size of the log book does not imply a decrease in the size
of the Emme database, but the space becomes available for further increases.
The following example shows how the macro ends when the size of the log book is decreased
from 1000 to 500 words.
About to change the size of the log book from 1000 to 500. Note that
this operation will initialize the log book so that its current
contents will be lost.
This operation will not actually decrease the size of the database.
The freed up 2000 bytes will only be reused when increasing some database
dimensions later on. (Note that EMXFBANK will report a inconsistent
size error until the freed up space is reused.)
**********************************************************************
Wait for this message → MACRO "MODIFYDB LOGBOOK" HAS COMPLETED NORMALLY. THE LOGBOOK HAS
BEEN INITIALIZED AND ITS SIZE HAS BEEN CHANGED FROM 1000 TO 500.
**********************************************************************
5.2.2 Split2layovers: split transit lines with layovers into separate lines
A transit line itinerary can have a maximum of two layovers: one intermediary layover and one at
the end of the itinerary. However, more useful statistics are available when lines are coded by
direction, that is, with only layover at the end.
The Emme GUI detects when a transit line that is being edited has more than one layover. The
user is recommended to split the itineraries such that each itinerary has only one layover.
2007/02/23 5-35
Supported Macros Emme Prompt Manual
The split2layovers macro, located in the macros subdirectory, can be used to split a transit
line itinerary with two layovers into two, distinct lines. The split2layovers macro is a
user-friendly interface for the SPLIT2LAYOVERS utility (see Section 7.3). At the end of the
line-splitting procedure, the new set of transit lines is stored in a batch input file called
split2layovers.in. The user has the option of replacing the current set of transit lines with
the new set in the current and/or in another scenario using a second macro,
replace2layovers, which is called by the split2layovers macro.
split2layovers is called like any other macro (see Saving and recalling macros on
page 3-20).
~<split2layovers
Change? y
Select: Type of printer
1= ASCII printer 60 lines
2= ASCII printer 80 lines
3= HP Laserjet
3
Current plotfile type is: GPL/GPR plotfile
Change? n
• The user will be asked to specify two single-character suffixes to append to the original transit line
name and to the description for the new, split lines.
• The first suffix is used to denote the first part of the itinerary until the layover; the default suffix
for the first part of the itinerary is a blank.
• The second suffix is used to denote the transit line itinerary after the layover; the default suffix
for the second part of the itinerary is the # character.
Any character may be used, however it is recommended to avoid the following characters, as
they may be special characters for certain operating systems: ^ & * | " < >.
• Lines that do not contain any intermediary layover are preserved in the new set of transit lines.
• Transit line names can have a maximum of six characters. If the name of at least one of the transit
lines in the existing set of transit lines is six characters, the following warning message is dis-
played:
. ### WARNING: Transit lines with 6-character names will be split! ###
Current terminal type is: Emtool
Change? n
.
. The new transit line names must be adjusted before they are replaced!
. Shorten the transit line names in the new transit line file
. "split2layovers.in" and then call the macro "replace2layovers".
.
. Would you like to generate the "split2layovers.in" file anyway (y/n)?
If the user decides to continue, the lines will be split, and the macro will display the line names that
must be shortened at the end of the line-splitting procedure. He can then proceed to edit the new
transit line file split2layovers.in, as specified in the message.
• If the database does not have enough space to store the resulting split transit lines and/or transit
segments, the user is warned that he must change the dimensions of the database before he can
read in the new set of transit lines in split2layovers.in. Once the database has been cor-
rectly dimensioned using the modifydb macro (see examples 2.1.5 and 2.1.6), the user can use
the replace2layovers macro to read in the new set of transit lines.
5-36 2007/02/23
Emme Prompt Manual Split2layovers: split transit lines with layovers into separate lines
. ### WARNING: The new set of transit lines contains 133 lines! ###
. This database currently allows for a maximum of 132 lines.
. Use "modifydb" to increase the maximum number of transit lines.
Database must be .
dimensioned for more transit . Would you like to generate the "split2layovers.in" file anyway (y/n)?n
lines
. ### WARNING: The new set of transit lines contains 4338 segments! ###
. This database currently allows for a maximum of 4337 segments.
. Use "modifydb" to increase the maximum number of transit segments.
Database must be .
dimensioned for more transit . Would you like to generate the "split2layovers.in" file anyway (y/n)?n
segments
• At the end of the line-splitting procedure, if the user decides to update the current and/or another
scenario with the new set of transit lines, the specified scenario must not be protected. If it is the
following error message will be displayed, and the user must specify another scenario number.
Example 2.2.1 Split transit lines with layovers and update current scenario
In the following example, suffixes + and = are used to identify new transit lines. At the end of the
line-splitting procedure, the replace2layovers macro replaces the transit lines in the current
scenario (1500).
2007/02/23 5-37
Supported Macros Emme Prompt Manual
........................................................................
Current terminal type is: Emtool
Change? n
.
. The SPLIT2LAYOVERS macro splits transit lines having two layovers
Example 2.2.1 (continued) . into two distinct transit lines. At the end of the line-splitting
. procedure, the new set of transit lines is stored in
. "split2layovers.in". The macro REPLACE2LAYOVERS is then called to read
. in the new set of transit lines in the current scenario and/or
. in other scenarios.
.
. The name and the description of the new lines are obtained by adding
. the specified suffixes. Any character may be used, however it is
. recommended to avoid the following characters: ^ & * | " < >
.
. Notes:
. (1) Transit lines with no intermediary layover will be preserved.
. (2) This macro does not handle extra attributes.
.
. Suffix for the first transit line (up to first layover)
. Enter one character (Default: "")=+
.
. Suffix for the second transit line (after first layover)
. Enter one character (Default: #)==
.
. Using new line suffixes: + and =
.
. Exporting transit line definitions to file split2layovers.tmp
. Parsing the transit lines...
...splitting transit line 1
...splitting transit line 2
...splitting transit line 3
...splitting transit line 4
...splitting transit line 5
...splitting transit line 6
...splitting transit line 7
...splitting transit line 8
...splitting transit line 9
...splitting transit line 10
...splitting transit line 11
...splitting transit line 12
...splitting transit line 13
...splitting transit line 14
...preserving transit line 15e
...
...splitting transit line 65
...splitting transit line 66
...splitting transit line 67
...Transit line parsing done
split2layovers has completed.
.
. The new set of transit lines is found in the "split2layovers.in" file.
.
. The macro REPLACE2LAYOVERS replaces the existing transit lines in the current
. scenario and/or in other scenarios with the new set of transit lines.
.
. ### ALL EXISTING TRANSIT LINES IN THE MODIFIED SCENARIO(S) WILL BE DELETED!!!
.
. Replace the transit lines in the current scenario (1500)?y
... Transit lines replaced in scenario 1500.
.
. Replace the transit lines in another scenario?n
5-38 2007/02/23
Emme Prompt Manual Emme2notify: send an e-mail when process is finished
.
. Parsing the transit lines...
...splitting transit line 1
...splitting transit line 12
...splitting transit line 123
...splitting transit line 1234
...splitting transit line 12345
...splitting transit line 123456
...preserving transit line 1way
...splitting transit line A
...splitting transit line AB
...splitting transit line ABC
...splitting transit line ABCD
...splitting transit line ABCDE
...splitting transit line ABCDEF
...preserving transit line oneway
...Transit line parsing done
Warning: The following lines have ids that may not be unique in Emme since they
are longer than 6 characters:
... [’123456#’, ’ABCDEF#’]
split2layovers has completed.
.
. The new set of transit lines is found in the "split2layovers.in" file.
Enter: Next module=
The emme2notify macro, located in the macros subdirectory, can be used to send the user an
e-mail notifying himself when a process, such as an assignment has completed.
The emme2notify macro is called like any other macro (see Saving and recalling macros on
page 3-20) with the following parameters:
~<emme2notify [--version|-h] -f -t -s -m
Change? y
Select: Type of printer
1= ASCII printer 60 lines
2= ASCII printer 80 lines
3= HP Laserjet
3
Current plotfile type is: GPL/GPR plotfile
Change? n
The emme2notify macro passes the parameters to the EMME2NOTIFY utility (see Section 7.4).
For a description of the parameters, see Table 7.5.
Note: When the subject and the message contain at least one space, they must be enclosed in
quotes: under Windows systems double quotes (") must be used; under Linux systems, single (')
or double (").
2007/02/23 5-39
Supported Macros Emme Prompt Manual
The emme2shp macro, located in the macros subdirectory, can be used to convert an Emme net-
work into a shape file and associated DBF files for the standard and extra network attributes.
The emme2shp macro is called like any other macro (see Saving and recalling macros on
page 3-20) with an optional parameter output_folder.
~<emme2shp [output_folder]
Current terminal type is: Emtool
Change? n
• If no output folder is specified, the output files will be put in the emme2shp-scenario_number
folder where scenario_number is the ID of the current scenario.
If there are any existing files in the specified output folder, the files are overwritten.
• There is a limit on the number of extra attributes that can be exported to DBF files: a maximum of
57 extra attributes per element type can be exported to corresponding DBF files.
• The emme2shp macro uses temporary files net.out, transit.out, extraI.out and
extraL.out to hold the Emme network attributes. These files are stored in the Database direc-
tory of the current project. Any existing files with the same name will be overwritten at the end
5-40 2007/02/23
Emme Prompt Manual Emme2shp: create shape file from Emme network
Example 2.4.1 In the following example, the emme2shp macro is used to create a shape file of the network in the
base scenario, scenario 1000, of the demonstration database. The output is sent to the
winnipeg folder.
Scen. 1000(DME AA): Winnipeg Road and Transit Network - Base Scenario
Enter: Next module=~<emme2shp winnipeg
Exporting node and link standard attributes in file net.out
Exporting extra attributes to file extraI.out
Enter: Next module=
Exporting extra attributes to file extraL.out
Enter: Next module=A subdirectory or file winnipeg already exists.
Parsing ’t nodes’ section...
Parsing ’t links’ section...
Preparing .dbf files...
Writing emme nodes...[0%.....|50%|....100%]
Writing emme links...[0%.....|50%|....100%]
...Base network parsing done
Created 1057 nodes and 2975 links.
Node shapefiles generated at winnipeg
Link shapefiles generated at winnipeg
Writing emme transit lines... 1a . 1b . 2a . 2b . 3a . 3b . 4a . 4b
. 5a . 5b . 6a . 6b . 7a . 7b . 8a . 8b . 9a . 9b .10a .10b
.11a .11b .12a .12b .13a .13b .14a .14b .15ae .16a .16b .17a
.17b .18a .18b .19a .19b .20a .20b .21a .21b .22a .22b .23a
.23b .24a .24b .25a .25b .26a .26b .27ae .27be .
28a .28b .29a .29b .30a .30b .31a .31b .32a .32b .33a .33b
.34a .34b .35ae .35be .36a .36b .37a .37b .38ae .38be .39a .39b
.40a .40b .41a .41b .42a .42b .43a .43b .44a .44b .45ae .45be
.46a .46b .47a .47b .48ae .48be .49ae .49be .50ae .50be .51ae .51be
.52a .52b .53a .53b .54a .54b .55a .55b .56ae .5
6be .57a .57b .58a .58b .59ae .59be .60a .60b .61a .61b .62a
.62b .63a .63b .64a .64b .65a .65b .66a .66b .67a .67b .
...Transit line parsing done
Transit shapefiles generated at winnipeg
emme2shp has completed.
2007/02/23 5-41