|
Jon Following your advice the other day I abandoned the honking data structure and now just retrieve 10 at a time with a counter controlling where the program is in terms of which 10 occurences to retrieve. I pass a parameter which is a DIM Array occurring 10 thus limiting the size of the structure After reading your reply , would you please give me a example of using LIKEDS as I may be able to improve on what I have done. -----Message d'origine----- De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de rpg400-l-request@xxxxxxxxxxxx Envoyé : mercredi 6 juillet 2005 17:27 À : rpg400-l@xxxxxxxxxxxx Objet : RPG400-L Digest, Vol 4, Issue 781 Send RPG400-L mailing list submissions to rpg400-l@xxxxxxxxxxxx To subscribe or unsubscribe via the World Wide Web, visit http://lists.midrange.com/mailman/listinfo/rpg400-l or, via email, send a message with subject or body 'help' to rpg400-l-request@xxxxxxxxxxxx You can reach the person managing the list at rpg400-l-owner@xxxxxxxxxxxx When replying, please edit your Subject line so it is more specific than "Re: Contents of RPG400-L digest..." Today's Topics: 1. MCH3601 error (Chris Wolcott) 2. RE: Multi Occurrence Data Structure returned from a procedure (Jon Paris) 3. Re: Regarding DDM file & STRISDB (rob@xxxxxxxxx) 4. Re: MCH3601 error (Jeffrey Young) ---------------------------------------------------------------------- message: 1 date: Wed, 6 Jul 2005 10:08:25 -0400 from: "Chris Wolcott" <cwolcott@xxxxxxxxxxxxxxxxxxxxxx> subject: MCH3601 error I have the following RPG copybook that prototypes C library functions: /** * RPG Procedures definitions for accessing IFS files via C functions. * Based on article on iSeriesNetwork.com by Jef Sutherland * If you create an IFS file, specify 'w codepage=1252' on the open, then * close it and reopen with 'a codepage=37'. This will cause the fputs() * function to translate the data from EBCDIC to ASCII and back for fgets(). * Open Modes and their meanings: * 'r' Open existing file for reading - Fails if not found * 'w' Creates empty file for writting - Clears existing file * 'a' Open existing file for appending - Creates file if not found * 'r+' Open existing file for reading/writing - Fails if not found * 'w+' Creates empty file for reading/writting - Clears existing file * 'a+' Open existing file for reading/appending - Creates file if not found * @version V0R0M0 * @see http://www.iseriesnetwork.com/artarchiveImages/2004/jan/17693-fig1.html * @see http://www.iseriesnetwork.com/artarchiveImages/2004/jan/17693-Fig2.html */ D/IF NOT DEFINED(UTL_IFS) D/DEFINE UTL_IFS DifsOpn PR * EXTPROC( '_C_IFS_fopen' ) Open IFS file D * VALUE OPTIONS( *String ) <full filename D * VALUE OPTIONS( *String ) <options DifsClo PR 10I 0 EXTPROC( '_C_IFS_fclose' ) Close IFS file D * VALUE <file pointer DifsDlt PR 10I 0 EXTPROC( '_C_IFS_remove' ) Delete IFS file D * VALUE OPTIONS( *String ) <full filename DifsRd PR * EXTPROC( '_C_IFS_fgets' ) Read IFS file D * VALUE <record pointer D 10I 0 VALUE <size to read D * VALUE <file pointer DifsWrt PR 10I 0 EXTPROC( '_C_IFS_fputs' ) Write IFS file D * VALUE OPTIONS( *String ) <data to write D * VALUE <file pointer > DifsFileErr PR 10I 0 EXTPROC( 'ferror') Chk File Errors D * VALUE <file pointer > DifsSts PR 10I 0 EXTPROC( 'lstat' ) Get File Status D * VALUE OPTIONS( *String ) <STS struc pointer > D * VALUE <file pointer > DifsEOF PR 10I 0 EXTPROC( '_C_IFS_feof' ) End of File Test D * VALUE <file pointer > D p_ifsSts S * Inz( %Addr( ifsSts_t )) D ifsSts_t DS Align IFS Status Structure D st_mode 10U 0 D st_ino 10U 0 D st_nlink 5U 0 D 2A D st_uid 10U 0 D st_gid 10U 0 D st_size 10I 0 D st_atime 10I 0 D st_mtime 10I 0 D st_ctime 10I 0 D st_dev 10U 0 D st_blksize 10U 0 D st_allocsize 10U 0 D st_objtype 11A D 1A D st_codepage 5U 0 D st_reserv1 62A D st_ino_gen_id 10U 0 D/ENDIF All was well until V5R3 (V4R5 to V5R2), now we get this during the call to ferror() after doing an fgets(): >From program . . . . . . . . . : QC2IFS From library . . . . . . . . : QSYS From module . . . . . . . . : QC2IP124 From procedure . . . . . . . : fp124 From statement . . . . . . . : 38 To program . . . . . . . . . . : QC2IFS To library . . . . . . . . . : QSYS To module . . . . . . . . . : QC2IP124 To procedure . . . . . . . . : fp124 To statement . . . . . . . . : 38 Pointer not set for location referenced. Function check. MCH3601 unmonitored by QC2IFS at statement 0000000038, instruction X'0000'. Application error. *N unmonitored by *N at statement *N, instruction X'4000'. Function check. CEE9901 unmonitored by QUIMNDRV at statement *N, instruction X'0CDE'. Exception handler not available because of reason code 5. Function check. CPF2524 unmonitored by QUIMNDRV at statement *N, instruction X'0CDE'. Any ideas? Are these functions no longer supported? I called IBM support and he could not find ANY references to these functions at all. Is there a better way to access the IFS from RPG? ------------------------------ message: 2 date: Wed, 6 Jul 2005 10:32:53 -0400 from: "Jon Paris" <Jon.Paris@xxxxxxxxxxxxxx> subject: RE: Multi Occurrence Data Structure returned from a procedure >> Unfortunately, in the case of MODS, there's no other way to pass them from one procedure to another. So, if you MUST pass a MODS, that's how you have to do it. I have to disagree with this Scott. There is another way - in fact I was coding this very thing last night! You do need to use a pointer in the called procedure to match the incoming parm (which has to be defined as a single instance of the DS) with the actual mapping MODS in the called procedure but it works fine. AS long as you set the occurrence to 1 in the caller it all works fine and while not as completely intuitive as being able to just pass a parm declared as a MODS, the ability to use LIKEDS has significantly improved things. Jon Paris Partner400 www.Partner400.com www.RPGWorld.com ------------------------------ message: 3 date: Wed, 6 Jul 2005 09:39:31 -0500 from: rob@xxxxxxxxx subject: Re: Regarding DDM file & STRISDB The name of the DDM file. Did you try that, and have a problem with it? I know that SQL doesn't like DDM. Are you saying that STRISDB doesn't like DDM? Or haven't you tried it? An alternative is to CRTRPGPGM OPTION(*SRCDBG) or OPTION(*LSTDBG). Read the help on it. With that, you shouldn't need access to the actual source to debug. You could use the command STRDBG OPMSRC(*YES) to debug instead of STRISDB. Slightly different, but as you move from archaic RPG to RPGLE you'll either go the STRDBG route or use the GUI debugger available with CODE/400 or WDSc. Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
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.