Re: SORT SUM Problem

2023-01-31 Thread Jack Zukt
Thank you Sri.
It was as simple as that.
Many thanks
Jack

On Tue, 31 Jan 2023 at 12:46, Sri h Kolusu  wrote:

> Jack,
>
> The issue is you have NOT converted the UFF value to Binary before
> performing the SUM
>
> Here is the change you need (Untested)
>
> //SYSINDD *
>   INREC PARSE=(%01=(ABSPOS=1,ENDBEFR=C'.',FIXLEN=8)),
> BUILD=(FMT-HLQ:%01,
>FMT-BYTE:INP-BYTE,TO=BI,LENGTH=8)
>
>   SORT FIELDS=(FMT-HLQ,A)
>SUM FIELDS=(FMT-BYTE)
>   OUTREC BUILD=(X,
> FMT-HLQ,
> X,
> FMT-BYTE,TO=ZD,LENGTH=16)
> /*
>
> 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


Re: SORT SUM Problem

2023-01-31 Thread Sri h Kolusu
Jack,

The issue is you have NOT converted the UFF value to Binary before performing 
the SUM

Here is the change you need (Untested)

//SYSINDD *
  INREC PARSE=(%01=(ABSPOS=1,ENDBEFR=C'.',FIXLEN=8)),
BUILD=(FMT-HLQ:%01,
   FMT-BYTE:INP-BYTE,TO=BI,LENGTH=8)

  SORT FIELDS=(FMT-HLQ,A)
   SUM FIELDS=(FMT-BYTE)
  OUTREC BUILD=(X,
FMT-HLQ,
X,
FMT-BYTE,TO=ZD,LENGTH=16)
/*

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


SORT SUM Problem

2023-01-31 Thread Jack Zukt
Hi all,
I should probably say "my problem with SORT SUM", as the real problem is
not with SORT.

So, I have an input file with a 100 byte record that has a dataset name on
the first 44 bytes and a numeric value (UFF) on the last ten.
I need to sum up those 10 last bytes by High Level Qualifier.
My problem, after a few variations, is that I cannot get rid of the

ICE152I 0 OVERFLOW DURING SUMMATION - RC=0

message.

This is my latest try:

 //SYMNAMES DD *
 INP-DSN,01,44,CH
 INP-BYTE,91,10,UFF
 SKIP,1
 FMT-HLQ,1,08,CH
 FMT-BYTE,*,08,BI
 TMP-BYT1,=,04,BI
 TMP-BYT2,*,04,BI

//SYSINDD *
  INREC PARSE=(%01=(ABSPOS=1,ENDBEFR=C'.',FIXLEN=8)),
OVERLAY=(FMT-HLQ:%01,
 TMP-BYT2:INP-BYTE) * SUM HLQ ALLOC SPACE
  SORT FIELDS=(FMT-HLQ,A)
   SUM FIELDS=(FMT-BYTE)
  OUTREC BUILD=(X,
FMT-HLQ,
X,
FMT-BYTE,TO=ZD,LENGTH=16)
/*

The SORTOUT is deirected to SYSOUT and it looks something like this:

COMUM9242510529872113
COMUM9242510529872114
COMUM9242510529872114
COMUM9242510529872114
COMUM9242510529871936
COMUM9242510529871936
COMUM9242510529872113
COMUM9242510529872113
COMUM9242510529872113

There are 26 of those when there should be only one (not counting the few
hundreds more repetitions of several HLQs)
So, what am I doing wrong?

Your help will be, as usual, greatly appreciated,
Jack

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