Hi, you should write macro with following headnig:
[COLOR="Navy"] MONIT $* enter to
DEV TTY $* bath mode
USERNAME SYSTEM/XXXXXX $* username and password
/SAMPLE $* mdb
...
your commands
...[/COLOR]
and run it from command line.
Details in Monitor Reference Manual.