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



I have a question about the differences/advantages/disadvantages between
these two methods of utilizing a data-structure template containing field
definitions for a physical file.

_______________

Method 1
-Define the physical file as a template
-Define a template data-structure as LikeRec the defined
file_name.format_name
-Refer to the data-structure when defining other fields

example:
dcl-f CUSTFILE keyed template qualified;
dcl-ds cust_t likeRec(CUSTFILE.CUSTFILER) template;
dcl-s custName like(cust_t.name);

_______________

Method 2
-Define a template data-structure as ExtName the physical file
-Refer to the data-structure when defining other fields

example:
dcl-ds cust_t extName('CUSTFILE') qualified template end-ds;
dcl-s custName like(cust_t.name);

_______________

The few questions I have:
1. Is there a benefit to method 1, considering the requirement to define
the file in the F specs?
2. I would assume in method 1 that since the file is defined as a
template, if a new field were to be added to the file, the program would
not need to be re-compiled unless it needed to refer to that new field.
And I would make the same assumption for method 2, as the file isn't
defined at all. Am I correct in my reasoning?
3. If there is no advantage to method 1, does anybody have a good reason
to use template defined f-specs?
4. Why is the end-ds required at the end of an ExtName data-structure, but
not LikeRec?

Thanks in advance for any insight!

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.