Hacker News new | ask | show | jobs
by Per_Bothner 318 days ago
"COBOL uses a fixed width character format for all data (yes even for COMP). If you want a four digit number, then you have to use 4 character positions."

That is incorrect. USAGE COMP will use binary, with the number number of bytes depending on the number of digits in the PIC. COMP-1 specifically takes 4 bytes. COMP-3 uses packed decimal (4 bits per digits).

1 comments

That's what the specs say, but I found out it actually didn't work that way when I was working on a transpiler, at least for that installation.