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



On 29-Jun-2016 12:03 -0500, Rick Crow wrote:
We believe that we may have discovered the reason. For whatever the
reason, it is somewhat difficult to find a proper prototype
definition for CEEMOUT and the one that we have been using and, of
course, copying from program to program, looks like this:

// Call system api to write message to screen or job log
dcl-pr WriteMessage extproc('CEEMOUT') opdesc;
@i_msg char(80) options(*varsize) const;
@i_dest int(10) const; // 1=Inter, 2=JobLog
end-pr;

With the call looking like this:
@i_Msg = 'No files waiting to be processed (STAT_10) in ECP308';
WriteMessage( @i_Msg : @c_ToJobLog );

We did stumble across a definition that does NOT define the message
parameter as being constant OR varying. If that is true than our
program, which believes that it is constant, may use a memory
location that could partially overlap a variable believing that it
won't be changed when, in fact, it could be changed by the API and
thereby change the value of our variable.

Are we correct in our reasoning?


Probably not anything to do with CONST. Instead, the prototype is incorrect, and thus also the invocation.

[http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/CEEMOUT.htm] _Dispatch a Message (CEEMOUT) API_

The first parameter is a data type of VSTRING, which is not the equivalent of CHAR; the above comment and the prototyping seems to conflate /varying/ and /varsize/. I did not lookup what is VSTRING, but I guessed below that the structure would match VARCHAR(80). Also there is an /omissible/ parameter that is unspecified on the invocation, and AIUI the called API needs to have a null value passed, typically achieved by using *OMIT; irrespective of the API requirement for Operational Descriptors, because those would not include any description for an omitted argument.?

I am somewhat confident of the following [even not having looked-up what is the c-struc for VSTRING]:

dcl-pr WriteMessage extproc('CEEMOUT') opdesc;
@i_msg varchar(80) const;
@i_dest int(10) const; // 1=Inter, 2=JobLog
@o_omit char(12) options(*OMIT) ;
end-pr;

@i_Msg = 'No files waiting to be processed (STAT_10) in ECP308';
WriteMessage( @i_Msg : @c_ToJobLog : *OMIT );


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.