Hi Bruce,
Yes, I can admit that there is incompatibility with IBM regarding
COMP-5 which Roger introduced back in 2007 implementing USAGE
BINARY-CHAR
And "as is" it is not easy to fix without making BINARY-CHAR as
2-bytes.
So far nobody complained :-)
COMP-5 is considered as "native binary", so "binary-byteorder" also
does not affect it.
Switch to COMP-4, especially if you need big-endian.
Regards,
Sergey
On 5/13/2018 2:08 PM, Bruce Zupek
wrote:
Having a wee bit of an issue with binary data field size
allocation.
\GNUCOBOL\BIN\cobc %1 %2 %3 -fbinary-size=2-4-8 -fbinary-byteorder=big-endian
-fsource-location -Xref --tsymbols -fsign=ebcdic -fcomplex-odo
-fimplicit-init -fsticky-linkage -fperform-osvs -fmove-ibm
-fhostsign -fnotrunc -fno-recursive-check -fdefaultbyte=00
PD-CURSOR-ROW PIC 9(02) COMP-5.
PD-CURSOR-ROW SIZE :=1
# Binary byte size - defines the allocated
bytes according to PIC
# Value: signed unsigned bytes
# ------ -------- -----
# '2-4-8' 1 - 4 same 2
# 5 - 9 same 4
# 10 - 18 same 8
#
# '1-2-4-8' 1 - 2 same 1
# 3 - 4 same 2
# 5 - 9 same 4
# 10 - 18 same 8
With the -fbinary-size=2-4-8 set I am getting a result as if 1-2-4-8.
I would have expected the size to be 2 bytes yet execution
indicates a length of 1.
The behavior of 2-4-8 not being recognized is significant.
Offsets and data field lengths are inconsistent with MF,
Fujitsu, and zOS when a binary data field has a PIC(nn) where
nn is 2 or less.
Please advise.
Thank You.
Bruce Zupek
c:\>CALLEDIT
318
PD-CURSOR-ROW PIC 9(02) COMP-5.
PD-CURSOR-ROW SIZE :=1
10 PD-SET-CURSRPOS PIC X(01).
10 PD-CURSOR-ROW PIC 9(02) COMP-5.
10 PD-CURSOR-COL PIC 9(02) COMP-5.
10 XX-BEEP PIC X(01).
10 XX-EATTR PIC X(01).
10 XX-SL4 PIC X(01).
10 PD-CAPS-OFF PIC X(01).
10 PD-OLD-CURSOR-POS.
15 PD-OLD-ROW PIC 9(02) COMP.
15 PD-OLD-COL PIC 9(02) COMP.
PROCEDURE DIVISION USING
EDITSVC-PCDSN
EDITSVC-NEW-FILE
EDITSVC-EXIT-CODE
EDITSVC-EXIT-KEY
EDITSVC-EXIT-COMMAND.
DISPLAY LENGTH OF PD-FIXED UPON CONSOLE
DISPLAY 'PD-CURSOR-ROW PIC 9(02) COMP-5.'
UPON CONSOLE
DISPLAY 'PD-CURSOR-ROW SIZE :=' LENGTH OF
PD-CURSOR-ROW
UPON CONSOLE
ACCEPT ERROR-PAUSE
|