|
As other have pointed out, you need to change your '4B 0' entries to '10i 0'. You also need to change some of your initialization values. You are currently initializing RecCount to 100 meaning that you are passing 100 keys to the API. You are actually only sending 1 and so RecCount should be set to 1. You also have VarLenRecLen being set to 285. This should be 46 (the summed sizes of VarLenRecLen, Key, KeyLen, FileElemCount, Filename, Library, and Member). Making these changes should get you quite a bit along in retrieving the journal entries. CarollaT@medameri ca.com Sent by: To rpg400-l-bounces@ CarollaT@xxxxxxxxxxxxxx, midrange.com rpg400-l@xxxxxxxxxxxx cc 05/07/2004 11:26 Subject AM RE: Journal API Troubleshooting Please respond to RPG programming on the AS400 / iSeries Thanks Scott!! That worked. Using APIs is pretty cool! The descriptions provided by IBM are sure difficult to decipher. Now I am trying to send a selection parameter, selecting one file (parm 5), and the API document seems to outline it as follows: Journal Entries to Receive Char(*) Format: Bin(4) Number of Variable Length Records Char(*) Variable Length Records Format: Bin(4) Length of Variable Length Record Bin(4) Key Bin(4) Length of Data Char(*) Data Format: Bin(4) Number in array 10A Filename 10A Library 10A Member Whew. It took two cups of coffee to extract all that from the document, but I translated it into the following data structure: D JournalSelect DS Qualified D RecCount 4B 0 Inz(100) D VarLenRecLen 4B 0 Inz(285) D Key 4B 0 Inz(16) D KeyLen 4B 0 Inz(34) D FileElemCount 4B 0 Inz(1) D Filename 10A Inz('TRANS') D Library 10A Inz('E06FILES') D Member 10A Inz('TRANS') When I add the JournalSelect to the Call(P) statement, I get the following error: CPF3C82 - Key 123865 not valid for API QjoRetrieveJournalEntries Now, the value 16 is supposed to be sent as the key. So I tried viewing the data structure in hex, and attempted to decode the value 123865 into binary, then hex, to determine where it is grabbing the key value from, to adjust my data structure, but I am not sure how the binary coding works for negative-capable fields. So I am stuck again, any help would be greatly appreciated. Tony Carolla MedAmerica Billing Services, Inc. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.