Yep, Iâve noted it yet (ascii x ebcdic).
Now In ascii
L R1,=X'FFFFFFFF'
LA R4,KEY
LA R5,L'KEY
CKSM R1,R4
BNZ *-4
DC 2H'0'
DC C'ABCDEFGHIJKLMNOPQRZTUVWXYZ'
KEY DC X'4142434445464748494A4B4C4D4E4F5051525A5455565758595A'
The result is xâ1D23D6D6â. The same as the âbeforeâ APAR said.
Note that Iâm not using DB2 neither have the sysdummy tables.
Iâm just trying to use CRC-32 in batch ASM but cannot achieve the same DB2 result.
Maybe DB2 uses another implementation instead of the CKSM instruction??
Should it be the same result?
De: hercules-***@yahoogroups.com [mailto:hercules-***@yahoogroups.com]
Enviada em: quinta-feira, 4 de outubro de 2018 19:38
Para: hercules-***@yahoogroups.com
Assunto: [hercules-390] Re: CRC32 CKSM instruction
The data representation of table SYSDUMMYU is Unicode so in the example cited
HEX(HASH_CRC32('ABCDEFGHIJKLMNOPQRZTUVWXYZ'))
would compute CRC32 on the Unicode prepresentation. Your Assembler program with compute CRC32 on the EBCDIC representation and will give a different result.
IIRC, the Unicode representation of English alphabetic characters is the same as the ASCII representation. If you replace C'ABCDEFGHIJKLMNOPQRZTUVWXYZ' with X'...' where ... is the hex representation of each letter I would think you would get the same result as the DB2 APAR.
Jim
---In hercules-***@yahoogroups.com <mailto:hercules-***@yahoogroups.com> , <***@... <mailto:***@...> > wrote :
Hi
Iâm using Hercules 3.12 on Linux and trying to use the CKSM asm instruction to get the CRC32 result.
As per IBM DB2 APAR
http://www-01.ibm.com/support/docview.wss?uid=swg1PI77633
After this apar,
SELECT HEX(HASH_CRC32('ABCDEFGHIJKLMNOPQRZTUVWXYZ'))
FROM SYSIBM.SYSDUMMYU;
The result returned should be: xB4B86309
My pgm below:
SR R1,R1
LA R14,KEY
LA R15,L'KEY
CKSM R1,R14
BNZ *-4
S0C1 DC H'0'
KEY DC C'ABCDEFGHIJKLMNOPQRZTUVWXYZ'
After running it shows R1 = xâCCDA0605â as the result and not xB4B86309 as expected.
I wonder if it could be any Hercules issue.
Any tips welcome
TIA
João
---In hercules-***@yahoogroups.com <mailto:hercules-***@yahoogroups.com> , <***@... <mailto:***@...> > wrote :
Hi
Iâm using Hercules 3.12 on Linux and trying to use the CKSM asm instruction to get the CRC32 result.
As per IBM DB2 APAR
http://www-01.ibm.com/support/docview.wss?uid=swg1PI77633
After this apar,
SELECT HEX(HASH_CRC32('ABCDEFGHIJKLMNOPQRZTUVWXYZ'))
FROM SYSIBM.SYSDUMMYU;
The result returned should be: xB4B86309
My pgm below:
SR R1,R1
LA R14,KEY
LA R15,L'KEY
CKSM R1,R14
BNZ *-4
S0C1 DC H'0'
KEY DC C'ABCDEFGHIJKLMNOPQRZTUVWXYZ'
After running it shows R1 = xâCCDA0605â as the result and not xB4B86309 as expected.
I wonder if it could be any Hercules issue.
Any tips welcome
TIA
João