Discussion:
DFSORT by example ?
Add Reply
m***@gmail.com
2017-12-01 19:35:01 UTC
Reply
Permalink
Raw Message
Hello

I am trying to use DFSORT to work with a variable length file.
I want to first filter on the right 'type' of record (it has SMF records in it and I'm interested in just SMF type 30 records) and then sort/sum up records based on various fields.

I am not quite sure what the 'right' way to do this is - in particular, how to filter the 'short' records out first before I sort on the SMF type 30 records? If I just try to SORT right away, DFSORT is unhappy because some of the records are shorter than the offset into the record that the field is at (offset 325). I played with the VLSHRT option but it still seemed unhappy.

Should I be running the file through some other utility first to filter out the non-SMF type 30 records or should I do this filtering first in DFSORT?

As a DFSORT newbie - the manual is a bit overwhelming so if someone has a good tutorial on this type of scenario, which I would think must not be uncommon, please point me to that.

thanks, mike
Mike Fulton
2017-12-01 19:57:09 UTC
Reply
Permalink
Raw Message
Post by m***@gmail.com
Hello
I am trying to use DFSORT to work with a variable length file.
I want to first filter on the right 'type' of record (it has SMF records in it and I'm interested in just SMF type 30 records) and then sort/sum up records based on various fields.
I am not quite sure what the 'right' way to do this is - in particular, how to filter the 'short' records out first before I sort on the SMF type 30 records? If I just try to SORT right away, DFSORT is unhappy because some of the records are shorter than the offset into the record that the field is at (offset 325). I played with the VLSHRT option but it still seemed unhappy.
Should I be running the file through some other utility first to filter out the non-SMF type 30 records or should I do this filtering first in DFSORT?
As a DFSORT newbie - the manual is a bit overwhelming so if someone has a good tutorial on this type of scenario, which I would think must not be uncommon, please point me to that.
thanks, mike
I will be more specific about VLSHRT. I am trying this:
OPTION VLSHRT
SORT FIELDS=(341,8,CH,A,330,10,ZD,D)
OUTREC FIELDS=(1,4,331,10,341,8)
and the OUTREC isn't being processed, presumably because some of the records are short, and I see this:
ICE218A 0 80 BYTE VARIABLE RECORD IS SHORTER THAN 348 BYTE MINIMUM FOR FIELDS
amongst the errors.
What's the proper way to filter out the short records? Do I need to go through a temporary file?
Mike Fulton
2017-12-02 22:02:02 UTC
Reply
Permalink
Raw Message
Post by m***@gmail.com
Hello
I am trying to use DFSORT to work with a variable length file.
I want to first filter on the right 'type' of record (it has SMF records in it and I'm interested in just SMF type 30 records) and then sort/sum up records based on various fields.
I am not quite sure what the 'right' way to do this is - in particular, how to filter the 'short' records out first before I sort on the SMF type 30 records? If I just try to SORT right away, DFSORT is unhappy because some of the records are shorter than the offset into the record that the field is at (offset 325). I played with the VLSHRT option but it still seemed unhappy.
Should I be running the file through some other utility first to filter out the non-SMF type 30 records or should I do this filtering first in DFSORT?
As a DFSORT newbie - the manual is a bit overwhelming so if someone has a good tutorial on this type of scenario, which I would think must not be uncommon, please point me to that.
thanks, mike
I am not sure if this was the best way to do this, but I 'sorted things out' after a few false starts. I used INCLUDE with conditionals to restrict the records being processed, then used SORT to sort on the jobname, then SUM to sum up the CPU times, then restricted output to just the 2 records I cared about (the jobname and the cpu time)

OPTION VLSHRT\
OPTION COPY,VLSHRT
INCLUDE COND=(5,1,CH,EQ,C'1',AND,5,2,CH,NE,C'1*')
SORT FIELDS=(340,8,CH,A)
SUM FIELDS=(330,10,ZD)
OUTREC FIELDS=(1,4,340,8,C' ',330,10)

Loading...