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



>Who has the slickest ILE method (service program?) to
>Handle record locks? (and would like to share??)

Hi Gerald!
  I won't go into the metaphysical side of this topic except to say that
there cannot ever be a single, simple way to handle record locks.  Here is
an ancient code fragment converted to RPG IV that should get you started:

FMaster    UF   E           K Disk
F                                     INFDS(MasFeedback)

D                SDS
D  StsPgmName       *PROC
D  StsStatus        *STATUS
D  StsErrMsgDta          51     80
D  StsErrMsg             91    170
D  StsJobName           244    253
D  StsJobUsr            254    263

DMasFeedback      DS
D  StsMasStatus     *STATUS
D  StsLockRcds          377    378I 0
D  StsBltBits           384    384
D  StsNbrKeys           387    388I 0
D  StsKeyLen            393    394I 0
D  StsRcdNbr            397    400i 0
D  StsRcdKey            401    512

C     MasKey        Chain     RMASTER                            8081

80 comes on for no record, and 81 comes on for any I/O error.
Interrogate the status codes and the error message for details.

The "SDS" is the program status data structure.  It contains information
about the current state of the program, as well as details for program
messages like "invalid array index" and "divide by zero" which aren't
associated with a particular file.

The other data structure is a file information data structure.  You can have
one for every file in the program.  It holds state information for the
associated file.

These data areas are in rough correspondence to the sections of a formatted
RPG dump.  When you get an I/O error, take option "D" and then you can see
what I mean.  To make the dump more meaningful, consider including h debug.
Then you will get to see the content of all fields, even unreferenced ones.
You may not want to have "debug" in production software, as the compiler
will be filling in unreferenced fields, but it's great for debugging!
  --buck


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.