× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If you find yourself needing to use the same code for fields with different
names, it may be time to think about replacing the subroutine with a
procedure.

> -----Original Message-----
> From: Booth Martin [mailto:booth@MartinVT.com]
> Sent: Wednesday, November 28, 2001 8:59 AM
> To: rpg400-l@midrange.com
> Subject: Re: Renaming fields
>
>
> Others have learned that with my code suggestions, best to
> try it - results
> are not always as predicted.  :)
>
> My own preference would be to have a Data Structure, and
> stand-alone fields
> named for the way they'll be used, so as to keep my logic
> clearer in  my
> head as I write.  (See the D-specs in the example I included)
> In that fasion
> I don't need to fuss with prefixes, and can use Sub-routines
> freely without
> having to keep re-copying them for each prefix.
>
> I believe that you can also use the PREFIX keyword in the
> Data Structure,
> but I haven't tried it so best try it out to see what happens.
>
>
>
> --------------------------------------------
> Booth Martin
> MartinB@Goddard.edu
> 802-454-8315 x235
> --------------------------------------------
> -------Original Message-------
> From: rpg400-l@midrange.com
> Date: Wednesday, November 28, 2001 11:38:32 AM
> To: rpg400-l@midrange.com
> Subject: Re: Renaming fields
> Booth
> Can I use the ReName and the Prefix at the same time,
> cause now I need to also rename the record format and
> I still would like the fields to have a separate name just
> to keep it from being confusing.
> Thanks
> Troy Dills
> Julius Blum Inc.
> "Booth Martin"
> <booth@MartinVT.c To: <rpg400-l@midrange.com>
> om> cc:
> Sent by: Subject: Re: Renaming fields
> rpg400-l-admin@mi
> drange.com
> 11/28/2001 11:50
> AM
> Please respond to
> rpg400-l
> Here's another choice. In the DDS for the logicals, don't mention the
> fields at all, just use the same format name as in the
> Physical file. Then
> in the programs, rename the formats. In that case of course
> you need to be
> sure which format you just read. I also use an Externally
> Described Data
> Structure to keep the values saved for undo, etc.
> FGCKF UF A E DISK INFDS(INFDS)
> FGCKFL1 IF E K DISK Rename(RGCKF:RGCKF1)
> FGCKFL2 IF E K DISK Rename(RGCKF:RGCKF2)
> FGCKFL3 IF E K DISK Rename(RGCKF:RGCKF3)
> DRecordDataDS E DS ExtName(GCKF)
> D SavedData S Like(RecordDataDs)
> D ChangedData S Like(SavedData)
> D CheckData S Like(SavedData)
> --------------------------------------------
> Booth Martin
> MartinB@Goddard.edu
> 802-454-8315 x235
> --------------------------------------------
> -------Original Message-------
> From: rpg400-l@midrange.com
> Date: Wednesday, November 28, 2001 10:58:41 AM
> To: rpg400-l@midrange.com
> Subject: Renaming fields
> Hi all
> Could someone help me with renaming all the fields in a
> particular file.
> I have a file Name of PRDMCHM and a Logical File PRDMCHL3.
> I would like to rename all the fields in PRDMCHL3 because all the
> fields have the same name as in PRDMCHM ( which is obviously
> what the Logical file based on.) Could someone give me an example
> of how you would do this. I'm not sure if I could do it in
> the F specs or
> should I do it in the D specs. I'm using RPGIV v5r1. All
> responses will
> be greatly appreciated.
> Thanks
> Troy Dills
> Programmer
> Julius Blum Inc.
> _______________________________________________
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.