There is a module, Convert::IBM390, that supports various conversion functions for data to/from a mainframe. One is packeb:
use Convert::IBM390 qw(packeb); my $comp3 = packeb( 'p4', 240 ); #77 A PIC S9(7) COMP-3. print $comp3; __END__ ~~output~~ 0x0000240c (of course, in binary)
It works well, and handles negative values.
Good luck. -c
In reply to Re: Pack decimal possibility
by chuckbutler
in thread Pack decimal possibility
by mikeward61
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |