home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / db22re.zip / STARTUP.CMD < prev   
OS/2 REXX Batch file  |  1993-03-09  |  2KB  |  75 lines

  1. /*
  2.  ┌──────────────────────────────────────────────────────────────────┐
  3.  │  Name       : startup.cmd                                        │
  4.  │  Purpose    : boot time startup functions                        │
  5.  │  Platform   : DB2/2                                              │
  6.  │  Author     : Jeff Fisher                                        │
  7.  │               IBM Toronto Development Lab                        │
  8.  │  Disclaimer : This "sample" code is for demonstrations only, no  │
  9.  │               warrenties are made or implied as to correct       │
  10.  │               function. You should carefully test this code in   │
  11.  │               your own environment before using it.              │
  12.  │                                                                  │
  13.  └──────────────────────────────────────────────────────────────────┘
  14. */
  15.  
  16.  
  17. BeginProg:
  18.     call SetColor
  19.  
  20.     address cmd '@ECHO OFF'
  21.     if RC \= 0 then signal ErrorRC
  22.  
  23.     say
  24.     header1 = 'STARTUP Processing'
  25.     say c.yellow center(header1, 60, ' ')
  26.     say c.normal
  27.  
  28.     say 'Register REXX SQL functions'
  29.     rc = RxFuncAdd('SQLDBS' , 'SQLAR' , 'SQLDBS')
  30.     if RC \= 0 then signal ErrorRC
  31.     rc = RxFuncAdd('SQLEXEC', 'SQLAR', 'SQLEXEC')
  32.     if RC \= 0 then signal ErrorRC
  33.  
  34.     say 'Start Database Manager'
  35.     address cmd 'STARTDBM'
  36.     if RC \= 0 then signal ErrorRC
  37.  
  38.     say 'Local Logon'
  39.     address cmd 'LOGON USERID /P=PASSWORD /L'
  40.     if RC \= 0 then signal ErrorRC
  41.  
  42.     say
  43.     say c.magenta '>>> STARTUP command complete <<<'
  44.     say c.normal
  45.  
  46.  
  47. EndProg:
  48.     address cmd 'EXIT'
  49.  
  50.  
  51. ErrorRC:
  52.     say c.red
  53.     call beep 220,500
  54.     say
  55.     say '        >>>  OS/2 has returned a fatal condition code'
  56.     say '             RC            = ' RC
  57.     say
  58.     pause
  59.     signal EndProg
  60.  
  61.  
  62. SetColor:
  63.     ansii.esc = '1B'x
  64.     c.normal       = ansii.esc || '[0m'
  65.     c.highlite     = ansii.esc || '[1m'
  66.     c.blackback    = ansii.esc || '[40m'
  67.     c.red          = c.normal || ansii.esc || '[31m'
  68.     c.grey         = c.normal || ansii.esc || '[37m'
  69.     c.blue         = c.normal || ansii.esc || '[34m'
  70.     c.magenta      = c.normal || ansii.esc || '[35m'
  71.     c.yellow       = c.highlite || ansii.esc || '[33m'
  72.     c.reset        = c.normal || c.grey || c.blackback
  73.  
  74.     return
  75.