Processing EXTRACT data

This section gives an example of processing the data returned from CSQ1LOGP with EXTRACT(YES) set, and details of the sample program supplied.

 

Example 1. Counting the number of bytes put to each queue

The following job uses DFSORT facilities to process the file of committed records to add up the number of bytes put to each queue.

Figure 74. Accumulating bytes put to each queue

//TOOLRUN EXEC PGM=ICETOOL,REGION=1024K
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//TOOLIN   DD *
SORT FROM(IN) TO(TEMP1) USING(CTL1)
DISPLAY FROM(TEMP1) LIST(OUT1) ON(5,48,CH) ON(53,4,BI)
/*
//CTL1     DD *
* Select the records which were put
INCLUDE COND=(175,5,CH,EQ,C'MQPUT')
* Sort by queue name
SORT FIELDS=(110,48,CH,A)
* Only copy the queue name and size of user data to output record
OUTREC FIELDS=(1,4,110,48,102,4)
* Add up the number of bytes processed
SUM FIELDS=(102,4,FI)
/*
//IN       DD DISP=SHR,DSN=commit.dataset
//TEMP1    DD DISP=(NEW,DELETE),DSN=&TEMP1,SPACE=(CYL,(10,10))
//OUT1     DD SYSOUT=*

This produces output in the following format:

BA1 3605616
BA10 3572328
BA2 3612624
BA3 3579336
BA4 3572328
BA5 3491736
BA6 3574080
BA7 3532032
BA8 3577584
BA9 3539040
SYSTEM.ADMIN.CHANNEL.EVENT 186120
SYSTEM.ADMIN.QMGR.EVENT 384
SYSTEM.CHANNEL.SYNCQ 46488312

The following table lists the samples that are provided to allow you to print and interpret the data generated when EXTRACT(YES) is used

Sample Description
thlqual.SCSQLOAD(CSQ4LOGS) Sample C program to report on the UOW activity and object manipulation
thlqual.SCSQC37S(CSQ4LOGS) Source for sample C program
thlqual.SCSQC370(CSQ4LOGD) C header file to map records generated when using the EXTRACT(YES) function of CSQ1LOGP
thlqual.SCSQPROC(CSQ4LOGJ) Sample JCL to run program CSQ4LOGS