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




Hitting a problem with the following; I have an external procedure that chains to a program described System/36 file. The chain is successful, but none of the fields are returned??

What do you mean by "external procedure"? Are you talking about a S/36 OCL procedure? Or are you talking about a subprocedure?


I'm not aware of any way to chain to a file in a S/36 OCL procedure, so I'll assume that you mean an RPG IV subprocedure. In which case, this isn't a S/36 program or a S/36 procedure at all. (and throwing the term "S/36" in there will only serve to confuse us.)

Assuming this is an RPG IV subprocedure, the problem is almost certainly due to global vs. local copies of the variables. What do you mean by "external"? Is it in a separate module? Or is it in the same module, but marked with "EXPORT" so that it can be called externally?

If the CHAIN is in a separate module, do you understand that the input specs have to be in the same module as the CHAIN operation? If so, how are you intending to get the fields copied back to the calling program?

If you have each field declared as a parameter to the subprocedure, you must make sure that the parameter names do not match the field names from the input specs. Why? Because the parameters would be considered "local" to the subprocedure. File access always puts data into global variables, never local.

If I change the procedure to a standalone program, the chain is still successful and all fields are retrieved. What am I missing here? Nothing found in archives. Any help much appreciated.

When you change it to a standalone program, the parameters become global as well, and therefore there's no conflict.

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.