home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / UNPROT.CMD < prev    next >
OS/2 REXX Batch file  |  1992-01-21  |  52KB  |  1,222 lines

  1. /******************************************************************
  2. *  MODULE NAME:      UNPROT                                       *
  3. *                                                                 *
  4. *  DESCRIPTIVE NAME: Remove the Database Copy Protection          *
  5. *                                                                 *
  6. *  LPP NAME:         Standalone Tool                              *
  7. *                                                                 *
  8. *  DESCRIPTION: This routine provides a mechanism for removing    *
  9. *               copy protection in a database.  This tool can be  *
  10. *               used to remove the copy protection when the       *
  11. *               database is no longer usable because of the copy  *
  12. *               protection.  Once the copy protection is removed, *
  13. *               this program recalculates the CheckSum value      *
  14. *               and stores it in the first four bytes of the      *
  15. *               database configuration file.                      *
  16. *                                                                 *
  17. *  DEPENDENCIES:                                                  *
  18. *    SYSTEM CONFIRUATION:                                         *
  19. *      - OS/2 EE 1.2+                                             *
  20. *                                                                 *
  21. *    LANGUAGE INTERPRETER:                                        *
  22. *      - OS/2 Rexx Interpreter                                    *
  23. *                                                                 *
  24. *    PREREQUISTIES: None                                          *
  25. *                                                                 *
  26. *                                                                 *
  27. *  RESTRICTIONS: None                                             *
  28. *                                                                 *
  29. *  INPUT:  Database name                                          *
  30. *                                                                 *
  31. *                                                                 *
  32. *  OUTPUT: Copy Protection removed from database configuration.   *
  33. *                                                                 *
  34. *                                                                 *
  35. *  HOST LANGUAGE: OS/2 Rexx                                       *
  36. *                                                                 *
  37. *  LAST CHANGE DATE: 04/01/91                                     *
  38. *                                                                 *
  39. ******************************************************************/
  40.  
  41. parse upper arg  dbname rptname
  42.  
  43.  
  44. '@echo off'
  45.  
  46. TRACE OFF
  47.  
  48. numeric digits 15            /* Set precision for arithmetic operations */
  49. dbpath = ''                  /* Initialize database path specification  */
  50. cr_lf = d2c(13) || d2c(10)   /* Line End characters                     */
  51. report_open = 'NO'           /* Initialize Report Open Indicator        */
  52. was_protected = 'NO'         /* Initial state of the Copy Protect Bit   */
  53.  
  54.  
  55. /*********************************************
  56.    Check the Program Input Arguments
  57. *********************************************/
  58. if dbname = '?' then
  59.   do
  60.     call general_help
  61.     signal xit
  62.   end
  63.  
  64. else   /* No Help requested, so check the input parameters */
  65.   call chkargs
  66.  
  67.  
  68. 'cls'
  69. say '     '
  70. say ,
  71.     " ╔══════════════════════════════════════════════════════════════════════╗ "
  72. say ,
  73.     " ║    **  NOTICE  **  NOTICE  **  NOTICE  **  NOTICE  **  NOTICE  **    ║ "
  74. say ,
  75.     " ║                                                                      ║ "
  76. say ,
  77.     " ║        COPY PROTECTION WILL BE REMOVED FROM THE DATABASE!!           ║ "
  78. say ,
  79.     " ║                                                                      ║ "
  80. say ,
  81.     " ║        Would you like to remove Copy Protection now? (y/n)           ║ "
  82. say ,
  83.     " ║           If so, type 'y' and press ENTER;                           ║ "
  84. say ,
  85.     " ║           Otherwise, type 'n' and press ENTER.                       ║ "
  86. say ,
  87.     " ╚══════════════════════════════════════════════════════════════════════╝ "
  88. say "      "
  89. say "      "
  90. pull unprot_decision
  91.  
  92. if unprot_decision = 'Y' then
  93.   do
  94.  
  95.  
  96.     /*********************************************
  97.        Determine the Database Subdirectory
  98.     *********************************************/
  99.     say '....Scanning the Database Directory'
  100.     call getddir
  101.     if dbpath = '' then
  102.       call errxit 'The database was not found on the file system.'
  103.  
  104.  
  105.     /*********************************************
  106.        Construct the Database Configuration File
  107.     *********************************************/
  108.     dbcon_name = dbpath || 'SQLDBCON'
  109.  
  110.  
  111.     /*********************************************
  112.        Check Existence of Configuration File
  113.     *********************************************/
  114.     rc = stream(dbcon_name, 'c', 'query exist')
  115.  
  116.     if rc = '' then
  117.       do
  118.         call errxit  'The Database Configuration File could not be found.'
  119.       end
  120.  
  121.  
  122.     /*********************************************
  123.        Open the Report File if specified
  124.     *********************************************/
  125.     if rptname \= '' then
  126.       do
  127.         rc = stream(rptname, 'c', 'open')
  128.  
  129.         if (rc \= 'READY:') & (rc \= 'READY') then
  130.           do
  131.             call errxit  'The Report File could not be opened.'
  132.           end
  133.  
  134.         report_open = 'YES'        /* Report is now Open Indicator */
  135.  
  136.         /*********************************************
  137.            Set the Write Cursor to Append to the Report File
  138.         *********************************************/
  139.         /* Locate the last byte in the file */
  140.         eofpos = stream(rptname, 'c', 'query size')
  141.  
  142.         /* Make sure the file is not empty before reading
  143.                the last byte */
  144.         if eofpos > 0 then
  145.           do
  146.  
  147.             /* Position the Write Cursor on the last byte
  148.                  of the file if it is an EOF control;
  149.                  otherwise leave the Write Cursor positioned
  150.                  after the last byte */
  151.             if charin(rptname, eofpos, 1) = x2c('1A') then
  152.               r = stream(rptname, 'c', 'seek -1')
  153.  
  154.           end
  155.  
  156.         /*********************************************
  157.            Write the Report File Header
  158.         *********************************************/
  159.  
  160.         call rpthdr
  161.  
  162.       end
  163.  
  164.  
  165.     /*********************************************
  166.        Open the Database Configuration File
  167.     *********************************************/
  168.     rc = stream(dbcon_name, 'c', 'open')
  169.  
  170.     if (rc \= 'READY:') & (rc \= 'READY') then
  171.       do
  172.         call errxit  'The Database Configuration File could not be opened.'
  173.       end
  174.  
  175.  
  176.     /*********************************************
  177.        Turn off the Copy Protection
  178.     *********************************************/
  179.     call turnoff
  180.  
  181.  
  182.     /*********************************************
  183.        Close the Database Configuration File
  184.     *********************************************/
  185.     rc = stream(dbcon_name, 'c', 'close')
  186.  
  187.  
  188.  
  189.     /*********************************************
  190.        Successful Program Completion
  191.     *********************************************/
  192.     if was_protected = 'NO' then
  193.       do
  194.         say '     '
  195.         say 'Database was not Copy Protected.'
  196.       end
  197.     else
  198.       do
  199.         say '     '
  200.         say 'Database Copy Protection turned off.'
  201.       end
  202.  
  203.     signal finish
  204.  
  205.  
  206.   end
  207.  
  208. else  /* User chose not to turn off Copy Protection */
  209.  
  210.   say 'Program terminated by user  --  Copy Protection not turned off.'
  211.  
  212.  
  213.  
  214. /*********************************************
  215.             PROGRAM  EXITS
  216. *********************************************/
  217.  
  218.  
  219.  
  220. /*********************************************
  221.    Final Program Clean-Up
  222. *********************************************/
  223. finish:
  224.  
  225.   /*********************************************
  226.      Close the Report File if specified
  227.   *********************************************/
  228.   if report_open = 'YES' then
  229.     rc = stream(rptname, 'c', 'close')
  230.  
  231. xit:
  232.  
  233.   /* Exit the program */
  234.   exit
  235.  
  236.  
  237.  
  238. /*********************************************
  239.    UNPROT Error Exit
  240. *********************************************/
  241. errxit:
  242.  
  243.   parse arg msg_text
  244.  
  245.   /* Display the Error Message */
  246.   say '     '
  247.   say msg_text
  248.  
  249.   /* Complete the Tool Cleanup */
  250.   signal finish
  251.  
  252.  
  253.   return
  254.  
  255.  
  256.  
  257. /*********************************************
  258.    SQL (Database Manager) Error Exit
  259. *********************************************/
  260. sqlxit:
  261.  
  262.   /* Get the formatted SQL message */
  263.   call SQLDBS 'GET MESSAGE INTO :sql_msg LINEWIDTH 70'
  264.   if result = 0 then
  265.     do
  266.       /* Formatting successful - Display formatted message */
  267.       say '     '
  268.       say sql_msg
  269.     end
  270.   else
  271.     do
  272.       /* Formatting unsuccessful - Display unformatted message */
  273.       say '     '
  274.       say SQLMSG
  275.     end
  276.  
  277.  
  278.   /* Complete the Tool Cleanup */
  279.   signal finish
  280.  
  281.  
  282.   return
  283.  
  284.  
  285. /*********************************************
  286.               SUBROUTINES
  287. *********************************************/
  288.  
  289.  
  290.  
  291. /******************************************************************
  292. *  SUBROUTINE:   CHKARGS                                          *
  293. *                                                                 *
  294. *  DESCRIPTIVE NAME: Check the Program Input Arguments            *
  295. *                                                                 *
  296. *  DESCRIPTION: This routine checks the validity of the input     *
  297. *               arguments for the program.  If any arguments      *
  298. *               are not specified, then the user is prompted to   *
  299. *               type the required argument.                       *
  300. *                                                                 *
  301. *  INPUT: none                                                    *
  302. *                                                                 *
  303. *                                                                 *
  304. *  OUTPUT: none                                                   *
  305. *                                                                 *
  306. ******************************************************************/
  307.  
  308. chkargs:
  309.  
  310. if dbname = '' then      /* Prompt for the Database name if not input */
  311.   do
  312.     'cls'
  313.     say "     "
  314.     say ,
  315.     " ╔══════════════════════════════════════════════════════════════════════╗ "
  316.     say ,
  317.     " ║                                                                      ║ "
  318.     say ,
  319.     " ║  Please type the input Database Name and press ENTER:                ║ "
  320.     say ,
  321.     " ║                                                                      ║ "
  322.     say ,
  323.     " ╚══════════════════════════════════════════════════════════════════════╝ "
  324.     say "      "
  325.     say "      "
  326.     pull dbname
  327.   end
  328.  
  329.  
  330.  
  331.  
  332. return
  333.  
  334.  
  335.  
  336.  
  337. /******************************************************************
  338. *  SUBROUTINE:   GETDDIR                                          *
  339. *                                                                 *
  340. *  DESCRIPTIVE NAME: Get the Database Directory                   *
  341. *                                                                 *
  342. *  DESCRIPTION: This routine scans the System Database Directory  *
  343. *               to determine the Drive containing the specified   *
  344. *               database.  If it finds the database on a local    *
  345. *               volume, then it calls another routine to          *
  346. *               scan the Volume Database Directory to determine   *
  347. *               the subdirectory containing the database.         *
  348. *                                                                 *
  349. *                                                                 *
  350. *  INPUT: none                                                    *
  351. *                                                                 *
  352. *                                                                 *
  353. *  OUTPUT: none                                                   *
  354. *                                                                 *
  355. ******************************************************************/
  356.  
  357. getddir:
  358.  
  359. /*********************************************
  360.    Register SQLDBS with REXX
  361. *********************************************/
  362. /* Check if SQLDBS function is currently registered */
  363. if Rxfuncquery('SQLDBS') \= 0 then
  364.    do
  365.      /* Register SQLDBS function */
  366.      rcy = Rxfuncadd('SQLDBS','SQLAR','SQLDBS')
  367.  
  368.      if rcy \= 0 then
  369.         call errxit 'Database Manager registration error'
  370.    end  /* end if */
  371.  
  372. /*********************************************
  373.    Register SQLEXEC with REXX
  374. *********************************************/
  375. /* Check if SQLEXEC function is currently registered */
  376. if Rxfuncquery('SQLEXEC') \= 0 then
  377.    do
  378.      /* Register SQLEXEC function */
  379.      rcy = Rxfuncadd('SQLEXEC','SQLAR','SQLEXEC')
  380.  
  381.      if rcy \= 0 then
  382.         call errxit 'Database Manager registration error'
  383.    end  /* end if */
  384.  
  385.  
  386. /*********************************************
  387.    Scan System Directory for Database Name
  388. *********************************************/
  389. call SQLDBS 'open database directory on 0 using :dhandle'
  390. if sqlca.sqlcode < 0 then
  391.   signal sqlxit
  392.  
  393. do while sqlca.sqlcode = 0
  394.    call SQLDBS 'get database directory entry :dhandle.1'
  395.    if sqlca.sqlcode = 0 then
  396.      do
  397.        if SQLDINFO.1 = dbname then
  398.          do
  399.            db_drive = SQLDINFO.3
  400.            dbname = strip(dbname)
  401.            call scanvol
  402.            leave
  403.          end
  404.      end
  405. end
  406.  
  407. call SQLDBS 'close database directory :dhandle.1'
  408.  
  409. return
  410.  
  411.  
  412.  
  413.  
  414. /******************************************************************
  415. *  SUBROUTINE:   SCANVOL                                          *
  416. *                                                                 *
  417. *  DESCRIPTIVE NAME: Scan the Volume Database Directory           *
  418. *                                                                 *
  419. *  DESCRIPTION: This routine scans the Volume Database Directory  *
  420. *               to determine the Subdirectory containing the      *
  421. *               specified database.                               *
  422. *                                                                 *
  423. *                                                                 *
  424. *  INPUT: none                                                    *
  425. *                                                                 *
  426. *                                                                 *
  427. *  OUTPUT: none                                                   *
  428. *                                                                 *
  429. ******************************************************************/
  430.  
  431. scanvol:
  432.  
  433. /* Scan volume directory for name */
  434.  
  435. dbpath = ''
  436.  
  437. call SQLDBS 'open database directory on 'left(db_drive,1)' using :vhandle'
  438. if sqlca.sqlcode = 0 then
  439.  do
  440.  
  441.    do forever
  442.      call SQLDBS 'get database directory entry :vhandle.1'
  443.      if SQLCA.SQLCODE = 1014 then
  444.       do
  445.         say 'No entry found in volume directory for drive 'db_drive'...'
  446.         leave
  447.       end
  448.      if SQLDINFO.1 = dbname then
  449.       do
  450.         dbdir = SQLDINFO.4
  451.         leave
  452.       end
  453.    end
  454.  
  455.    call SQLDBS 'close database directory :vhandle.1'
  456.  
  457.    dbpath = db_drive'\'dbdir'\'
  458.  end
  459.  
  460. return
  461.  
  462.  
  463.  
  464. /******************************************************************
  465. *  SUBROUTINE:   RPTHDR                                           *
  466. *                                                                 *
  467. *  DESCRIPTIVE NAME: Write the Report File Header                 *
  468. *                                                                 *
  469. *  DESCRIPTION: This routine writes the information that appears  *
  470. *               at the beginning of the Report for a given        *
  471. *               execution of UNPROT.                              *
  472. *                                                                 *
  473. *               Note: The Report File must already be opened.     *
  474. *                                                                 *
  475. *  INPUT: none                                                    *
  476. *                                                                 *
  477. *                                                                 *
  478. *  OUTPUT: none                                                   *
  479. *                                                                 *
  480. ******************************************************************/
  481.  
  482. rpthdr:
  483.  
  484.   /* Define Various text lines for the Report */
  485.   eqlines = '==================================================' || ,
  486.             '============================'
  487.   ttline = '           UNPROT (V2.0)  Report   -   ' || date('N') || '   ' || ,
  488.                                                         time('C')
  489.   dbline  = '                 Database:  ' || dbname
  490.   dbpline = '            Database Path:  ' || dbpath
  491.   seplines = '--------------------------------------------------' || ,
  492.              '----------------------------'
  493.  
  494.   /* Construct the Report Header text */
  495.   rpthdr_text = '     '  || cr_lf || ,
  496.                 '     '  || cr_lf || ,
  497.                 eqlines  || cr_lf || ,
  498.                 eqlines  || cr_lf || ,
  499.                 eqlines  || cr_lf || ,
  500.                 eqlines  || cr_lf || ,
  501.                 '     '  || cr_lf || ,
  502.                 '     '  || cr_lf || ,
  503.                 ttline   || cr_lf || ,
  504.                 '     '  || cr_lf || ,
  505.                 '     '  || cr_lf || ,
  506.                 dbline   || cr_lf || ,
  507.                 '     '  || cr_lf || ,
  508.                 '     '  || cr_lf || ,
  509.                 dbpline  || cr_lf || ,
  510.                 '     '  || cr_lf || ,
  511.                 '     '  || cr_lf || ,
  512.                 seplines || cr_lf || ,
  513.                 seplines || cr_lf || ,
  514.                 '     '  || cr_lf || ,
  515.                 '     '  || cr_lf
  516.  
  517.  
  518.   /* Write the Report Header to the Report File */
  519.   call wrt2rpt  rpthdr_text
  520.  
  521.  
  522. return
  523.  
  524.  
  525.  
  526. /******************************************************************
  527. *  SUBROUTINE:   WRT2RPT                                          *
  528. *                                                                 *
  529. *  DESCRIPTIVE NAME: Write to the Report File                     *
  530. *                                                                 *
  531. *  DESCRIPTION: This routine provides a common routine for        *
  532. *               writing information to the Report File.  This     *
  533. *               routine checks to verify that the Report File     *
  534. *               was specified as input to the tool and was        *
  535. *               subsequently opened before writing the data.      *
  536. *                                                                 *
  537. *  INPUT:  Text to be written to the Report File                  *
  538. *                                                                 *
  539. *                                                                 *
  540. *  OUTPUT: none                                                   *
  541. *                                                                 *
  542. ******************************************************************/
  543.  
  544. wrt2rpt:
  545.  
  546.   parse arg report_text
  547.  
  548.   if report_open = 'YES' then
  549.     do
  550.       rc = lineout(rptname, report_text)
  551.     end
  552.  
  553.  
  554. return
  555.  
  556.  
  557.  
  558. /******************************************************************
  559. *  SUBROUTINE:   TURNOFF                                          *
  560. *                                                                 *
  561. *  DESCRIPTIVE NAME: Turn Off the Copy Protection Flag            *
  562. *                                                                 *
  563. *  DESCRIPTION: This routine gets the data from the Database      *
  564. *                Configuration File, resets the Copy Protect      *
  565. *                Flag, and re-calculates the CheckSum value.      *
  566. *                                                                 *
  567. *                                                                 *
  568. *  INPUT: none                                                    *
  569. *                                                                 *
  570. *                                                                 *
  571. *  OUTPUT: none                                                   *
  572. *                                                                 *
  573. ******************************************************************/
  574.  
  575. turnoff:
  576.  
  577. say '....Reading the Database Configuration'
  578.  
  579. /*********************************************
  580.    Define Offsets to Fields in the Database
  581.            Configuration File
  582. *********************************************/
  583. call defoff_dbcon
  584.  
  585. /*********************************************
  586.    Get Data in the Database Configuration File
  587. *********************************************/
  588. call getdata_dbcon
  589.  
  590. /*********************************************
  591.    Turn off Copy Protection
  592. *********************************************/
  593. call unpro
  594.  
  595.  
  596. return
  597.  
  598.  
  599. /******************************************************************
  600. *  SUBROUTINE:   DEFOFF_DBCON                                     *
  601. *                                                                 *
  602. *  DESCRIPTIVE NAME: Define Offsets to Fields in Database Config  *
  603. *                                                                 *
  604. *  DESCRIPTION: This routine defines the offsets for the fields   *
  605. *               in the Database Configuration File.               *
  606. *                                                                 *
  607. *  INPUT: none                                                    *
  608. *                                                                 *
  609. *                                                                 *
  610. *  OUTPUT: none                                                   *
  611. *                                                                 *
  612. ******************************************************************/
  613.  
  614. defoff_dbcon:
  615.  
  616. /*********************************************
  617.    Define Page Offset Constants
  618.       (Note: These offsets are 1-origin from the Start of the Page)
  619.       (Note: The length values are in terms of character bytes.)
  620. *********************************************/
  621. dbcon  =  1            /* Offset to the Database Configuration */
  622.  
  623. /*********************************************
  624.    Define Offsets within the Database Configuration Description
  625.       (Note: These offsets are 0-origin from the Start of the
  626.                     Database Configuration File.)
  627. *********************************************/
  628. dbc_chksumo =  0               /* Checksum field offset                      */
  629. dbc_chksuml =  4               /*                length                      */
  630.  
  631. dbc_titleo =  4                /* Title field offset                         */
  632. dbc_titlel =  12               /*             length                         */
  633.  
  634. dbc_relo  =  16                /* Release field offset                       */
  635. dbc_rell  =  2                 /*               length                       */
  636.  
  637. dbc_pad1o =  18                /* Pad for Long Boundary field offset         */
  638. dbc_pad1l =  2                 /*                             length         */
  639.  
  640. dbc_logsizo =  20              /* Log File Size (4K Pages) field offset      */
  641. dbc_logsizl =  4               /*                                length      */
  642.  
  643. dbc_logexto =  24              /* Log File Extent Size field offset          */
  644. dbc_logextl =  4               /*                            length          */
  645.  
  646. dbc_maxexto =  28              /* Max Extents field offset                   */
  647. dbc_maxextl =  4               /*                   length                   */
  648.  
  649. dbc_dlchko =  32               /* Deadlock Check Interval field offset       */
  650. dbc_dlchkl =  4                /*                               length       */
  651.  
  652. dbc_mseedo =  36               /* Database Seed (masked) field offset        */
  653. dbc_mseedl =  4                /*                              length        */
  654.  
  655. dbc_pad2o =  40                /* Pad field offset                           */
  656. dbc_pad2l =  4                 /*           length                           */
  657.  
  658. dbc_unseedo =  44              /* Unmasked Database Seed field offset        */
  659. dbc_unseedl =  4               /*                              length        */
  660.  
  661. dbc_stmpo =  48                /* Timestamp field offset                     */
  662. dbc_stmpl =  10                /*                 length                     */
  663.  
  664. dbc_lcklsto =  58              /* Maximum Storage for LockList offset        */
  665. dbc_lcklstl =  2               /*                              length        */
  666.  
  667. dbc_buffo =  60                /* Size of buffer pool offset                 */
  668. dbc_buffl =  2                 /*                     length                 */
  669.  
  670. dbc_maxfilo =  62              /* Max Db Files Open per appl offset          */
  671. dbc_maxfill =  2               /*                            length          */
  672.  
  673. dbc_softo =  64                /* No. records before Soft Chkpt offset       */
  674. dbc_softl =  2                 /*                               length       */
  675.  
  676. dbc_maxappo =  66              /* Max active applications offset             */
  677. dbc_maxappl =  2               /*                         length             */
  678.  
  679. dbc_apheapo =  68              /* Application Heap Size offset               */
  680. dbc_apheapl =  2               /*                       length               */
  681.  
  682. dbc_dbheapo =  70              /* Database Heap Size offset                  */
  683. dbc_dbheapl =  2               /*                    length                  */
  684.  
  685. dbc_cntryo =  72               /* Country Code of Application offset         */
  686. dbc_cntryl =  2                /*                             length         */
  687.  
  688. dbc_cpago =  74                /* Code Page of Application offset            */
  689. dbc_cpagl =  2                 /*                          length            */
  690.  
  691. dbc_agheapo =  76              /* Application Agent Heap Size offset         */
  692. dbc_agheapl =  2               /*                             length         */
  693.  
  694. dbc_maxtoto =  78              /* Max Total Files Open offset                */
  695. dbc_maxtotl =  2               /*                      length                */
  696.  
  697. dbc_slheapo =  80              /* Sort List Heap Size offset                 */
  698. dbc_slheapl =  2               /*                     length                 */
  699.  
  700. dbc_rdso  =  82                /* RDS Version Indicator offset               */
  701. dbc_rdsl  =  2                 /*                       length               */
  702.  
  703. dbc_pctlckso =  84             /* % of Total LockList per appl offset        */
  704. dbc_pctlcksl =  2              /*                              length        */
  705.  
  706. dbc_stheapo =  86              /* Statement Heap Size offset                 */
  707. dbc_stheapl =  2               /*                     length                 */
  708.  
  709. dbc_plogo =  88                /* Number of Primary Log Files offset         */
  710. dbc_plogl =  2                 /*                             length         */
  711.  
  712. dbc_slogo =  90                /* Number of Secondary Log Files offset       */
  713. dbc_slogl =  2                 /*                               length       */
  714.  
  715. dbc_lfsizo =  92               /* Log File Size offset                       */
  716. dbc_lfsizl =  2                /*               length                       */
  717.  
  718. dbc_logpatho =  94             /* Log File Path offset                       */
  719. dbc_logpathl =  248            /*               length                       */
  720.  
  721. dbc_newpatho =  342            /* Path to the Log File offset                */
  722. dbc_newpathl =  248            /*                      length                */
  723.  
  724. dbc_inflgo =  590              /* Internal Indicator/Status Flag offset      */
  725. dbc_inflgl =  2                /*                                length      */
  726.  
  727. dbc_exflgo =  592              /* External Indicator/Status Flag offset      */
  728. dbc_exflgl =  2                /*                                length      */
  729.  
  730. dbc_collseqo = 594             /* User-defined collating sequence offset     */
  731. dbc_collseql = 260             /*                                 length     */
  732.  
  733. dbc_pad3o =  854               /* Pad for Spare Bytes offset                 */
  734. dbc_pad3l =  8                 /*                     length                 */
  735.  
  736.  
  737. return
  738.  
  739.  
  740. /******************************************************************
  741. *  SUBROUTINE:   GETDATA_DBCON                                    *
  742. *                                                                 *
  743. *  DESCRIPTIVE NAME: Get Data from the Db Config File             *
  744. *                                                                 *
  745. *  DESCRIPTION: This routine retrieves the data from the          *
  746. *               Database Configuration File and stores the        *
  747. *               Database Configuration fields in variables.       *
  748. *                                                                 *
  749. *  INPUT: none                                                    *
  750. *                                                                 *
  751. *                                                                 *
  752. *  OUTPUT: none                                                   *
  753. *                                                                 *
  754. ******************************************************************/
  755.  
  756. getdata_dbcon:
  757.  
  758.  
  759. /*********************************************
  760.    Read the Database Configuration File
  761. *********************************************/
  762.  
  763.                                  /* Checksum                */
  764. dbc_chksum = c2d(reverse(charin(dbcon_name, dbcon+dbc_chksumo+2, 2)) || ,
  765.               reverse(charin(dbcon_name, dbcon+dbc_chksumo, 2)), 5)
  766.  
  767.                                  /* Title                   */
  768. dbc_title = charin(dbcon_name, dbcon+dbc_titleo, dbc_titlel)
  769.  
  770.                                  /* Release                 */
  771. dbc_rel = c2x(reverse(charin(dbcon_name, dbcon+dbc_relo, dbc_rell)))
  772.  
  773.                                  /* Log File Size           */
  774. dbc_logsiz = c2d(reverse(charin(dbcon_name, dbcon+dbc_logsizo+2, 2)) || ,
  775.               reverse(charin(dbcon_name, dbcon+dbc_logsizo, 2)), 5)
  776.  
  777.                                  /* Log File Extent Size    */
  778. dbc_logext = c2d(reverse(charin(dbcon_name, dbcon+dbc_logexto+2, 2)) || ,
  779.               reverse(charin(dbcon_name, dbcon+dbc_logexto, 2)), 5)
  780.  
  781.                                  /* Max No. of Extents      */
  782. dbc_maxext = c2d(reverse(charin(dbcon_name, dbcon+dbc_maxexto+2, 2)) || ,
  783.               reverse(charin(dbcon_name, dbcon+dbc_maxexto, 2)), 5)
  784.  
  785.                                  /* Deadlock Check Interval */
  786. dbc_dlchk = c2d(reverse(charin(dbcon_name, dbcon+dbc_dlchko+2, 2)) || ,
  787.               reverse(charin(dbcon_name, dbcon+dbc_dlchko, 2)), 5)
  788.  
  789.                                  /* Masked Database Seed    */
  790. dbc_mseed = c2d(reverse(charin(dbcon_name, dbcon+dbc_mseedo+2, 2)) || ,
  791.               reverse(charin(dbcon_name, dbcon+dbc_mseedo, 2)), 5)
  792.  
  793.                                  /* UnMasked Database Seed  */
  794. dbc_unseed = c2d(reverse(charin(dbcon_name, dbcon+dbc_unseedo+2, 2)) || ,
  795.               reverse(charin(dbcon_name, dbcon+dbc_unseedo, 2)), 5)
  796.  
  797.                                  /* Timestamp               */
  798. dbc_stmp = c2x(charin(dbcon_name, dbcon+dbc_stmpo, dbc_stmpl))
  799.  
  800.                                  /* Maximum Storage for Lock List  */
  801. dbc_lcklst = c2d(reverse(charin(dbcon_name, dbcon+dbc_lcklsto, dbc_lcklstl)))
  802.  
  803.                                  /* Size of Buffer Pool     */
  804. dbc_buff = c2d(reverse(charin(dbcon_name, dbcon+dbc_buffo, dbc_buffl)))
  805.  
  806.                                  /* Max Db Files Open per Appl     */
  807. dbc_maxfil = c2d(reverse(charin(dbcon_name, dbcon+dbc_maxfilo, dbc_maxfill)))
  808.  
  809.                                  /* No. Records before Soft Chkpt  */
  810. dbc_soft = c2d(reverse(charin(dbcon_name, dbcon+dbc_softo, dbc_softl)))
  811.  
  812.                                  /* Max Active Applications        */
  813. dbc_maxapp = c2d(reverse(charin(dbcon_name, dbcon+dbc_maxappo, dbc_maxappl)))
  814.  
  815.                                  /* Application Heap Size          */
  816. dbc_apheap = c2d(reverse(charin(dbcon_name, dbcon+dbc_apheapo, dbc_apheapl)))
  817.  
  818.                                  /* Database Heap Size             */
  819. dbc_dbheap = c2d(reverse(charin(dbcon_name, dbcon+dbc_dbheapo, dbc_dbheapl)))
  820.  
  821.                                  /* Country Code                   */
  822. dbc_cntry = c2d(reverse(charin(dbcon_name, dbcon+dbc_cntryo, dbc_cntryl)))
  823.  
  824.                                  /* Code Page                      */
  825. dbc_cpag = c2d(reverse(charin(dbcon_name, dbcon+dbc_cpago, dbc_cpagl)))
  826.  
  827.                                  /* Application Agent Heap Size    */
  828. dbc_agheap = c2d(reverse(charin(dbcon_name, dbcon+dbc_agheapo, dbc_agheapl)))
  829.  
  830.                                  /* Max Total Files Open           */
  831. dbc_maxtot = c2d(reverse(charin(dbcon_name, dbcon+dbc_maxtoto, dbc_maxtotl)))
  832.  
  833.                                  /* Sort List Heap Size            */
  834. dbc_slheap = c2d(reverse(charin(dbcon_name, dbcon+dbc_slheapo, dbc_slheapl)))
  835.  
  836.                                  /* RDS Version Indicator          */
  837. dbc_rds  = c2d(reverse(charin(dbcon_name, dbcon+dbc_rdso, dbc_rdsl)))
  838.  
  839.                                  /* %  of Total LockList per Appl  */
  840. dbc_pctlcks = c2d(reverse(charin(dbcon_name, dbcon+dbc_pctlckso, dbc_pctlcksl)))
  841.  
  842.                                  /* Statement Heap Size            */
  843. dbc_stheap = c2d(reverse(charin(dbcon_name, dbcon+dbc_stheapo, dbc_stheapl)))
  844.  
  845.                                  /* Number of Primary Log Files    */
  846. dbc_plog = c2d(reverse(charin(dbcon_name, dbcon+dbc_plogo, dbc_plogl)))
  847.  
  848.                                  /* Number of Secondary Log Files  */
  849. dbc_slog = c2d(reverse(charin(dbcon_name, dbcon+dbc_slogo, dbc_slogl)))
  850.  
  851.                                  /* Log File Size                  */
  852. dbc_lfsiz = c2d(reverse(charin(dbcon_name, dbcon+dbc_lfsizo, dbc_lfsizl)))
  853.  
  854.                                  /* Log File Path           */
  855. dbc_logpath = charin(dbcon_name, dbcon+dbc_logpatho, dbc_logpathl)
  856.  
  857.                                  /* New Log File Path       */
  858. dbc_newpath = charin(dbcon_name, dbcon+dbc_newpatho, dbc_newpathl)
  859.  
  860.                                  /* Internal Indicator/Status Flag */
  861. dbc_inflg = c2x(reverse(charin(dbcon_name, dbcon+dbc_inflgo, dbc_inflgl)))
  862.  
  863.                                  /* External Indicator/Status Flag */
  864. dbc_exflg = c2x(reverse(charin(dbcon_name, dbcon+dbc_exflgo, dbc_exflgl)))
  865.  
  866.  
  867.  
  868.  
  869. /*********************************************
  870.    Report the Contents of the Database
  871.      Configuration File
  872. *********************************************/
  873.  
  874. /* Get Binary representations of the Internal Indicators                     */
  875. dbc_inflg_mo = x2b(c2x(bitand(x2c(dbc_inflg), '0001'x)))   /* Log File Move  */
  876. dbc_inflg_lc = x2b(c2x(bitand(x2c(dbc_inflg), '0002'x)))   /* L -> C Xlate   */
  877. dbc_inflg_cl = x2b(c2x(bitand(x2c(dbc_inflg), '0004'x)))   /* C -> L Xlate   */
  878. dbc_inflg_sv = x2b(c2x(bitand(x2c(dbc_inflg), '0008'x)))   /* Svr Def Install*/
  879.  
  880. /* Get Binary representations of the External Indicators                     */
  881. dbc_exflg_cp = x2b(c2x(bitand(x2c(dbc_exflg), '0001'x)))   /* Copy Protect   */
  882. dbc_exflg_lr = x2b(c2x(bitand(x2c(dbc_exflg), '0002'x)))   /* Log Retain     */
  883. dbc_exflg_le = x2b(c2x(bitand(x2c(dbc_exflg), '0004'x)))   /* Log Exit       */
  884. dbc_exflg_ar = x2b(c2x(bitand(x2c(dbc_exflg), '0008'x)))   /* Auto Restart   */
  885.  
  886. dbcon_text = ,
  887.    '     ' || cr_lf || ,
  888.    '                     Database Configuration File  ' || cr_lf || ,
  889.    '     ' || cr_lf || ,
  890.    '     ' || cr_lf || ,
  891.    '                        Checksum:  ' || dbc_chksum  || cr_lf || ,
  892.    '                           Title:  ' || dbc_title   || cr_lf || ,
  893.    '                         Release:  ' || dbc_rel     || cr_lf || ,
  894.    '           RDS Version Indicator:  ' || dbc_rds     || cr_lf || ,
  895.    '            Masked Database Seed:  ' || dbc_mseed   || cr_lf || ,
  896.    '          UnMasked Database Seed:  ' || dbc_unseed  || cr_lf || ,
  897.    '     Database Creation Timestamp:  ' || substr(dbc_stmp,1,4) || '-' || ,
  898.                                             substr(dbc_stmp,5,2) || '-' || ,
  899.                                             substr(dbc_stmp,7,2) || '-' || ,
  900.                                             substr(dbc_stmp,9,2) || '.' || ,
  901.                                             substr(dbc_stmp,11,2) || '.' || ,
  902.                                             substr(dbc_stmp,13,2) || '.' || ,
  903.                                             substr(dbc_stmp,15,6) || ,
  904.                                             cr_lf || ,
  905.    '     ' || cr_lf || ,
  906.    '      Log File Size (Linear Log):  ' || dbc_logsiz || cr_lf || ,
  907.    '        Extent Size (Linear Log):  ' || dbc_logext || cr_lf || ,
  908.    ' Max No. of Extents (Linear Log):  ' || dbc_maxext || cr_lf || ,
  909.    '     Number of Primary Log Files:  ' || dbc_plog   || cr_lf || ,
  910.    '   Number of Secondary Log Files:  ' || dbc_slog   || cr_lf || ,
  911.    '           Size of Each Log File:  ' || dbc_lfsiz  || cr_lf || ,
  912.    '                   Log File Path:  ' || ,
  913.                          strip(translate(dbc_logpath, ' ', '00'x )) || ,
  914.                          cr_lf || ,
  915.    '               New Log File Path:  ' || ,
  916.                          strip(translate(dbc_newpath, ' ', '00'x )) || ,
  917.                          cr_lf || ,
  918.    '     ' || cr_lf || ,
  919.    ' Interval for DeadLock Detection:  ' || dbc_dlchk   || cr_lf || ,
  920.    '   Maximum Storage for Lock List:  ' || dbc_lcklst  || cr_lf || ,
  921.    '   % of Total Lock List per Appl:  ' || dbc_pctlcks || cr_lf || ,
  922.    '     Maximum Active Applications:  ' || dbc_maxapp  || cr_lf || ,
  923.    '  Maximum Db Files Open per Appl:  ' || dbc_maxfil  || cr_lf || ,
  924.    '     Max Tot Files Open per Appl:  ' || dbc_maxtot  || cr_lf || ,
  925.    'Records Written before SoftChkpt:  ' || dbc_soft    || cr_lf || ,
  926.    '             Size of Buffer Pool:  ' || dbc_buff    || cr_lf || ,
  927.    '     '  || cr_lf || ,
  928.    '           Application Heap Size:  ' || dbc_apheap  || cr_lf || ,
  929.    '     Application Agent Heap Size:  ' || dbc_agheap  || cr_lf || ,
  930.    '              Database Heap Size:  ' || dbc_dbheap  || cr_lf || ,
  931.    '             Statement Heap Size:  ' || dbc_stheap  || cr_lf || ,
  932.    '             Sort List Heap Size:  ' || dbc_slheap  || cr_lf || ,
  933.    '     '  || cr_lf || ,
  934.    '                    Country Code:  ' || dbc_cntry   || cr_lf || ,
  935.    '                       Code Page:  ' || dbc_cpag    || cr_lf || ,
  936.    '     ' || cr_lf || ,
  937.    '     ' || cr_lf || ,
  938.    '     ' || cr_lf || ,
  939.    '                  -----Internal Indicators----- '  || cr_lf || ,
  940.    '     ' || cr_lf || ,
  941.    '         Log File Move Indicator:  ' || ,
  942.                                          copies('x', 4) || ' ' || ,
  943.                                          copies('x', 4) || ' ' || ,
  944.                                          copies('x', 4) || ' ' || ,
  945.                                          copies('x', 3) || ,
  946.                                          substr(dbc_inflg_mo,16, 1) || ,
  947.                                          copies('x', 0) || ,
  948.                                          cr_lf || ,
  949.    '    Linear to Circular Log Xlate:  ' || ,
  950.                                          copies('x', 4) || ' ' || ,
  951.                                          copies('x', 4) || ' ' || ,
  952.                                          copies('x', 4) || ' ' || ,
  953.                                          copies('x', 2) || ,
  954.                                          substr(dbc_inflg_lc,15, 1) || ,
  955.                                          copies('x', 1) || ,
  956.                                          cr_lf || ,
  957.    '    Circular to Linear Log Xlate:  ' || ,
  958.                                          copies('x', 4) || ' ' || ,
  959.                                          copies('x', 4) || ' ' || ,
  960.                                          copies('x', 4) || ' ' || ,
  961.                                          copies('x', 1) || ,
  962.                                          substr(dbc_inflg_cl,14, 1) || ,
  963.                                          copies('x', 2) || ,
  964.                                          cr_lf || ,
  965.    '       Server Defaults Installed:  ' || ,
  966.                                          copies('x', 4) || ' ' || ,
  967.                                          copies('x', 4) || ' ' || ,
  968.                                          copies('x', 4) || ' ' || ,
  969.                                          copies('x', 0) || ,
  970.                                          substr(dbc_inflg_cl,13, 1) || ,
  971.                                          copies('x', 3) || ,
  972.                                          cr_lf || ,
  973.    '     ' || cr_lf || ,
  974.    '     ' || cr_lf || ,
  975.    '                  -----External Indicators----- ' || cr_lf || ,
  976.    '     ' || cr_lf || ,
  977.    '          Copy Protect Indicator:  ' || ,
  978.                                          copies('x', 4) || ' ' || ,
  979.                                          copies('x', 4) || ' ' || ,
  980.                                          copies('x', 4) || ' ' || ,
  981.                                          copies('x', 3) || ,
  982.                                          substr(dbc_exflg_cp,16, 1) || ,
  983.                                          copies('x', 0) || ,
  984.                                          cr_lf || ,
  985.    '               Enable Log Retain:  ' || ,
  986.                                          copies('x', 4) || ' ' || ,
  987.                                          copies('x', 4) || ' ' || ,
  988.                                          copies('x', 4) || ' ' || ,
  989.                                          copies('x', 2) || ,
  990.                                          substr(dbc_exflg_lr,15, 1) || ,
  991.                                          copies('x', 1) || ,
  992.                                          cr_lf || ,
  993.    '                 Enable Log Exit:  ' || ,
  994.                                          copies('x', 4) || ' ' || ,
  995.                                          copies('x', 4) || ' ' || ,
  996.                                          copies('x', 4) || ' ' || ,
  997.                                          copies('x', 1) || ,
  998.                                          substr(dbc_exflg_le,14, 1) || ,
  999.                                          copies('x', 2) || ,
  1000.                                          cr_lf || ,
  1001.    '               Automatic Restart:  ' || ,
  1002.                                          copies('x', 4) || ' ' || ,
  1003.                                          copies('x', 4) || ' ' || ,
  1004.                                          copies('x', 4) || ' ' || ,
  1005.                                          copies('x', 0) || ,
  1006.                                          substr(dbc_exflg_ar,13, 1) || ,
  1007.                                          copies('x', 3) || ,
  1008.                                          cr_lf
  1009.  
  1010. call wrt2rpt  dbcon_text
  1011.  
  1012.  
  1013.  
  1014.  
  1015. return
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021. /******************************************************************
  1022. *  SUBROUTINE:   UNPRO                                            *
  1023. *                                                                 *
  1024. *  DESCRIPTIVE NAME: Turn Off Copy Protection                     *
  1025. *                                                                 *
  1026. *  DESCRIPTION: This routine updates the External Flag in the     *
  1027. *               Database Configuration by resetting the Copy      *
  1028. *               Protect Flag to zero.  It then re-calculates and  *
  1029. *               the CheckSum field in the Database Configuration. *
  1030. *                                                                 *
  1031. *  INPUT: none                                                    *
  1032. *                                                                 *
  1033. *                                                                 *
  1034. *  OUTPUT: none                                                   *
  1035. *                                                                 *
  1036. ******************************************************************/
  1037.  
  1038. unpro:
  1039.  
  1040.  
  1041. /* Get the External Indicator Flag */
  1042. out_exflg = x2c(dbc_exflg)
  1043.  
  1044. /* Determine state of the Copy Protect bit */
  1045. if bitand(out_exflg, '0001'x) = '0001'x then
  1046.   do
  1047.     say '....Turning off the Database Copy Protection'
  1048.  
  1049.     /* Set the initial Copy Protection indicator */
  1050.     was_protected = 'YES'
  1051.  
  1052.     /* Reset the Copy Protect bit in the External Indicator Flag */
  1053.     out_exflg = bitand(out_exflg, 'FFFE'x)
  1054.     dbc_exflg = c2x(out_exflg)
  1055.     rc = charout(dbcon_name, reverse(out_exflg), dbcon+dbc_exflgo)
  1056.  
  1057.  
  1058.     /* Re-calculate the Checksum value */
  1059.     say '....Calculate the new Checksum Value'
  1060.  
  1061.     /* Initialize the cursor position to the 5th character */
  1062.     /* Note: The first four characters are the CheckSum value */
  1063.     cursor_pos = 5
  1064.  
  1065.     /* Initialize the checksum value */
  1066.     checksum = 0
  1067.  
  1068.     /* Loop to read each character in the file */
  1069.     do cursor_pos=5 to stream(dbcon_name, 'c', 'query size')
  1070.  
  1071.       /* Read the next character */
  1072.       char_value = charin(dbcon_name, cursor_pos, 1)
  1073.  
  1074.       /* Add the character to the checksum value */
  1075.       checksum = checksum + c2d(char_value)
  1076.  
  1077.     end
  1078.  
  1079.  
  1080.     /* Get Binary representations of the new Copy Protect Indicator          */
  1081.     dbc_exflg_cp = x2b(c2x(bitand(x2c(dbc_exflg), '0001'x)))
  1082.  
  1083.     /* Set the Write Cursor to the beginning of the Database Configuration file */
  1084.     rc = stream(dbcon_name, 'c', 'seek =1')
  1085.  
  1086.     /* Set the CheckSum field in the Database Configuration to calculated value */
  1087.     dbc_chksum = checksum
  1088.     rc = charout(dbcon_name, reverse(substr(d2c(dbc_chksum, 4), 3, 2)) || ,
  1089.                              reverse(substr(d2c(dbc_chksum, 4), 1, 2)) ,
  1090.                            , dbcon+dbc_chksumo)
  1091.  
  1092.     unpro_text = ,
  1093.         '     ' || cr_lf || ,
  1094.         '     ' || cr_lf || ,
  1095.         'Turn Off Copy Protection: ' || cr_lf || ,
  1096.         '     ' || cr_lf || ,
  1097.         '     ' || cr_lf || ,
  1098.         '....New CheckSum value:  ' || dbc_chksum || cr_lf || ,
  1099.         '     ' || cr_lf || ,
  1100.         '     ' || cr_lf || ,
  1101.         '                  -----External Indicators----- ' || cr_lf || ,
  1102.         '     ' || cr_lf || ,
  1103.         '....New Copy Protect Indicator:  ' || ,
  1104.                                          copies('x', 4) || ' ' || ,
  1105.                                          copies('x', 4) || ' ' || ,
  1106.                                          copies('x', 4) || ' ' || ,
  1107.                                          copies('x', 3) || ,
  1108.                                          substr(dbc_exflg_cp,16, 1) || ,
  1109.                                          copies('x', 0) || ,
  1110.                                          cr_lf ,
  1111.         '     ' || cr_lf || ,
  1112.         '     ' || cr_lf
  1113.  
  1114.     call wrt2rpt  unpro_text
  1115.  
  1116.   end
  1117.  
  1118. return
  1119.  
  1120.  
  1121.  
  1122. /******************************************************************
  1123. *  SUBROUTINE:   GENERAL_HELP                                     *
  1124. *                                                                 *
  1125. *  DESCRIPTIVE NAME: UNPROT General Help                          *
  1126. *                                                                 *
  1127. *  DESCRIPTION: This routine displays the Help panels for the     *
  1128. *               UNPROT tool.  This routine receives control when  *
  1129. *               the input parameter is a "?" instead of the       *
  1130. *               database name.  A brief description of the        *
  1131. *               UNPROT Tool and its syntax is included in the     *
  1132. *               Help panels.                                      *
  1133. *                                                                 *
  1134. *  INPUT: none                                                    *
  1135. *                                                                 *
  1136. *                                                                 *
  1137. *  OUTPUT: none                                                   *
  1138. *                                                                 *
  1139. ******************************************************************/
  1140.  
  1141. general_help:
  1142.  
  1143.   /* Display help panel */
  1144.   say "      "
  1145.   say ,
  1146.   "     ┌────────────────────────────────────────────────────────────┐       "
  1147.   say ,
  1148.   "     │         ┌────────────────────────────────────────┐         │       "
  1149.   say ,
  1150.   "     │         │        ****   U N P R O T   ****       │         │       "
  1151.   say ,
  1152.   "     │         │     Remove Database Copy Protection    │         │       "
  1153.   say ,
  1154.   "     │         │               Version 1.2              │         │       "
  1155.   say ,
  1156.   "     │         └────────────────────────────────────────┘         │       "
  1157.   say ,
  1158.   "     │      ▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▀       ▀▀▀▀▀     ▀▀▀▀▀      │       "
  1159.   say ,
  1160.   "     │      ▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀     ▀▀▀▀▀      │       "
  1161.   say ,
  1162.   "     │         ▀▀▀▀          ▀▀▀   ▀▀▀▀       ▀▀▀▀▀   ▀▀▀▀▀       │       "
  1163.   say ,
  1164.   "     │         ▀▀▀▀          ▀▀▀▀▀▀▀▀▀        ▀▀▀▀▀▀ ▀▀▀▀▀▀       │       "
  1165.   say ,
  1166.   "     │         ▀▀▀▀          ▀▀▀▀▀▀▀▀▀        ▀▀▀ ▀▀▀▀▀ ▀▀▀       │       "
  1167.   say ,
  1168.   "     │         ▀▀▀▀          ▀▀▀   ▀▀▀▀       ▀▀▀  ▀▀▀  ▀▀▀       │       "
  1169.   say ,
  1170.   "     │      ▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀   ▀   ▀▀▀▀      │       "
  1171.   say ,
  1172.   "     │      ▀▀▀▀▀▀▀▀▀▀      ▀▀▀▀▀▀▀▀▀▀       ▀▀▀▀       ▀▀▀▀      │       "
  1173.   say ,
  1174.   "     └────────────────────────────────────────────────────────────┘       "
  1175.   say ,
  1176.   " ╔══════════════════════════════════════════════════════════════════════╗ "
  1177.   say ,
  1178.   " ║  The UNPROT Tool is a mechanism for removing the Copy Protection     ║ "
  1179.   say ,
  1180.   " ║  from a database that has been copy protected previously and is      ║ "
  1181.   say ,
  1182.   " ║  now unusable due to that copy protection.  After this tool has      ║ "
  1183.   say ,
  1184.   " ║  executed,  the database is no longer copy protected and may be      ║ "
  1185.   say ,
  1186.   " ║  used across different machines.                                     ║ "
  1187.   say ,
  1188.   " ║                                                                      ║ "
  1189.   say ,
  1190.   " ╚══════════════════════════════════════════════════════════════════════╝ "
  1191.   say "      "
  1192.   'pause'
  1193.   say "      "
  1194.   say "      "
  1195.   say "      "
  1196.   say "      "
  1197.   say ,
  1198.   "      Syntax:   UNPROT    [dbname]  [rptname]                             "
  1199.   say "      "
  1200.   say "      "
  1201.   say ,
  1202.   "       where:   [dbname]   is the alias name of the database.             "
  1203.   say "                       If no database name is specified , the user    "
  1204.   say "                          will be prompted for the database name.     "
  1205.   say "      "
  1206.   say "      "
  1207.   say ,
  1208.   "                [rptname]  is the report file name.                       "
  1209.   say "                       If no report file name is specified, then no   "
  1210.   say "                          report will be generated.                   "
  1211.   say "      "
  1212.   say "      "
  1213.   say "      "
  1214.   say "      "
  1215.   say "      "
  1216.   say "      "
  1217.   say "      "
  1218.   say "      "
  1219.  
  1220.  
  1221.   return
  1222.