home *** CD-ROM | disk | FTP | other *** search
/ alphant.com / ftp.alphant.com.zip / ftp.alphant.com / Utilities / AQM30LA.ZIP / TEST1.BCL < prev    next >
Text File  |  1995-04-24  |  6KB  |  123 lines

  1. /******  TEST1.BCL -- SAMPLE BCL PROCEDURE  ********
  2. *                                                  *
  3. *                                                  *
  4. * BCL SYNTAX RULES                                 *
  5. * ----------------                                 *
  6. *                                                  *
  7. * - LABELS START IN COLUMN 1, PREFIXED WITH ':'    *
  8. *                                                  *
  9. * - MACRO DEFINITIONS START IN COLUMN 1, PREFIXED  *
  10. *   WITH '#'                                       *
  11. *                                                  *
  12. * - ONLY LABELS AND MACROS START IN COLUMN 1       *
  13. *                                                  *
  14. * - A SINGLE 'IF' STATEMENT MAY INCLUDE UP TO      *
  15. *   EIGHT TESTS                                    *
  16. *                                                  *
  17. * - THE GOTO OF AN 'IF' STATEMENT IS PLACED ON     *
  18. *   A NEW LINE, BETWEEN BRACES {}                  *
  19. *                                                  *
  20. * - ONLY LAST CONDITION CODE OF A MULTI-COMMAND    *
  21. *   STEP IS RETAINED                               *
  22. *                                                  *
  23. *                                                  *
  24. *                                                  *
  25. * THIS SAMPLE USES THE FOLLOWING EXECUTABLES,      *
  26. * WHICH ARE PROVIDED WITH AQM:                     *
  27. *                                                  *
  28. * CC.EXE         /CC=condition code to set         *
  29. *                                                  *
  30. *                                                  *
  31. * SLEEP.EXE      /SECONDS=time to sleep in seconds *
  32. *                                                  *
  33. *                                                  *
  34. * SCANFILE.EXE   /FILE=file spec                   *
  35. * Returns a condition code of 0 if the file is     *
  36. * not found, or 1 if it is found.                  *
  37. *                                                  *
  38. *                                                  *
  39. * FILEAGE.EXE    /FILE=file spec                   *
  40. *                                                  *
  41. *                /LIST  -------- LIST TIME         *
  42. *                                                  *
  43. *                /CHECK=WRITE -- USE LAST UPDATE   *
  44. *                                                  *
  45. *                /CHECK=ACCESS - USE LAST ACCESS   *
  46. *                                                  *
  47. *                /CHECK=CREAT  - USE CREATION DATE *
  48. *                                (DEFAULT)         *
  49. *                                                  *
  50. *                /TIME=HOURS --- CC = HOURS        *
  51. *                                                  *
  52. *                /TIME=MINUTES - CC = MINUTES      *
  53. *                                                  *
  54. * Returns in the condition code the age of the     *
  55. * file in the specified units.  The default time   *
  56. * used is the file's creation date.  "/CHECK=      *
  57. * ACCESS causes FILEAGE to use the file's last     *
  58. * access date instead.  The default unit is hours. *
  59. * For example, assume a file was created at 9:00   *
  60. * and it is now 11:59; using the defaults,         *
  61. * FILEAGE would return a condition code of 2       *
  62. * because 2 full hours elapsed since the file's    *
  63. * creation time.  If "/TIME=MINUTES" were used,    *
  64. * then the condition code would be 179.  FILEAGE   *
  65. * can only be used on NTFS volumes.                *
  66. *                                                  *
  67. * NOTE:  NTFS will often reuse a file's header,    *
  68. * if the file is created with the "CREATE_ALWAYS"  *
  69. * flag to CreateFile().  Thus the file's creation  *
  70. * date will reflect the creation date of the       *
  71. * original file, not the creation date of the new  *
  72. * file.  There may be differences between the date *
  73. * shown by the DIR command and the values returned *
  74. * by FILEAGE with "/CHECK=WRITE" because the DIR   *
  75. * command does not record seconds.  FILEAGE uses   *
  76. * the exact 64-bit date value recorded by the NTFS *
  77. * file system.                                     *
  78. *                                                  *
  79. ***************************************************/
  80.  
  81.  
  82.                          /* THIS IS A DUMMY STEP  */
  83. :STEP0
  84.  
  85.  
  86. :STEP1                                                                       
  87.           C:\AQM\CC.EXE  /CC=1                                                
  88.            C:\AQM\CC.EXE  /CC=2                                                
  89.             C:\AQM\CC.EXE  /CC=3
  90.                                                                              
  91.                                                                              
  92.                                                                              
  93. :STEP2                        /* WAIT FOR A FILE */                       
  94.                                                       
  95.           C:\AQM\SLEEP /SECONDS=10
  96.  
  97.                               /* SEE IF FILE IS PRESENT*/ 
  98.  
  99.           C:\AQM\SCANFILE.EXE /FILE=C:\AQM\T1.BCL
  100.                                                                              
  101.           IF (STEP1 = 3) AND                                          
  102.              (STEP2 = 1)
  103.              { GOTO STEP3 }
  104.  
  105.           GOTO STEP2          /* DIDN'T SEE FILE YET -> */
  106.                                                          
  107.                                                                               
  108.                                                                               
  109. :STEP3    
  110.  
  111.         /* REMOVE COMMENTS FOR AQM STEPETTE BELOW */
  112.          
  113.         /* QSUBMIT JOB1.CMD/QUEUE=QUEUE1  */
  114.  
  115.         C:\AQM\CC /CC=16      /* SET DUMMY CODE FOR TESTING*/  
  116.  
  117.         ECHO *** END OF STEP 3 ***                                                  
  118.                                                                                           
  119. :STEP_999                                                                    
  120.         C:\AQM\FILEAGE /FILE=C:\AQM\T1.BCL/LIST/CHECK=ACCESS
  121.         
  122.                                                                                           
  123.