

Reporting Examples › 6.1 Which Users Executed Transaction ABCD Yesterday
6.1 Which Users Executed Transaction ABCD Yesterday
Consider the CICS information area. Within this information
area, look for a file that contains both transaction and user
data. A review of the CIC information area files (in the CA
MICS Analyzer Option for CICS Guide) shows that the CICS User
Activity file (CICCSU) contains the following two account
variables (data elements):
CICACT2 Transaction ID
CICACT3 User ID
Since this file exists in the DETAIL, DAYS, and MONTHS
timespans and we are interested in yesterday, we use the DAYS
timespan.
The cycle we want is 01 because yesterday will be in the most
recent cycle.
We decide to print SYSID, CICSID, CICACT3, CSUTRANS
(Transactions Processed) and CSUCPUTM (Task CPU Time) to give
us a better picture of use.
Since we see that the top of the sort order for DAYS is
SYSID, then CICSID, then CICACT3, we do not need to resort
the file (assuming we want USER within CICS system and LPAR).
The SAS program and output are as follows:
DATA TESTFILE;
SET &PCICD..CICCSU01;
IF CICACT3='ABCD';
PROC PRINT;
VAR SYSID CICSID CICACT3 CSUTRANS CSUCPUTM;
RUN;
Obs SYSID CICSID CICACT3 CSUTRANS CSUCPUTM
1 SYSG CSGA CS025T 1 0:00:10.87
2 SYSG CSGA CS025T 1 0:01:00.52
3 SYSG CSGA CS025T 1 0:00:18.82
4 SYSG CSGA CS025T 1 0:00:05.69
5 SYSG CSGA CS025T 2 0:00:37.58
6 SYSG CSGA CS025T 1 0:00:00.10
7 SYSG CSGA CS025T 1 0:00:00.00
8 SYSG CSGA CS025T 3 0:00:00.01
9 SYSG CSGA CS025T 3 0:00:00.01
10 SYSG CSGA CS025T 4 0:00:00.01
If we thought we might have a "boundary" problem, where data
for yesterday is in more than one cycle, we should have
written:
DATA TESTFILE;
SET &PCICD..CICCSU02 &PCICD..CICCSU01;
BY SYSID CICSID CICACT3;
IF CICACT3='ABCD';
IF DAYNAME='TUE';
PROC PRINT;
VAR SYSID CICSID CICACT3 CSUTRANS CSUCPUTM;
RUN;
Note that we specified the DAYS timespan of the CICCSU02
file first in the SET statement. The reason we did this is
that we wanted observations from this cycle to appear first
on the printout (they were earlier in time than cycle 01).
We also used a BY statement because we wanted all
observations from the same SYSID, CICSID and CICACT3 to
appear together; this is called interleaving.
We could have accomplished the same thing by writing:
DATA TESTFILE;
SET &PCICD..CICCSU02 &PCICD..CICCSU01;
IF CICACT3='ABCD';
IF DAYNAME='TUE';
PROC SORT;
BY SYSID CICSID CICACT3;
PROC PRINT;
VAR SYSID CICSID CICACT3 CSUTRANS CSUCPUTM;
RUN;
First, TESTFILE was created by taking observations from the
DAYS timespan of CICCSU01 and CICCSU02 that met the test
CICACT2='ABCD' and DAYNAME='TUE'. Then TESTFILE was sorted
to assure the desired order when printing. Finally, TESTFILE
was printed.
In this last program, we did not care about data ordering
until just before using it in the desired order. In general,
this is a better strategy than worrying about manipulation in
SET statements.
Note also that since we did not specify a DATA=TESTFILE
option in either PROC SORT or PROC PRINT, the most recently
created SAS data set was used. In this case we created only
one data set (TESTFILE). However, in more complex
programming with several DATA STEPS, be sure to name the data
set you intend to use to avoid processing errors. PROC SORT
replaced TESTFILE with the result of the sort. Remember that
you can create a new data set in PROC SORT by using the OUT=
option.
The following program causes the same result as the previous
programs:
DATA TESTFILE;
SET &PCICD..CICCSU02 &PCICD..CICCSU01;
IF CICACT3='ABCD' AND DAYNAME='TUE';
PROC SORT DATA=TESTFILE OUT=NEWFILE;
BY SYSID CICSID CICACT3;
PROC PRINT DATA=NEWFILE;
VAR SYSID CICSID CICACT3 CSUTRANS CSUCPUTM;
RUN;
Copyright © 2014 CA.
All rights reserved.
 
|
|