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



Hi Stefan

Very interesting. I think I applied a requirement where it is not needed - in other "reserved" variables, they do need to be nulls - even Bruce Vining, who wrote 2nd Edition of APIs at work, doesn't set that position 16.

I live and learn!

I looked at the documentation for this API and see nothing about length of the returnvalue parameter, and I don't know how it could affect another parameter - this is odd - but I'm glad you made it work!

Cheers
Vern

On 6/19/2023 1:55 AM, stefan@xxxxxxxxxx wrote:
Hej Vern!

Thanks a lot for your time and effort!
Interesting thing is that the CPF3CF1 message is the only error shown.
Even more interesting is that when I reduce the size of the returnvalue ( first parameter ) to 10000 then everything works.
So an errormessage in error doesn't make it right.....

All the best,

Stefan

-- No trees were killed in the sending of this message, but a large number of electrons were terribly upset. Stefan Tageson +46 732 369934 stefan@xxxxxxxxxx -----Original Message----- From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vern Hamberg via RPG400-L Sent: Sunday, June 18, 2023 11:35 PM To: rpg400-l@xxxxxxxxxxxxxxxxxx Cc: Vern Hamberg <vhamberg@xxxxxxxxxxxxxxx> Subject: Re: FW: QzsrGetEnvCCSID error code issues He Stefan First, that message is probably the last of some messages - one of them might me MCH5601, which has says a template is invalid and has more information. /_*But I think I know already - your data structure is missing position 16*_//__/- that is defined as a reserved subfield of length 1 in the API documentation for the error code parameter - *All* reserved subfields *must* be all hex 0's. I strongly recommend looking at the QUSEC data structure in the QUSEC member of QSYSINC/QRPGLESRC - it *is* fixed-format RPG, yes, but it has everything you have to have - when building a free-form version, just be sure to include everything. HTH Vern On 6/18/2023 3:25 PM, stefan@xxxxxxxxxx wrote:
Hi all!


I’m trying to receive some environment variables while taking care of the ccsid for those environment variables.

Surprisingly – the net result so far is CPF3CF1 Error code parameter is not valid.

Please tell me what I’m doing wrong:


dcl-pr getenv extproc('QzsrGetEnvCCSID');

returnvalue char( 65535 );

returnvalue_length int( 10 ) const;

response_length int( 10 );

envvar char( 1024 ) const;

envvar_value_length int( 10 ) const;

envvar_ccsid int( 10 ) const;

returnvalue_ccsid int( 10 ) const;

errorcode likeds( dsEcx );

end-pr;


dcl-ds dsECx qualified;

BytesProvided int( 10 ) pos( 1 );

BytesAvail int( 10 ) pos( 5 ) inz( 0 );

MessageID char( 7 ) pos( 9 );

MessageData char( 240 ) pos( 17 );

end-ds;


// ------------------------------------------------------------------

// * Code *

// ------------------------------------------------------------------


monitor;

dsEcx.BytesProvided = %size( dsEcx );

dsEcx.BytesAvail = 0;

envvar_length = %len( %trim( envvar ));


getenv( returnvalue:

rv_variable_length:

response_length:

envvar:

envvar_length:

0: // ccsid of envvar = 0 = job

ccsid:

dsEcx );


I’m totally lost,


Thanks!


Stefan

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.