Another quick and dirty example. Some of these API's are easy to wrap. Especially if you are really just interested in one value. This is all at
https://code.midrange.com/5a75c07d5a.html
Potentially ugly code warning.
1. RPG:
2.
3. **Free
4. Ctl-Opt Nomain
5. Option(*Srcstmt:*Nodebugio:*Noshowcpy) Debug(*yes);
6.
7. // CRTRPGMOD MODULE(KEVIN/RTVJRNRCVI)
8. // CRTSRVPGM SRVPGM(KEVIN/RTVJRNRCVI) EXPORT(*ALL)
9. //
10. // Create or Replace Function KEVIN.RTVJRNRCVI
11. // (RcvLib Char(10),
12. // RcvFile Char(10))
13. // Returns Char(13)
14. // Language RPGLE
15. // No SQL
16. // Not Fenced
17. // External Name 'KEVIN/RTVJRNRCVI(GETDETACHDATE)'
18. // Parameter Style General ;
19.
20. Dcl-Pr RtvJrnRcvA ExtProc('QjoRtvJrnReceiverInformation');
21. *N Char(500); // Data coming back
22. *N Int(10) Const; // Length of data coming back
23. *N Char(20) Const; // Qualified name of the receiver
24. *N Char(8) Const; // Format name
25. // Q&D - no error handling.
26. End-Pr;
27.
28. Dcl-Pr GETDETACHDATE Char(13);
29. Library Char(10);
30. FileName Char(10);
31. End-Pr;
32.
33. Dcl-Proc GETDETACHDATE Export;
34.
35. Dcl-Pi *N Char(13);
36. Library Char(10);
37. FileName Char(10);
38. End-Pi;
39.
40. Dcl-S ReturnValue Char(500);
41.
42. RtvJrnRcvA (ReturnValue
43. :500
44. :FileName + Library
45. :'RRCV0100');
46. Return %Subst(ReturnValue:109:13);
47.
48. End-Proc;
49.
50. SQL Example:
51. with jrnrcv as (SELECT objname FROM TABLE (QSYS2.OBJECT_STATISTICS('MPMSAUDIT ','JRNRCV') ) )
52.
53. select objname, kevin.rtvjrnrcvi('MPMSAUDIT',objname) from jrnrcv;
54.
55. Returns:
56. MPMSJR0214 1210816074112
57. MPMSJR0215 1210816110921
58. MPMSJR0216 1210817011129
59. MPMSJR0217 1210817103202
60. MPMSJR0218 0000000000000
On Tue, 2021-08-17 at 13:04 -0600, Jack Woehr via MIDRANGE-L wrote:
Working on automating deleting detached journal receivers *n* months after
they are detached.
I can get a list of the receivers into a pf using DSPOBJD but it doesn't
indicate detach date/time.
I can get the detached time with DSPJRNRCVA but it's a noisy spooled file,
not a pf.
Then there's the Retrieve Journal Receiver Information
(QjoRtvJrnReceiverInformation) API.
It looks to me like I've missed something simple here.
TIA for suggestions.
--
Jack Woehr, IBM Champion 2021
<
https://www.youracclaim.com/badges/528d23d6-087f-4698-8d17-d59688106ac4/public_url>
Absolute Performance, Inc.
12303 Airport Way, Suite 100
Broomfield, CO 80021
NON-DISCLOSURE NOTICE: This communication including any and all
attachments is for the intended recipient(s) only and may contain
confidential and privileged information. If you are not the intended
recipient of this communication, any disclosure, copying further
distribution or use of this communication is prohibited. If you received
this communication in error, please contact the sender and delete/destroy
all copies of this communication immediately.
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.