× 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 Jim,
 
<snip>
By adding the Program SDS and file INFDS structures to the program,
you'll have a lot more information available in the dump - especially
file details from the INFDS including the last operation performed.
</snip>
 
There are two opposing factors you must consider when using an SDS:
 
1) PRO: Increased level of observability and control
 
According to IBM:
A program status data structure (PSDS) can be defined to make program
exception/error information available to an RPG IV program. The PSDS must be
defined in the main source section; therefore, there is only one PSDS per
module. 











A data structure is defined as a PSDS by an S in position 23 of the data
structure statement. A PSDS contains predefined subfields that provide you
with information about the program exception/error that occurred. The
location of the subfields in the PSDS is defined by special keywords or by
predefined From and To positions. In order to access the subfields, you
assign a name to each subfield. The keywords must be specified,
left-adjusted in positions 26 through 39. 


Information from the PSDS is also provided in a formatted dump. However, a
formatted dump might not contain information for fields in the PSDS if the
PSDS is not coded, or the length of the PSDS does not include those fields.
For example, if the PSDS is only 275 bytes long, the time and date or
program running will appear as *N/A*. in the dump, since this information
starts at byte 276.

 
2) CON: Reduced performance
 
Also according to IBM:
 
Call performance with LR on will be greatly improved by having no PSDS, or a
PSDS no longer than 80 bytes, since some of the information to fill the PSDS
after 80 bytes is costly to obtain.
 
 
So, it would appear to be a balancing act - increased level of information
vs reduced program performance. In some circumstances it may be better to
code a PSDS in a program which uses only the first 80 bytes, and include
subfields past byte 80 only if specifically required - such as the job name
or user name. Of course, the performance hit is felt when the program is
initialised, so it is much less of an impact if the program is called
several times and returns with LR off, or if it is a long-running program.
It's just a case of getting the right balance.
 
Cheers
 
Larry
 

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.