|
Hi John,
On 8/4/2011 12:52 PM, John McKee wrote:
In the event that the two digits were 7 and 8, in a character string, the hex values (zoned) would be F7F8. Goal is to convert zoned to unsigned packed, so F7F8 converts to 78 not 4E.
I believe I messed up earlier in terminology.
The cvtch() example that I posted earlier should do this nicely.
H DFTACTGRP(*NO) BNDDIR('QC2LE')
D cvtch PR ExtProc('cvtch')
D target 32767A options(*varsize)
D src_chars 65534A options(*varsize) const
D src_length 10I 0 value
D InputData ds qualified
D zonedVal 2s 0
D result s 1a
/free
InputData.zonedVal = 78;
cvtch( result: inputData: %size(inputData) );
// result = x'78'.
If you need to handle numerics longer than 2 long (this seems likely)
you could simply make 'zonedVal' larger.
Barbara Morris's example will work as well (using an alternative method
of conversion) as well.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.