FOCUS AREAS

ARM - SAS Interface to the ARM API for Release 8.2

Overview | SAS 8 ARM Log | SAS 8 Examples | Logging Performance Data


ARM - V8 Macro Examples


Basic SAS Code

/* Step 1 */
data one;
set work1;
run;

/* Step 2 */
data two;
set work2;
run;

/* Step 3 */
data three;
set work3;
run;

SAS Code with ARM macros and Basic Report

/* example for 8.2 */
%let _armexec=1;
filename ARMLOG 'F:\arm\armlogs\USWest2.log';
/* clear ARMLOG between runs */
data _NULL_;
file ARMLOG;
put;
run;
/* initialize work datasets */
data work1 work2 work3;
do _I_ = 1 to 100;
  output;
end;
run;

%arminit(APPNAME='Sample ARM',APPUSER='Arm UserID',MACONLY=YES);
%armgtid(TXNNAME='Sample 1',MACONLY=YES);     /* armgtid and armstrt can be combined */
%armstrt(LEVEL=1,MACONLY=YES);
/* Step 1 */
data one;
set work1;
run;
%armstop(MACONLY=YES);
%armgtid(TXNNAME='Sample 2',MACONLY=YES);
%armstrt(LEVEL=1,MACONLY=YES);
/* Step 2 */
data two;
set work2;
run;
%armstop(MACONLY=YES);
%armgtid(TXNNAME='Sample 3',MACONLY=YES);
%armstrt(LEVEL=1,MACONLY=YES);
/* Step 3 */
data three;
set work3;
run;
%armstop(MACONLY=YES);
%armend(MACONLY=YES);
run;

%armproc;
%armjoin;
run;

options pageno=1;   /* reset page number for subsequent runs */
/* redirect output to text file */
proc printto print='F:\arm\armlogs\USWest2ARM.log';
run;
proc print data=updtview;
title "Results of ARM calls";
sum deltelap deltcpu noncpu;
by txname;
sumby txname;
run;
/* redirect proc output to normal queue */
proc printto print=print;
run;

SAS Log

NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)
      Licensed to SAS Institute, MASTER Release, Site 0000000001.
NOTE: This session is executing on the WIN_NT  platform.



NOTE: SAS initialization used:
      real time           1.65 seconds
      cpu time            1.30 seconds


NOTE: AUTOEXEC processing beginning; file is C:\SASV8\autoexec.sas.


NOTE: AUTOEXEC processing completed.

1    /* example for 8.2 */
2    %let _armexec=1;
3    filename ARMLOG 'F:\arm\armlogs\USWest2.log';
4    /* clear ARMLOG between runs */
5    data _NULL_;
6    file ARMLOG;
7    put;
8    run;

NOTE: The file ARMLOG is:
      File Name=F:\arm\armlogs\USWest2.log,
      RECFM=V,LRECL=256

NOTE: 1 record was written to the file ARMLOG.
      The minimum record length was 0.
      The maximum record length was 0.
NOTE: DATA statement used:
      real time           0.02 seconds
      cpu time            0.02 seconds


9    /* initialize work datasets */
10   data work1 work2 work3;
11   do _I_ = 1 to 100;
12     output;
13   end;
14   run;

NOTE: The data set WORK.WORK1 has 100 observations and 1 variables.
NOTE: The data set WORK.WORK2 has 100 observations and 1 variables.
NOTE: The data set WORK.WORK3 has 100 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.05 seconds
      cpu time            0.05 seconds


15
16   %arminit(APPNAME='Sample ARM',APPUSER='Arm UserID',MACONLY=YES);
17   %armgtid(TXNNAME='Sample 1',MACONLY=YES);     /* armgtid and armstrt can be combined */
18   %armstrt(LEVEL=1,MACONLY=YES);
19   /* Step 1 */
20   data one;
21   set work1;
22   run;

NOTE: There were 100 observations read from the data set WORK.WORK1.
NOTE: The data set WORK.ONE has 100 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.02 seconds
      cpu time            0.02 seconds


23   %armstop(MACONLY=YES);
24   %armgtid(TXNNAME='Sample 2',MACONLY=YES);
25   %armstrt(LEVEL=1,MACONLY=YES);
26   /* Step 2 */
27   data two;
28   set work2;
29   run;

NOTE: There were 100 observations read from the data set WORK.WORK2.
NOTE: The data set WORK.TWO has 100 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.02 seconds
      cpu time            0.02 seconds


30   %armstop(MACONLY=YES);
31   %armgtid(TXNNAME='Sample 3',MACONLY=YES);
32   %armstrt(LEVEL=1,MACONLY=YES);
33   /* Step 3 */
34   data three;
35   set work3;
36   run;

NOTE: There were 100 observations read from the data set WORK.WORK3.
NOTE: The data set WORK.THREE has 100 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.02 seconds
      cpu time            0.02 seconds


37   %armstop(MACONLY=YES);
38   %armend(MACONLY=YES);
39   run;
40
41   %armproc;

NOTE: The infile ARMLOG is:
      File Name=F:\arm\armlogs\USWest2.log,
      RECFM=V,LRECL=328

NOTE: 12 records were read from the infile ARMLOG.
      The minimum record length was 0.
      The maximum record length was 234.
NOTE: The data set WORK.INIT has 1 observations and 4 variables.
NOTE: The data set WORK.GETID has 3 observations and 5 variables.
NOTE: The data set WORK.START has 3 observations and 4 variables.
NOTE: The data set WORK.UPDATE has 0 observations and 7 variables.
NOTE: The data set WORK.STOP has 3 observations and 7 variables.
NOTE: The data set WORK.END has 1 observations and 14 variables.
NOTE: DATA statement used:
      real time           0.11 seconds
      cpu time            0.09 seconds


42   %armjoin;

NOTE: There were 1 observations read from the data set WORK.INIT.
NOTE: The data set WORK.INIT has 1 observations and 4 variables.
NOTE: PROCEDURE SORT used:
      real time           0.03 seconds
      cpu time            0.03 seconds



NOTE: There were 3 observations read from the data set WORK.GETID.
NOTE: The data set WORK.GETID has 3 observations and 5 variables.
NOTE: PROCEDURE SORT used:
      real time           0.02 seconds
      cpu time            0.02 seconds



NOTE: There were 3 observations read from the data set WORK.START.
NOTE: The data set WORK.START has 3 observations and 4 variables.
NOTE: PROCEDURE SORT used:
      real time           0.02 seconds
      cpu time            0.02 seconds



NOTE: Input data set is empty.
NOTE: The data set WORK.UPDATE has 0 observations and 7 variables.
NOTE: PROCEDURE SORT used:
      real time           0.04 seconds
      cpu time            0.02 seconds



NOTE: There were 3 observations read from the data set WORK.STOP.
NOTE: The data set WORK.STOP has 3 observations and 7 variables.
NOTE: PROCEDURE SORT used:
      real time           0.02 seconds
      cpu time            0.02 seconds



NOTE: There were 1 observations read from the data set WORK.END.
NOTE: The data set WORK.END has 1 observations and 14 variables.
NOTE: PROCEDURE SORT used:
      real time           0.02 seconds
      cpu time            0.02 seconds


                                       -----Directory-----

                        Libref:        WORK
                        Engine:        V8
                        Physical Name: C:\Temp\SAS Temporary Files\_TD397
                        File Name:     C:\Temp\SAS Temporary Files\_TD397


                                                File
                         #  Name     Memtype    Size  Last Modified
                        ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
                         1  END      DATA      13312   26AUG2001:13:20:18
                         2  GETID    DATA      17408   26AUG2001:13:20:18
                         3  INIT     DATA      17408   26AUG2001:13:20:18
                         4  ONE      DATA       5120   26AUG2001:13:20:18
                         5  SASMACR  CATALOG    5120   26AUG2001:13:20:17
                         6  START    DATA       5120   26AUG2001:13:20:18
                         7  STOP     DATA       9216   26AUG2001:13:20:18
                         8  THREE    DATA       5120   26AUG2001:13:20:18
                         9  TWO      DATA       5120   26AUG2001:13:20:18
                        10  UPDATE   DATA      17408   26AUG2001:13:20:18
                        11  WORK1    DATA       5120   26AUG2001:13:20:17
                        12  WORK2    DATA       5120   26AUG2001:13:20:17
                        13  WORK3    DATA       5120   26AUG2001:13:20:17
NOTE: Composite index clsix has been defined.
NOTE: PROCEDURE DATASETS used:
      real time           0.07 seconds
      cpu time            0.06 seconds


NOTE: SQL view WORK.TXNVIEW has been defined.
NOTE: PROCEDURE SQL used:
      real time           0.03 seconds
      cpu time            0.03 seconds



NOTE: DATA STEP view saved on file WORK.UPDTVIEW.
NOTE: A stored DATA STEP view cannot run under a different operating system.
NOTE: DATA statement used:
      real time           0.06 seconds
      cpu time            0.06 seconds



NOTE: There were 1 observations read from the data set WORK.INIT.
NOTE: There were 1 observations read from the data set WORK.END.
NOTE: The data set WORK.APP has 1 observations and 18 variables.
NOTE: DATA statement used:
      real time           0.04 seconds
      cpu time            0.04 seconds



NOTE: DATA statement used:
      real time           0.02 seconds
      cpu time            0.02 seconds



NOTE: There were 3 observations read from the data set WORK.START.
NOTE: There were 3 observations read from the data set WORK.STOP.
NOTE: There were 3 observations read from the data set WORK.GETID.
NOTE: There were 3 observations read from the data set WORK.TXNVIEW.
NOTE: There were 1 observations read from the data set WORK.APP.
NOTE: The data set WORK.TXN1 has 3 observations and 11 variables.
NOTE: DATA statement used:
      real time           0.20 seconds
      cpu time            0.12 seconds



NOTE: View WORK.UPDTVIEW.VIEW used:
      real time           0.05 seconds
      cpu time            0.04 seconds

NOTE: There were 3 observations read from the data set WORK.START.
NOTE: There were 0 observations read from the data set WORK.UPDATE.
NOTE: There were 3 observations read from the data set WORK.STOP.
NOTE: There were 6 observations read from the data set WORK.UPDTVIEW.
NOTE: There were 1 observations read from the data set WORK.APP.
NOTE: The data set WORK.UPDT1 has 6 observations and 13 variables.
NOTE: DATA statement used:
      real time           0.13 seconds
      cpu time            0.06 seconds


43   run;
44
45   options pageno=1;   /* reset page number for subsequent runs */
46   /* redirect output to text file */
47   proc printto print='F:\arm\armlogs\USWest2ARM.log';
48   run;

NOTE: PROCEDURE PRINTTO used:
      real time           0.01 seconds
      cpu time            0.01 seconds


49   proc print data=updtview;
50   title "Results of ARM calls";
51   sum deltelap deltcpu noncpu;
52   by txname;
53   sumby txname;
54   run;

NOTE: View WORK.UPDTVIEW.VIEW used:
      real time           0.05 seconds
      cpu time            0.03 seconds

NOTE: There were 3 observations read from the data set WORK.START.
NOTE: There were 0 observations read from the data set WORK.UPDATE.
NOTE: There were 3 observations read from the data set WORK.STOP.
NOTE: There were 6 observations read from the data set WORK.UPDTVIEW.
NOTE: PROCEDURE PRINT used:
      real time           0.06 seconds
      cpu time            0.03 seconds


55   /* redirect proc output to normal queue */
56   proc printto print=print;
57   run;

NOTE: PROCEDURE PRINTTO used:
      real time           0.00 seconds
      cpu time            0.00 seconds


NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           26.27 seconds
      cpu time            3.85 seconds



ARM Log

26AUG2001:13:20:17.766  ARM_INIT    AppID=1  AppName=Sample ARM  AppUser=Arm UserID
26AUG2001:13:20:17.866  ARM_GETID   AppID=1  ClsID=1  TxName=Sample 1
26AUG2001:13:20:17.976  ARM_START   AppID=1  ClsID=1  TxSHdl=1
26AUG2001:13:20:18.087  ARM_STOP    AppID=1  ClsID=1  TxSHdl=1  TxStat=0  TxElap=00:00:00.111  TxCpu=0:00:00.100
26AUG2001:13:20:18.107  ARM_GETID   AppID=1  ClsID=2  TxName=Sample 2
26AUG2001:13:20:18.117  ARM_START   AppID=1  ClsID=2  TxSHdl=2
26AUG2001:13:20:18.167  ARM_STOP    AppID=1  ClsID=2  TxSHdl=2  TxStat=0  TxElap=00:00:00.050  TxCpu=0:00:00.050
26AUG2001:13:20:18.187  ARM_GETID   AppID=1  ClsID=3  TxName=Sample 3
26AUG2001:13:20:18.207  ARM_START   AppID=1  ClsID=3  TxSHdl=3
26AUG2001:13:20:18.247  ARM_STOP    AppID=1  ClsID=3  TxSHdl=3  TxStat=0  TxElap=00:00:00.040  TxCpu=0:00:00.040
26AUG2001:13:20:18.327  ARM_END     AppID=1  AppNCls=3  AppNTxSt=3  AppNTxSp=3  AppNTxUp=0  AppNTx0=3  AppNTx1=0  AppNTx2=0  AppElap=00:00:00.561  AppCpu=0:00:00.530  AppAvgRt=00:00:00.067  AppMinTx=00:00:00.000  AppMaxTx=00:00:00.111

Basic ARM Report

                                      Results of ARM calls      13:20 Sunday, August 26, 2001   1

--------------------------------------- Txn Name=Sample 1 ---------------------------------------

      Obs    call                      calldt         deltelap          deltcpu           noncpu

        1  UPD00000    26AUG2001:13:20:17.976      0:00:00.111      0:00:00.100      0:00:00.011
        2  UPD00001    26AUG2001:13:20:18.087      0:00:00.000      0:00:00.000      0:00:00.000
 --------                                       --------------   --------------   --------------
   txname                                          0:00:00.111      0:00:00.100      0:00:00.011

      Obs  appid   clsid   txshdl   updtdata           txelap            txcpu   txstat   txdet

        1    1       1        1      START        0:00:00.000      0:00:00.000      .
        2    1       1        1      STOP         0:00:00.111      0:00:00.100      0
 --------
   txname


--------------------------------------- Txn Name=Sample 2 ---------------------------------------

      Obs    call                      calldt         deltelap          deltcpu           noncpu

        3  UPD00000    26AUG2001:13:20:18.117      0:00:00.050      0:00:00.050      0:00:00.000
        4  UPD00001    26AUG2001:13:20:18.167      0:00:00.000      0:00:00.000      0:00:00.000
 --------                                       --------------   --------------   --------------
   txname                                          0:00:00.050      0:00:00.050      0:00:00.000

      Obs  appid   clsid   txshdl   updtdata           txelap            txcpu   txstat   txdet

        3    1       2        2      START        0:00:00.000      0:00:00.000      .
        4    1       2        2      STOP         0:00:00.050      0:00:00.050      0
 --------
   txname


--------------------------------------- Txn Name=Sample 3 ---------------------------------------

      Obs    call                      calldt         deltelap          deltcpu           noncpu

        5  UPD00000    26AUG2001:13:20:18.207      0:00:00.040      0:00:00.040      0:00:00.000
        6  UPD00001    26AUG2001:13:20:18.247      0:00:00.000      0:00:00.000      0:00:00.000
 --------                                       --------------   --------------   --------------
   txname                                          0:00:00.040      0:00:00.040      0:00:00.000
                                                ==============   ==============   ==============
                                                   0:00:00.201      0:00:00.190      0:00:00.011

      Obs  appid   clsid   txshdl   updtdata           txelap            txcpu   txstat   txdet

        5    1       3        3      START        0:00:00.000      0:00:00.000      .
        6    1       3        3      STOP         0:00:00.040      0:00:00.040      0
 --------
   txname