× 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.



I was thinking there was an easier way to convert to hex, I just couldn't find it yesurday. Today I
did (thanks to Jon & Susan for the prototype found here: http://www.ibmsystemsmag.com/i5/8741p1.aspx )

h datfmt(*ISO) option(*SRCSTMT:*NODEBUGIO:*XREF:*SECLVL)
h timfmt(*ISO)
h dftactgrp(*NO) actgrp('TESTRPGLE')
h bnddir('QC2LE')

D CREDGUID s 13a


D myValue s 26a inz('20080618090909123456202020')

D FromHex PR EXTPROC('cvtch')
D CharResult 32767A OPTIONS(*VARSIZE)
D HexInp 65534A OPTIONS(*VARSIZE)
D HexLen 10I 0 VALUE

/free
fromHex(CREDGUID:myvalue:%len(myValue));
*INLR = *ON;
return;
/end-free

HTH,

Charles Wilt
--
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307

wiltc@xxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Wilt, Charles
Sent: Thursday, June 19, 2008 3:38 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: CHAR for BIT DATA fld

Interesting....

GUID/UUID's are 16 bytes, yet you're only storing 13.

Best way to generate them would be to use the GENUUID API.

Only thing I can think of off the top of my head would be to use an array
of 1 byte integers....

D CREDGUID ds qualified
D byte 3u 0 dim(13)


D myValue s 20a inz('20080618090909123456')
D x s 10u 0


/free
For x = 1 to 10;
Credguid.byte(x) = %int(%subst(myvalue:((x*2) - 1):2));
Endfor;
Credguid.byte(11) = 20;
Credguid.byte(12) = 20;
Credguid.byte(13) = 20;
*INLR = *ON;
return;
/end-free

HTH,

Charles Wilt
--
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307

wiltc@xxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx]
On Behalf Of MKirkpatrick@xxxxxxxxxxxxxxxxx
Sent: Thursday, June 19, 2008 2:46 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: CHAR for BIT DATA fld

I have a column defined as CHAR FOR BIT DATA or CHAR(13) CCSID 65535 NOT
NULL. Why? Because this is the way it is defined in another table from
DB2 (Windows) that I am trying to duplicate/populate. W/in my RPG pgm,
the following stmt generates the correct data: CREDGUID =
x'20080618090909123456202020';

My problem is I need to use a variable (TIMESTAMP + 3 chars) part of
the
value used to populate the CREDGUID column. I have tried stringing
together using the '+' char but when the data gets into the column it is
truncated because the working variable is larger than the result
(CREDGUID). I also tried using the HEX SQL BIF without success.

Any ideas or suggestions would be greatly appreciated. Thanks.





This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
Unless you are the addressee (or authorized to receive for the
addressee),
you may not use, copy or disclose to anyone this email or any
information
contained in this email. If you have received this email in error,
please
advise the sender by replying to this email, and delete this email
immediately. Please note that any views or opinions presented in this
email are solely those of the author and do not necessarily represent
those of Western Dental Services, Inc. Finally, the recipient should
check this email and any attachments for the presence of viruses.
Western
Dental Services, Inc. accepts no liability for any damage caused by any
virus transmitted by this email.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail transmission contains information that is intended to be
confidential and privileged. If you receive this e-mail and you are not a
named addressee you are hereby notified that you are not authorized to
read, print, retain, copy or disseminate this communication without the
consent of the sender and that doing so is prohibited and may be unlawful.
Please reply to the message immediately by informing the sender that the
message was misdirected. After replying, please delete and otherwise
erase it and any attachments from your computer system. Your assistance
in correcting this error is appreciated.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.