home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / ptdem3.zip / TIMESAMP.CMD < prev   
OS/2 REXX Batch file  |  1994-03-08  |  3KB  |  103 lines

  1. /***************************************/
  2. /* Pegasus Log Rexx Extension          */
  3. /* Version 1.10                        */
  4. /* (c) 1993,1994 C.O.L. Systems Inc.   */
  5. /* All Rights Reserved                 */
  6. /* Time Stamp Sample Proc              */
  7. /***************************************/
  8.  
  9. Data1. = "";         /* This is our data stem. Assumes one file input*/
  10.  
  11. Parse Arg   MyFile   /* Parse the file name on input to the proc     */
  12.  
  13. /************************/
  14. /* Load the extension   */
  15. /************************/
  16.  
  17. if RxFuncQuery('PegLoadFunctions') <> 0 then do
  18.    rcy = RxFuncAdd('PegLoadFunctions','PEGREXX','PegLoadFunctions')
  19.    if rcy = 0 then do
  20.       rcy = PegLoadFunctions()
  21.       if rcy > 0 then
  22.          signal BadLoad;
  23.       end;
  24.    else do
  25.       signal BadAdd;
  26.       end;
  27.    end;
  28.  
  29. /**************************/
  30. /* Load the file and stem */
  31. /**************************/
  32.  
  33. rcx = PegLoadFile(MyFile,"Data1.");
  34.  
  35. if rcx = 0 then do                  /* If there are no errors  */
  36.  
  37.    /* Copyright information   */
  38.  
  39.    say;
  40.    do count = 1 to 7
  41.       say   sourceline(count);
  42.       end;
  43.  
  44.    /* Supplied by originator  */
  45.  
  46.    say;
  47.    say "Data was created by "Data1.Title;   
  48.  
  49.    /* For each resource found flag, display the name  */
  50.  
  51.    say "Res # = "Data1.Resources;   
  52.  
  53.    do count = 1 to Data1.Resources  /* Display each on in list */
  54.       say   "Resource "count" = "Data1.Resources.count;
  55.       end
  56.  
  57.    /* Display the number of records */
  58.    say   "Records = "Data1.Records; 
  59.  
  60.    /* Display the number of apps  from APPMON or FILEMON */
  61.    say   "Apps    = "Data1.Records.Applications;
  62.  
  63.    /* Display the number of files from APPMON or FILEMON */
  64.    say   "Files   = "Data1.Records.Files;
  65.  
  66.    /* Loop through record count and calculate cpu busy   */
  67.  
  68.    if( Data1.Records > 0 ) then do
  69.       do count = 1 to Data1.Records
  70.         say PegDate(,Data1.Records.count.TDS);
  71.         end;
  72.       end;
  73.    end;
  74.  
  75. /* Report a file access error  */
  76.  
  77. else do
  78.    say "Error in file set = "rcx;
  79.    end;
  80.  
  81. /* Release the extension   */
  82.  
  83. rcx = PegDropFunctions();
  84. call RXFUNCDROP 'PEGLOADFUNCTIONS';
  85.  
  86. exit;
  87.  
  88. /****************************************************/
  89. /*  Error in syntax occured somewhere here          */
  90. /****************************************************/
  91.  
  92. BadAdd:
  93.  
  94.    say   'Error Adding Pegasus Rexx Function Loader';
  95.  
  96. exit;
  97.  
  98. BadLoad:
  99.  
  100.    say   'Error Loading Pegasus Rexx Functions';
  101.  
  102. exit;
  103.