|
"Rules file" MFD = master file (MMST) field name MFV = master file field value EFIL = environment file name EFD = environment file field name EFVL = environment value calue Example 1: MFD='BRAND' MFV='HILFINGER' EFIL='INVMST' EFD='BUYER" EFVL=99 In this case if SKU selected record field BRAND="HILFINGER" then update/write record to INVMST setting BUYER field = 99 Example 2: MFD=''VCUR" MFV='US"' EFIL='INVSKU' EFD='FLAG1" EFVL='Y' In this case if SKU selected record field VCUR="US" then update/write record to INVSKU setting FLAG1 field = 'Y' Right now leaning towards the esteemed Mr. Cozzi's idea of embedded SQL in RPG (prob mean more ? later as its been a while......) Should get to test this afternoon and let y'all (had to slide some of that suthern in, makes feel a little warmner at elast!!!) Mark Allen <allenmar@xxxxxxxxx> wrote: Not just based on SKU could be for example if this SKU in MMST field Brand="RAYBAN" then in file INVMST field Buyer=99 hope that makes sense Holden Tommy wrote: First off I have to assume that you are trying to display default values based on the SKU. The model below would require excessive (& hard to maintain) coding to accomplish this or using dynamic SQL which for this purpose (IMO would perform very poorly...) or use a different model. What you *could* possibly do is this: Create a defaults table Keyed by MFD,MFV,EFL With the fields: MFD, MFV,EFL, RCDDTA(which holds the entire record defaults) In your program define an externally defined DS of the file name (use a prefix to make life easier...) you are grabbing defaults for Chain the defaults file & eval the external DS with RCDDTA. HTH Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+tommy.holden=hcahealthcare.com@xxxxxxxxxxxx] On Behalf Of Mark Allen Sent: Tuesday, October 25, 2005 9:37 AM To: rpg400-l@xxxxxxxxxxxx Subject: Populating fields based on field name in a file I have a "rules" file whichcontains the following fields: MFD - master field name (a field name in file MMST) MFV - value for field name above EFL - environment file name (could be 1 of 7 for example INVMST) EFD - environment field name (field name from file named above i.e. DEPT) EFV - environment field value (value for field name above) the user selects a record in the MMST file (ie. SKU: 12345) and it shoudl then populate based on the rules each fo the fields/values in the appropriate environment file: Example: Rules file: MFD=CORG MFV=US EFL=INVMST EFD=BUYR EFV=123 So if the CORG field='US' in the SKU record selected from the MMST file I want the BUYR field in INVMST to be set to 123 What I have "tentatively" done (and I don't like it) is shown as a "small snippet" below, FYI In the MMST file I have 20+ fields and I have (as of right now) 7 environment files which have multiple (5-50 approx. fields) IF MFD='CORG' and CORG (a fld in MMST) = MFV and EFD='BUYR' eval BUYR=EFV endif My "befuddled" mind right now sees that I would ahve to this the above for EVERY field in in every file?? Gotta be an easier way???????????// --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. -- 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-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.