Hi Kolusu,

Thank you very much for your help. It works almost as it should. There is a
small glitch and I can not understand why: the year, on the output, has
only the three leftmost positions:

199  DUMMYCG        21588 KB         21 MB        0 GB      0 TB
199  DUMMYCH       260204 KB        254 MB        0 GB      0 TB
199  FDUMMY          8041 KB          7 MB        0 GB      0 TB

Best Regards,
Jack


On Tue, 19 Jul 2022 at 16:39, Sri h Kolusu <skol...@us.ibm.com> wrote:

> >> I would like to add all the space for each year and for each High Level
> Qualifier. Is there a way to do this using DFSORT or ICETOOL
>
> Jack,
>
> It is quite simple and can be done.  Since you haven't specified the
> positions of the data, I assumed the following.
>
> 1. The input file has LRECL=133 RECFM=FBA
> 2. Position 2 thru 10 the space value
> 3. Position 11 has the space unit ( K = KB , M=MB G=GB)
> 4. The dataset name starts in position 13 which has the HLQ
> 5. The year value starts in position 71 thru 74
>
> //STEP0100 EXEC PGM=SORT
> //SYSOUT   DD SYSOUT=*
> //SYMNOUT  DD SYSOUT=*
> //SYMNAMES DD *
> INP-BYTE,02,08,UFF
> FMT-YEAR,134,04,UFF
> SKIP,1
> FMT-HLQ,*,08,CH
> SKIP,1
> FMT-UNT,*,10,UFF
> SKIP,1
> FMT-BYT,*,08,PD
> //SORTIN   DD DISP=SHR,DSN=Your.input.FBA.rmm.report
> //SORTOUT  DD SYSOUT=*
> //SYSIN    DD *
>   INREC PARSE=(%01=(ABSPOS=13,ENDBEFR=C'.',FIXLEN=8)),
>         OVERLAY=(FMT-YEAR:71,04,           # YEAR
>                  FMT-HLQ:%01,
>                  FMT-UNT:11,1,CHANGE=(10,C'K',C'0000001024',
>                                          C'M',C'0001048576',
>                                          C'G',C'1073741824'),
>                                      NOMATCH=(C'0000000001'),
>                  FMT-BYT:INP-BYTE,MUL,
>                          FMT-UNT,TO=PD,LENGTH=8)
>
>   SORT FIELDS=(FMT-YEAR,A,
>                FMT-HLQ,A)
>
>    SUM FIELDS=(FMT-BYT)
>
>   OUTREC BUILD=(FMT-YEAR,
>                 X,
>                 FMT-HLQ,
>                 X,
>                 FMT-BYT,M10,LENGTH=12,
>                 X,
>                 FMT-BYT,DIV,+0000001024,M10,LENGTH=10,C' KB',
>                 X,
>                 FMT-BYT,DIV,+0001048576,M10,LENGTH=08,C' MB',
>                 X,
>                 FMT-BYT,DIV,+1073741824,M10,LENGTH=06,C' GB')
> /*
>
> The output will be shown as
>
> Year , HLQ, Byte-total , Byte-total-in-KB, Byte-total-in-MB,
> Byte-total-in-GB  ( You can pick and choose which ever unit you want) . The
> KB,MB,GB values are in all integers , if you want the decimals also, then
> it is easy to incorporate. Let me know if you are interested in that.
>
>
> PS: It would have been nice if you used a descriptive  topic title rather
> than the PGM name for the topic.  Something like "Summing up values from a
> RMM report using DFSORT"
>
> Thanks,
> Kolusu
> DFSORT Development
> IBM Corporation
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to