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



Scott Klement wrote:
starting in 7.1, you don't need the prototype (PR) at all (unless you
want to use it to make calls). You can just code the PI and leave off
the PR entirely.

Barbara Morris wrote:
And in that case, you can also leave off the name on the PI, and then
you don't have to worry about the name matching.

In 7.1, there's basically two possibilities:

1. If you are going to use the prototype to call the program, or if you
might in the future: Put the prototype in a copy file with the EXTPGM
keyword, and a prototype name that matches the program. The PI name in
the source must match the prototype name in the copy file.

2. If you are _never_ going to use the prototype to call the program:
Don't code a prototype, and don't bother putting a name on the PI.

To further qualify the comments from Scott and Barbara, at V7.1 the Prototype can be dropped _provided_ the program is created to run in a non-default activation group:
=========================================
// Module/Program: ENTRYPARM5
// No Prototype
// Source will NOT compile with DFTACTGRP(*YES)
H DftActGrp(*No)
D Pi
D String 10A Const
/Free
Dsply String '*REQUESTER';
*InLR = *On;
/End-Free
=========================================
The above example can be compiled (CRTBNDRPG) and run from the command line:
call entryparm5 parm('INPUT')

Now, what we _can_ do and what we _should_ do are different things. I would suggest Barbara's first point is a good approach for consistent and maintainable code.
Brian Parkins.



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.