Rexx to extract sequential dataset basis particular d & t



IBM's Command List programming language & Restructured Extended Executor

Re: Rexx to extract sequential dataset basis particular d &

Postby Pedro » Thu May 21, 2020 11:03 am

I recall it was tricky to read SMF data from a rexx program. Though, there may have been improvements in recent years to make it easier.

Here is a gem that I used in the 1990's which uses the SMF dump utility.

/* REXX */
  /*****************************************************************/
  /*  SMF record displayer                                         */
  /*                                                               */
  /*  This program will copy records from the SMF datasets         */
  /*  and display them using ISPF view.                            */
  /*                                                               */
  /*  Install:                                                     */
  /*    copy program to SYSPROC concatenation as member SMFLIST2   */
  /*                                                               */
  /*  customization:                                               */
  /*    Change the MANX names to dataset names used on your        */
  /*    system.                                                    */
  /*                                                               */
  /*  Invocation:                                                  */
  /*    %SMFLIST2  TYPE(30)                                        */
  /*                                                               */
  /*  Author:                                                      */
  /*    Pedro Vera                                                 */
  /*                                                               */
  /*****************************************************************/
Signal On NoValue
parse upper arg  . 'TYPE(' type ')' test

Address TSO
If SysVar('SysISPF') ^= "ACTIVE" then do
    "ISPF CMD(%SMFLIST2 TYPE("type")  )"
    Exit ; end
If test = "TEST" then      trace('r')


/* run SMF copy records utility */
"ALLOC F(MANX) DA('SYS1.MANX') SHR REU"
If rc > 0 Then Do; Say "ALLOC FAILED FOR SYS1.MANX" ;Exit (16) ; end
"ALLOC F(MANY) DA('SYS1.MANY') SHR REU"
If rc > 0 Then Do; Say "ALLOC FAILED FOR SYS1.MANY" ;Exit (16) ; end

lrc = listdsi("smf.outlist")
If lrc > 0 Then
  Do
    "ALLOC F(SYSUT1) DA(SMF.OUTLIST) NEW SPACE(2 1) CYL REU"
    If rc > 0 then
       do;Say "ALLOC FAILED FOR SMF UTILITY FILE" ;Exit (16) ; end
  End
Else
  "ALLOC F(SYSUT1) DA(SMF.OUTLIST) OLD REU"

lrc = listdsi("pnch.cntl")
If lrc > 0 Then
  Do
    "ALLOC F(SYSUT2) DA(PNCH.CNTL) NEW SPACE(1 1) TRACK REU",
                "RECFM(F B) LRECL(80) BLKSIZE(400)"
    If rc > 0 then
      do; say "ALLOC FAILED FOR UTILITY FILE" ; Exit (16) ; end
  End
Else
  "ALLOC F(SYSUT2) DA(PNCH.CNTL) OLD REU ",
                "RECFM(F B) LRECL(80) BLKSIZE(400)"

recs.1 = " INDD(MANX,OPTIONS(DUMP))"
recs.2 = " INDD(MANY,OPTIONS(DUMP))"
recs.3 = " OUTDD(SYSUT1,TYPE("type"))"
recs.0 = 3
"EXECIO "recs.0" DISKW SYSUT2 (FINIS STEM recs."
"FREE F(SYSUT2) "

"ALLOC F(SYSIN) DA(PNCH.CNTL) SHR REU"
"ALLOC F(SYSPRINT) DA(*) REU"
"CALL 'SYS1.LINKLIB(IFASMFDP)'"
"FREE F(MANX MANY SYSUT1)"

/* copy records to from SMF to VB dataset */
"ALLOC F(SYSUT1) DA(SMF.OUTLIST) OLD REU ",
       "LRECL(32756)"

lrc = listdsi("SMF.LIST")
If lrc > 0 Then
  Do
    Address TSO "ALLOC F(SYSUT2) DA(SMF.LIST) NEW",
                 "SPACE(2 1) CYL REU UNIT(SYSDA)",
                 "RECFM(V B) LRECL(32756) BLKSIZE(32760)"
    If rc > 0 then do
        Say "ALLOCATION FAILED FOR SMF OUTPUT FILE"
        Exit (16) ; end
  End
Else
  "ALLOC F(SYSUT2) DA(SMF.LIST) OLD REU ",
                 "RECFM(V B) LRECL(32756) BLKSIZE(32760)"


Say "SMF OUTPUT RECORDS WILL BE IN DATA SET SMF.LIST"
"ALLOC F(SYSIN) DUMMY REU"
"CALL 'SYS1.LINKLIB(IEBGENER)'"
"FREE F(SYSUT1 SYSUT2 SYSIN SYSPRINT)"
Address ISPEXEC "VIEW DATASET(SMF.LIST)"
Exit 0


 
Pedro Vera
User avatar
Pedro
 
Posts: 634
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 46 times

Previous

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post