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



Thanks for the tip Bruce, last night I was trying both number of chars and
number of bytes with no success.

Here is my code, it is an typed so formatting in probably off, but it does
compile

DS declaration for type of request

D ConvCaseReqBlock...
D DS QUALIFIED
D RequestType 10i 0 Inz(1)
D CCSID 10i 0
D CaseRequest 10i 0
D Reserved 10a

Api call prototype

D ConvertCase PR
EXTPROC('QlgConvertCase')
D Type
LikeDS(ConvCaseReqBlock)
D Input * value
D Output * value
D InputLength 10i 0 value
D error LikeDS(qusec)

Prototype for my wrapper routine

D ToUpper PR 16383C varying
ccsid(13488)
D Input 16383C varying
options(*varsize)
D ccsid(13488)
D Length 10i 0
Options(*nopass) const

Code for my wrapper

D ToUpper b
D ToUpper Pi 16383C varying
ccsid(13488)
D Input 16383C varying
options(*varsize)
D ccsid(13488)
const
D Length 10i 0
Options(*nopass) const
D rtnVal s Like(Input)
D wrkVal s 16383C ccsid(13488)
D wrkVal2 s 16488C ccsid(13488)
D ConvertType ds
LikeDS(ConvCaseReqBlock)
D error ds likeds(qusec)
D len s 10i 0
/free
ConvertType.CCSID = 13488;
ConvertType.CaseRequest = 0;
If %parms > 1;
Len = length * 2;
Else;
Len = %len(Input) * 2;
Endif;

wrkVal2 = Input;

ConvertCase(ConvertType:%addr(wrkVal2):%addr(wrkVal):len:error);

rtnVal = %subst(wrkVal:1:len);


return rtnVal;



/end-free


Sample call wkUP = ToUpper(wk);

Or

wkUp = ToUpper(wk:50);

both fail with CPF3c12.

In debug with the break point on this line

rtnVal = %subst(wrkVal:1:len);

ConvertType.RequestType = 1;
ConvertType.CCSID = 13488;
ConvertType.CaseRequest = 0;
ConvertType.Reserved = ' '

Len = 34;

Error.Qusbprv = 1077952576;
Error.qusbavl = 20
Error.qusei = 'CPF3c12'
Error. = '0'
Error.msgdata = *allblanks


Qusbprv looks dodgy to me. Put apart from that I can't figure out where I am
going wrong



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Bruce Vining
Sent: 13 December 2009 03:23
To: Midrange Systems Technical Discussion
Subject: Re: QlgConvertCase - Example using Character data CCSID(13488)

There's nothing wrong with your prototype. Without seeing your code it's
hard to say what might be wrong but one thought that comes to mind is -- you
are passing the length parameter in bytes rather than characters aren't you?
13488 will always be an even number of bytes while the number of characters
may be odd. This API does do some "sanity" checking and may very well be
checking to make sure you have an even number specified.

If you continue to have problems feel free to send me more of your code. I
have had lots of experience with the API when doing commands such as
http://www.powercl.com/xcl/xclcommands/lwrcasexcl and
http://www.powercl.com/xcl/xclcommands/uprcasexcl.

Bruce

On Sat, Dec 12, 2009 at 6:55 PM, Neill Harper <neill.harper@xxxxxxxx> wrote:

Anybody have an example of a prototype and a call to QlgConvertCase, using
rpg IV character fields that are CCSID 13488.



I can't post a full example of the code I am using at this moment in time,
but I keep getting CPF3C12 returned in qusec.



All the examples I can find on google have the prototype defined as Alpha
fields, like so:



D QlgCvtCase PR ExtProc('QlgConvertCase')
D ctrlBlock Const LikeDS(FRCB_T)
D inString 65535A Const Options(*VARSIZE)
D OutString 65535A Options(*VARSIZE)
D Length 10I 0 Const
D APIError LikeDS(QUSEC)



I have tried



D QlgCvtCase PR ExtProc('QlgConvertCase')
D ctrlBlock Const LikeDS(FRCB_T)
D inString *

D OutString *
D Length 10I 0 Const
D APIError LikeDS(QUSEC)



And



D QlgCvtCase PR ExtProc('QlgConvertCase')
D ctrlBlock Const LikeDS(FRCB_T)
D inString 16383C Const Options(*VARSIZE)

D ccsid(13488)
D OutString 16383C Options(*VARSIZE)

D ccsid(13488)
D Length 10I 0 Const
D APIError LikeDS(QUSEC)



But both give me the same results CPF3C12, Length of data is not valid.



Any help in this area would be very gratefully received.



Neill

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

Follow-Ups:
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.