Kekron,

> I'm looking to get 1 record for each type-subtype combination.
> That is, 1 rec of 30_1, 1 of 30_2, and so on.

AFAIK SMF records which have a subtype are
2,30,32,33,41,42,70-79,84,86,88,89,92,94,96,97,98,106,108 and 113  . If you
have any other record type that have a subtypes then you can add them as a
symbol and also add them to INCLUDE cond.

Most of the records have the subtype at position 23 except for record type
84,   The subtype for record type 84 is at position 25.   So you just need
an INREC statement to build that record type differently.

So you can use the following DFSORT JCL to get the desired results.  A
brief explanation of the job.

STEP0100 - Deletes the output file it existed.
STEP0200 - Extracts 1 sub-type record for each record that has a subtype.
STEP0300 - Verification step that creates 2 reports. Record type count and
another Record type + Sub type Count

You can just run the first 2 steps. the 3rd step is optional


(See attached file: SMFEXT.txt)


Thanks,
 Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <[email protected]> wrote on
04/20/2020 09:32:36 PM:

> From: kekronbekron <[email protected]>
> To: [email protected]
> Date: 04/20/2020 09:33 PM
> Subject: [EXTERNAL] Re: Print/copy one record of each type/subtype
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> Hi Kolusu,
>
>
> We are all forever grateful for your DFSORT help, thank you :)
> I'm looking to get 1 record for each type-subtype combination.
> That is, 1 rec of 30_1, 1 of 30_2, and so on.
>
> A bit disappointed that I can read VB/VBS with RECFM=U in the DD, in
> a JCL (in order to read BDW/RDW), but that throws the whole concept
> of 'logical record'.
> So ... just wondering if there's a way to get sample records with
BDW/RDW.
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, April 20, 2020 11:16 PM, Sri h Kolusu <[email protected]>
wrote:
>
> > Kekron,
> >
> > Are you looking for a summary of subtypes for every smf record? I wrote
an
> > ICETOOL job for Cheryl Watson's newsletter under "User Experiences and
> > Tips" which lists the count how many records it found of each type and
> > subtype and produce a little report saying something like:
> >
> > TYPE SUBTYPE COUNT
> >
> > 30 1 18446
> > 30 2 2788
> > 30 3 49083
> > 30 4 49326
> > 30 5 19162
> > 30 6 210
> > 41 3 41
> > ...
> >
> > or
> >
> > Do you need to write out the first record for each subtype? Let me know
the
> > requiement and I will show you a way to get it done using DFSORT.
> >
> > Thanks,
> > Kolusu
> > DFSORT Development
> > IBM Corporation
> >
> >
>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

> >
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

//   SET SMFDSN=Your VBS SMFDSN
//*
//************************************************************
//* DELETE THE OUTPUT FILE IF IT EXISTED                     *
//************************************************************
//STEP0100 EXEC PGM=IEFBR14
//FILE01   DD DSN=&SYSUID..EXTONE.STYPE.FRTYPE,
//            DISP=(MOD,DELETE,DELETE),
//            SPACE=(TRK,(1,0),RLSE)
/*
//************************************************************
//* EXTRACT 1 RECORD FOR EACH TYPE-SUBTYPE COMBINATION       *
//************************************************************
//STEP0200 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=&SMFDSN
//SYMNAMES DD *
SMFVBRDW,1,4,BI
SMFVBRCL,=,2,BI
  FILLER,*,2,BI
SKIP,1
SMFRCTYPE,*,1,BI
SMFSBTYPE,23,2,BI
SMFTYPMLN,23
SMF002RTY,002
SMF030RTY,030
SMF032RTY,032
SMF033RTY,033
SMF041RTY,041
SMF042RTY,042
SMF070RTY,070
SMF071RTY,071
SMF072RTY,072
SMF073RTY,073
SMF074RTY,074
SMF075RTY,075
SMF076RTY,076
SMF077RTY,077
SMF078RTY,078
SMF079RTY,079
SMF084RTY,084
SMF086RTY,086
SMF088RTY,088
SMF089RTY,089
SMF092RTY,092
SMF094RTY,094
SMF096RTY,096
SMF097RTY,097
SMF098RTY,098
SMF106RTY,106
SMF108RTY,108
SMF113RTY,113
//SYMNOUT  DD SYSOUT=*
//SORTOUT  DD DSN=&SYSUID..EXTONE.STYPE.FRTYPE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(200,100),RLSE)
//SYSIN    DD *
  OPTION VLSCMP,SPANINC=RC0
  INCLUDE COND=(SMFVBRCL,GE,SMFTYPMLN,AND,
               (SMFRCTYPE,EQ,SMF002RTY,OR,
                SMFRCTYPE,EQ,SMF030RTY,OR,
                SMFRCTYPE,EQ,SMF032RTY,OR,
                SMFRCTYPE,EQ,SMF033RTY,OR,
                SMFRCTYPE,EQ,SMF041RTY,OR,
                SMFRCTYPE,EQ,SMF042RTY,OR,
                SMFRCTYPE,EQ,SMF070RTY,OR,
                SMFRCTYPE,EQ,SMF071RTY,OR,
                SMFRCTYPE,EQ,SMF072RTY,OR,
                SMFRCTYPE,EQ,SMF073RTY,OR,
                SMFRCTYPE,EQ,SMF074RTY,OR,
                SMFRCTYPE,EQ,SMF075RTY,OR,
                SMFRCTYPE,EQ,SMF076RTY,OR,
                SMFRCTYPE,EQ,SMF077RTY,OR,
                SMFRCTYPE,EQ,SMF078RTY,OR,
                SMFRCTYPE,EQ,SMF079RTY,OR,
                SMFRCTYPE,EQ,SMF084RTY,OR,
                SMFRCTYPE,EQ,SMF086RTY,OR,
                SMFRCTYPE,EQ,SMF088RTY,OR,
                SMFRCTYPE,EQ,SMF089RTY,OR,
                SMFRCTYPE,EQ,SMF092RTY,OR,
                SMFRCTYPE,EQ,SMF094RTY,OR,
                SMFRCTYPE,EQ,SMF096RTY,OR,
                SMFRCTYPE,EQ,SMF097RTY,OR,
                SMFRCTYPE,EQ,SMF098RTY,OR,
                SMFRCTYPE,EQ,SMF106RTY,OR,
                SMFRCTYPE,EQ,SMF108RTY,OR,
                SMFRCTYPE,EQ,SMF113RTY))

  INREC IFTHEN=(WHEN=INIT,
               BUILD=(01,04,                 $ RDW
                      SMFRCTYPE,             $ RECORD-TYPE
                      SMFSBTYPE,             $ SUB-TYPE
                      5)),                   $ RECORD AS-IS

        IFTHEN=(WHEN=(SMFRCTYPE,EQ,SMF084RTY),
             OVERLAY=(06:28,02))

  SORT FIELDS=(05,01,BI,A,                   $ REC-TYPE
               06,02,BI,A),EQUALS            $ SUB-TYPE

   SUM FIELDS=NONE                           $ ELIMINATE DUPS

  OUTREC BUILD=(01,04,                       $ RDW
                08)                          $ RECORD AS-IS
/*
//************************************************************
//* CREATE 2 REPORTS                                         *
//* RTYPERPT IS REPORT OF EACH RECORD TYPE WITH COUNT        *
//* STYPERPT IS REPORT OF EACH RECORD TYPE AND SUBTYPE COUNT *
//************************************************************
//STEP0300 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=SHR,DSN=&SYSUID..EXTONE.STYPE.FRTYPE
//RTYPERPT DD SYSOUT=*
//STYPERPT DD SYSOUT=*
//SYSIN    DD *
  OPTION VLSCMP,SPANINC=RC0
  INREC IFTHEN=(WHEN=(06,1,BI,EQ,84),        $ IF REC-TYPE 84
         BUILD=(01,04,                       $ RDW
                06,01,                       $ RECORD-TYPE
                25,02)),                     $ SUB-TYPE

        IFTHEN=(WHEN=NONE,                   $ OTHER REC-TYPE
         BUILD=(01,04,                       $ RDW
                06,01,                       $ RECORD-TYPE
                23,02))                      $ SUB-TYPE

  SORT FIELDS=(5,1,BI,A,
               6,2,BI,A)

  OUTREC BUILD=(1,4,
                5,1,BI,EDIT=(IT),
                6,2,BI,EDIT=(IT))

  OUTFIL FNAMES=STYPERPT,
  VTOF,REMOVECC,NODETAIL,BUILD=(80X),
  HEADER2=('TYPE   SUBTYPE         COUNT',/,
           '----   -------   -----------'),
  SECTIONS=(5,4,
  TRAILER3=(03:5,2,
            13:7,2,
            19:COUNT=(M10,LENGTH=10)))

  OUTFIL FNAMES=RTYPERPT,
  VTOF,REMOVECC,NODETAIL,BUILD=(80X),
  HEADER2=(' TYPE       COUNT      ',/,
           ' ----       -----------'),
  SECTIONS=(5,2,
  TRAILER3=(03:5,2,
            13:COUNT=(M10,LENGTH=10)))

/*

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to