|
Willie, If you use the record format selector program on the CRTLF FMTSLR(MYPGM) you will not have to change the RPG code. I've done this sort of thing several years ago on S/36 code. The RPG programs were looking at record codes to control what type of record (i.e. H=Header,D=Detail,C=Comment). As I recall, in order to externalize the files I created 3 physical files, HEADER,DETAIL,COMMENT for example. I then created a logical with multiple formats and specified the format selector program. The RPG II did not have to change but I wound up with an externalized database that the client requested. Oh and you can still update/delete/add records this way. Fortunately, I don't see much of this anymore...unfortunately, I still come across it from time to time. I've enclosed some samples of what I'm talking about. You will notice that the record format selector program is not called anywhere. That's because it is called at the database level. Regards, Russell Conerly IBM Certified Specialist Tupelo, MS Header: A R FORMAT1 A TYPE 1 A ORDER 9S 0 A CUSTOMER 10S 0 A ETC 60 Detail A R FORMAT2 A TYPE 1 A ORDER 9S 0 A LINE 5S 0 A ITEM 15S A QTY 9S 0 A DTLETC 41 Comment A R FORMAT3 A TYPE 1 A ORDER 9S 0 A LINE 5S 0 A CMTLINE 3S 0 A COMMENT 62 Logical File A R FORMAT1 PFILE(HEADER) A K ORDER * A R FORMAT2 PFILE(DETAIL) A K ORDER A K LINE * A R FORMAT3 PFILE(COMMENT) A K ORDER A K LINE A K CMTLINE * Format Selector Program: * The length of field RECORD must equal the length of * the longest record expected. D Record s 80 D format s 10 D rcdtype s 1 C *entry PLIST C parm record C PARM FORMAT C movel record rcdtype C select C when rcdtype = 'H' C eval format = 'FORMAT1' C when rcdtype = 'D' C eval format = 'FORMAT2' C when rcdtype = 'C' C eval format = 'FORMAT3' C endsl C eval *inlr = *on Example Usage: Fcombine up f 80 10Aidisk Icombine ns 25 1 CH I 1 1 hdrtype I 2 10 0order I 11 20 0customer I 21 80 hstuff I 1 80 hdrrcd I ns 26 1 CD I 1 1 dtltype I 2 10 0order I 11 15 0line# I 16 30 item I 31 39 0qty I 40 80 dstuff I 1 80 dtlrcd I ns 27 1 CC I 1 1 cmttype I 2 10 0order I 11 15 0cline# I 16 18 0cmtline I 19 80 cstuff I 1 80 cmtrcd C if *in25 C except updhdr C endif C if *in26 C except upddtl C endif C if *in27 C except updcmt C endif Clr return Ocombine e updhdr O hdrrcd 80 O 80 'ABC' O e upddtl O dtlrcd 80 O 80 'DEF' O e updcmt O cmtrcd 80 O 80 'GHI' > Rob, > Thanks for the note. I was hoping I would not have to modify over 100 programs for this project. I could still use the multiple format logical > file for the programs that just read and print, etc. Well, better get to > it.. > Thanks, > Willie.... > > -----Original Message----- > From: rob@xxxxxxxxx [mailto:rob@xxxxxxxxx] > Sent: Wednesday, February 11, 2004 12:02 PM > To: RPG programming on the AS400 / iSeries > Subject: RE: Based-on member control list error > > > Assuming that the part of the message about multiple members is bunk, then > let's tackle the multiple record formats. I think you are going to have to convert from internally defined, and exception output, to externally defined and the use of update and/or write. Because when you do a write you can specify which record format to write. On exception output you cannot. > > Rob Berendt > -- > Group Dekko Services, LLC > Dept 01.073 > PO Box 2000 > Dock 108 > 6928N 400E > Kendallville, IN 46755 > http://www.dekko.com > > > > > > "Willie J. Moore" <WJMoore@xxxxxxxxxxxxxxx> > Sent by: rpg400-l-bounces@xxxxxxxxxxxx > 02/11/2004 02:28 PM > Please respond to > RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> > > > To > "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> cc > > Fax to > > Subject > RE: Based-on member control list error > > > > > > > Sorry about leaving out the 'F' spec. > FORDWRK UF F 192 10AI 1 DISK A > > The file is a logical with two physical files. > > Yes they do. I am maintain code that goes back to the S36. Any new programs are writen using the RPGIII or RPGLE. > Thanks for any help you can provide. > Willie.... > > -----Original Message----- > From: rob@xxxxxxxxx [mailto:rob@xxxxxxxxx] > Sent: Wednesday, February 11, 2004 10:41 AM > To: RPG programming on the AS400 / iSeries > Subject: Re: Based-on member control list error > > > 1) You left out your F spec. That might help us. > 2) People still code RPG like that? > 3) Message is a little confusing. Does that file truly have multiple members? And/or does the file have multiple record formats? > > Rob Berendt > -- > Group Dekko Services, LLC > Dept 01.073 > PO Box 2000 > Dock 108 > 6928N 400E > Kendallville, IN 46755 > http://www.dekko.com > > _______________________________________________ > 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. > > > _______________________________________________ > 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. > > > _______________________________________________ > 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. > > > _______________________________________________ > 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.