|
A couple of conflicting messages from the V5R1 memo to users (It's on IBM's website.) Programming considerations Output file changes Changes made to output files for the V5R1 release may affect your applications. When fields are added to the end of the previous record format, you should specify no level checking (LVLCHK(*NO)) so your applications run the same as they did previously. ... Command and API changes QMAXSPLF and WRKSPLF changes The use of output files QAPTACG4 (field JASPNB), QASYSFJ4 (field SFSNUM), and QSYPOJ4 (field POSPLN) that contain the spooled file number might require application changes. In V5R1, new fields have been added to accommodate a larger spooled file number. If the number is too large for the old field, the old field is set to blank and the new field should be referenced to get the number. To prevent the need for a change to an application, ensure that the system value QMAXSPLF remains set to 9999 (the default value at installation time). Several messages have changed to include a new 4-byte message data field that contains the spooled file number. The old 2-byte fields that already exist are set to -1 when the spooled file number exceeds 32 767. Once the 2-byte field is set to -1, the spooled file number can be accessed through the 4-byte message field. If you decide to use the larger fields, applications that use the open feedback area might require code changes. It is recommended that you use the larger fields, but the smaller fields can still be used. Views 3 and 4 of the Work with Spooled Files (WRKSPLF) display have changed. Previously, view 3 contained the output queue name and library along with the spooled file number. With the increase in the spooled file number, view 3 can no Rob Berendt ================== A smart person learns from their mistakes, but a wise person learns from OTHER peoples mistakes. "Simon Coulter" <shc@flybynight.com To: MIDRANGE-L@midrange.com .au> cc: Sent by: Subject: Re: Journal receiver problems owner-midrange-l@mi drange.com 05/22/01 09:45 PM Please respond to MIDRANGE-L e Hello Ron (and everyone else with an opinion on this topic), The "problem" is in how most midrange programmer's handle outfiles. They build permanent 'work files' and declare the work file in the processing program. WRONG! Here is how it is intended to work: Outfiles are a release independant method of retrieving information. IBM provides template files in QSYS for each of the DSPxxx commands. These files are created without members and with LVLCHK(*NO) specified. Using LVLCHK (*NO) allows IBM to add new fields at the end of the record format. They will not change the existing layout, they will not rename fields, they will not change field attributes. (If they do then generally a Rochester developer got it WRONG and you can APAR them.) Your code should declare the TEMPLATE, not the work file. You issue the DSPxxx command specifying the desired outfile and then OVERRIDE the declared template to the outfile. If you create a work file based on the template (via CRTDUPOBJ or by running the DSPxxx command once to create the work file) then your code will break when the DSPxxx command is enhanced to output additional fields. You should always let the DSPxxx command create the outfile on EVERY run -- unless you are using MBROPT(*ADD) -- to avoid problems with enhanced layouts. If you (and Rochester) follow the rules you won't have a problem with updated outfiles. Using the APIs avoids the issue and probably results in better performance due to reduced I/O but at the expense of increased complexity. Here are some examples of correct processing of outfiles to make the point clear: CL === PGM DCLF QADSPOBJ /*DSPOBJD outfile template */ DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/OBJLIST) OVRDBF QADSPOBJ TOFILE(TQEMP/OBJLIST) READ: RCVF /* do stuff until end of file */ ENDPGM RPG with CL driver ================== PGM DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*ALL) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/OBJLIST) OVRDBF QADSPOBJ TOFILE(TQEMP/OBJLIST) CALL RPGPGM ENDPGM FQADSPOBJ IF E DISK C READ QLIDOBJD C DOW NOT(%EOF(QADSPOBJ)) * Do stuff until end of file C READ QLIDOBJD C ENDDO C SETON LR C RETURN Regards, Simon Coulter. «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» «» FlyByNight Software AS/400 Technical Specialists «» «» Eclipse the competition - run your business on an IBM AS/400. «» «» «» «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ «» «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / «» «» X «» «» ASCII Ribbon campaign against HTML E-Mail / \ «» «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.