× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The data structure and the documentation for the exit point I'm trying to
work with actually define the field as being binary AND 4 bytes long.  It is
not an integer, so I didn't want to use 10I 0.  It contains hex codes that
are to be compared to X'1800', X'1803', etc.  I'm not sure yet if those hex
codes are in the first two bytes of the field or the last two.  

At this point, I'm just trying to get a look at the hex codes that actually
come through from the exit point call to see what they look like.  I was
trying to convert the entire 4-byte field (positions 29-32 of the data
structure) to character just to include it in a log file I can review. Since
this is coming in from ODBC connections, it is extremely hard to debug
interactively.

> -----Original Message-----
> From: Joe Pluta [SMTP:joepluta@PlutaBrothers.com]
> Sent: Thursday, January 30, 2003 3:58 PM
> To:   RPG programming on the AS400 / iSeries
> Subject:      RE: Convert hex to char (cvtch)
> 
> > From: Smith, Nelson
> >
> > I'm trying to use cvtch to convert hex data to character, and I'm
> > getting a space offset error.
> 
> This is the dreaded 'B' binary data type issue.
> 
> D  hexFunctCode                  4B 0
> 
> The above does NOT define a binary field 4 bytes long.  It defines a
> binary
> field which can hold four digits of information, which is actually a
> two-byte field.  So you want to be converting a 2-byte hex field into a
> 4-byte character field.  Change your code as shown:
> 
> 
> D  hexFunctCode                  4B 0
> D  alp2HexBytes                  2A   OVERLAY(ds_ZDAQ0200:29)
> 
> D  alp4CharBytes  S              4A   INZ
> 
> C                   CALLP     cvtch(%ADDR(alp4CharBytes)
> C                                  :%ADDR(alp2HexBytes)
> C                                  :%Len(alp4CharBytes)  )
> 
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.


************************************************************************************************************************************************************************************************************
This message originates from Lincare Holdings Inc. It contains information 
which may be confidential or privileged and is intended only for the individual 
or entity named above.
It is prohibited for anyone else to disclose, copy, distribute or use the 
contents of this message. 
All personal messages express views solely of the sender, which are not to be 
attributed to Lincare Holdings Inc., and may not be copied or distributed 
without this disclaimer. 
If you received this message in error, please notify us immediately at 
MailAdmin@lincare.com or (800) 284-2006.
************************************************************************************************************************************************************************************************************


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.