|
View previous topic :: View next topic
|
| Author |
Message |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
I've been tasked to split a daily SMF type 208 record dump into datasets, by system. I'm trying to do this via syncsort (coincidentally, 208 records are SyncSort SMF records but that's irrelevant), however, I can't quite figure out how to do so.
This is an example of the sort job I'm currently working on;
| Code: |
//STEP001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=<HLQ>.SEQ.DAILY.SMF208.DUMP,DISP=SHR
//SORTOF01 DD DSN=<HLQ>.SEQ.SMF208.SYSA,
// DISP=(NEW,CATLG),
// SPACE=(CYL,(10,10),RLSE),UNIT=DISK,
// DCB=(LRECL=5000,RECFM=VB)
//SORTOF02 DD DSN=<HLQ>.SEQ.SMF208.SYSB,
// DISP=(NEW,CATLG),
// SPACE=(CYL,(10,10),RLSE),UNIT=DISK,
// DCB=(LRECL=5000,RECFM=VB)
//SORTOF03 DD DSN=<HLQ>.SEQ.SMF208.SYSC,
// DISP=(NEW,CATLG),
// SPACE=(CYL,(10,10),RLSE),UNIT=DISK,
// DCB=(LRECL=5000,RECFM=VB)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(14,4,CH,EQ,C'SYSA')
OUTFIL FILES=02,INCLUDE=(14,4,CH,EQ,C'SYSB')
OUTFIL FILES=03,INCLUDE=(14,4,CH,EQ,C'SYSC')
/*
//
|
And for reference, this is the beginning layout of an SMF type 208 record;
| Code: |
SMF208LEN LEN(2) TYPE(BIN) DISP(0) /*RECORD LENGTH*/
SMF208SEG LEN(2) TYPE(BIN) DISP(2) /*SEGMENT DESCRIPTOR*/
SMF208FLG LEN(1) TYPE(BIN) DISP(4) /*SYSTEM FLAGS*/
SMF208RTY LEN(1) TYPE(BU) DISP(5) /*RECORD TYPE*/
SMF208TME LEN(4) TYPE(B-SECS) DISP(6) DEC(2) /*TIME RECORD WRITTEN TO SMF BUFFER*/
SMF208DTE TYPE(P-CYYDDD) DISP(10) /*DATE RECORD WRITTEN TO SMF BUFFER*/
SMF208SID LEN(4) DISP(14) /*SYSTEM ID*/ |
And this is an example of a couple records when browsed via ISPF;
| Code: |
=COLS> ----+----1----
000001 ....Z....¬SYSA
000002 ....Ìp...|SYSA |
When I run this, the job finishes without issue, however the output datasets are empty.
I could use the IFASMFDP utility, however as far as I'm aware, it cannot split out to multiple datasets by system id (i.e. only one SID can be specified, if any). In order to use IFASMFDP, I would have to have a separate step for every single LPAR. This seems very inefficient, redundant and some that should be easily perform via a sort utility.
Can sort do this? If so, how might I modify my sort card to do so properly? |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1436 Location: Bamberg, Germany
|
|
|
|
| It seems to me the offset is wrong. Instead of position 14, try 15. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2275 Location: USA
|
|
|
|
| AlexSalas95 wrote: |
And for reference, this is the beginning layout of an SMF type 208 record;
| Code: |
SMF208LEN LEN(2) TYPE(BIN) DISP(0) /*RECORD LENGTH*/
SMF208SEG LEN(2) TYPE(BIN) DISP(2) /*SEGMENT DESCRIPTOR*/
SMF208FLG LEN(1) TYPE(BIN) DISP(4) /*SYSTEM FLAGS*/
SMF208RTY LEN(1) TYPE(BU) DISP(5) /*RECORD TYPE*/
SMF208TME LEN(4) TYPE(B-SECS) DISP(6) DEC(2) /*TIME RECORD WRITTEN TO SMF BUFFER*/
SMF208DTE TYPE(P-CYYDDD) DISP(10) /*DATE RECORD WRITTEN TO SMF BUFFER*/
SMF208SID LEN(4) DISP(14) /*SYSTEM ID*/ |
And this is an example of a couple records when browsed via ISPF;
| Code: |
=COLS> ----+----1----
000001 ....Z....¬SYSA
000002 ....Ìp...|SYSA |
|
As shown above, the displacement in your printed example starts with 0, while SORT counts all its displacements starting from 1.
If so, your selection must be
P.S.
You might easily discover this by yourself, just using
| Code: |
| OUTFIL FNAMES=TESTFILE,BUILD=(1,4,C'TEST FIELD=',14,4) |
|
|
| Back to top |
|
 |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
well, that's embarrassing. I changed the offset to 15 and I'm getting records now
Thanks @Joerg.Findeisen & @sergeyken |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2275 Location: USA
|
|
|
|
| AlexSalas95 wrote: |
well, that's embarrassing. I changed the offset to 15 and I'm getting records now
Thanks @Joerg.Findeisen & @sergeyken |
I strongly recommend to start using //SYMNAMES DD field layout definition, even for very first and very primitive tasks.
| Code: |
//SYMNAMES DD *
SMF208LEN,*,2,BI /*RECORD LENGTH*/
SMF208SEG,*,2,BI /*SEGMENT DESCRIPTOR*/
SMF208FLG,*,1,BI /*SYSTEM FLAGS*/
SMF208RTY,*,1,BI /*RECORD TYPE*/
SMF208TME,*,4,BI /*TIME RECORD WRITTEN TO SMF BUFFER*/
SMF208DTE,*,4,BI /*DATE RECORD WRITTEN TO SMF BUFFER*/
SMF208SID,*,4,CH /*SYSTEM ID*/
//* |
|
|
| Back to top |
|
 |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
@sergeyken, thanks this is really interesting
I'll need to do more research into this, but it looks like I might be able to leverage this to handle variable offset files, like how the most (all?) SMF records are written |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2275 Location: USA
|
|
|
|
| AlexSalas95 wrote: |
@sergeyken, thanks this is really interesting
I'll need to do more research into this, but it looks like I might be able to leverage this to handle variable offset files, like how the most (all?) SMF records are written |
One of my projects included conversion of hundreds of COBOL-based report generation programs to their SORT-based versions.
That time I created a REXX procedure to automatically create SYMNAMES equivalents for multiple COBOL copybooks. It's not in my posession by this time, but I remember it was not a big challenge. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|