how to decompress DB2 SMF records in assembler program



High Level Assembler(HLASM) for MVS & VM & VSE

how to decompress DB2 SMF records in assembler program

Postby chaat » Fri Feb 19, 2021 9:53 am

Perhaps a bit of background is in order, I'm a mainframe COBOL programmer with some limited knowledge of assembler. I'm doing a performance assessment for a company which does not have an SMF extract / reporting process. So I'm attemping to modify an assembler program to process the SMF 101 record. I'm using as a starting point this assembler program https://ndtdb2.blogspot.com/2017/10/assembler-to-select-only-101-records.html?m=1&fbclid=IwAR0niwHPfYPfS31ilC9yDicMV97NLnKJV0_wYJg3rcF75Xwu8gt0E1hNbeQ

The question I have is that if the DB2 SMF records have been written in a compressed format, is there a way to decompress them in an assembler program by perhaps calling a service module to decompress the record ?

having to run a stand alone utility to read in a file of compressed SMF 101 records and write out the uncompressed records would double the amount of time / resources needed to do the analysis

any help would be greatly appreciated.

Chuck Haatvedt
chaat
 
Posts: 27
Joined: Sun Aug 16, 2009 11:07 pm
Location: St. Cloud, Minnesota
Has thanked: 0 time
Been thanked: 1 time

Re: how to decompress DB2 SMF records in assembler program

Postby steve-myers » Sat Feb 20, 2021 11:22 pm

Are you certain the records are "compressed?" Many fields in SMF data are either packed decimal dates (X'0121dddF' ddd is day of year) or binary time of day and not word aligned in 1/100th second interval.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: how to decompress DB2 SMF records in assembler program

Postby chaat » Sat Feb 20, 2021 11:59 pm

Thanks for the reply Steve, what I'm concerned about is the following from the SMF type 101 record. Note the the following reference
THIS RECORD IS COMPRESSED BY CSRCESRV


the following is a code snippet from the record layout for the type 101 records.

FLD: QWAS     LEN(4) TYPE(BIN) DISP(0)
* SMF COMMON HEADER MAPPING MACRO FOR ACCOUNTING  (SMF 101)
FLD: SM101LEN LEN(2) DISP(0)      /*SM101 TOTAL LENGTH*/
FLD: SM101SGD LEN(2) DISP(2)      /*ZZ BYTES*/
FLD: SM101FLG LEN(1) DISP(4)      /*SYSTEM INDICATOR*/
FLD: SM101RTY LEN(1) TYPE(BU) DISP(5)             /*RECORD TYPE X'65'*/
  NOACC
FLD: SM101TME LEN(4) TYPE(B-SECS) DISP(6) DEC(2)
                                  /*TIME SMF MOVED RECORD*/
FLD: SM101DTE TYPE(P-CYYDDD) DISP(10)         /*DATE SMF MOVED RECORD*/
FLD: SM101SID LEN(4) DISP(14)     /*SYSTEM ID (SID)*/
FLD: SM101SSI LEN(4) DISP(18)     /*SUBSYSTEM ID*/
FLD: SM101STF LEN(2) DISP(22)     /*SMF RECORD SUBTYPE*/
FLD: SM101SQ  LEN(4) DISP(24)
COMP: SM101CMP = X'80'        /*THIS RECORD IS COMPRESSED BY CSRCESRV*/
FLD: SM101BUF LEN(4) TYPE(BIN) DISP(24)
                             /*UNCOMPRESSED DATA LENGTH. THIS WILL BE*/
*                              0 FOR UNCOMPRESSED RECORDS.
FLD: SM101END LEN(1) DISP(28)    /*START OF THE SELF DEFINING SECTION*/
**********************************************************************


If SM101BUF > 0, that would seem to indicated that the record was compressed by CSRCESRV.

then the question is how would I go about uncompressing it ?

Chuck Haatvedt
chaat
 
Posts: 27
Joined: Sun Aug 16, 2009 11:07 pm
Location: St. Cloud, Minnesota
Has thanked: 0 time
Been thanked: 1 time

Re: how to decompress DB2 SMF records in assembler program

Postby willy jensen » Sun Feb 21, 2021 4:26 pm

I found the description of the CSRCESRV services in the z/OS MVS Programming: Assembler Services Reference ABE-HSP manual.
They look pretty straightforward to me. I don't have access to a system with DB2 running, so cannot test reading a type 101 - compressed or not.
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post