× 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.



I was thinking about this sort of thing last week in relation to DSPFFD.
This could be more trouble than it's worth. 

Do a DSPFFD to an outfile for the file you need to update.  You can get the
field names, offsets from the beginning of the record, and data types from
this file. 

You need an externally defined data structure over the record format of the
file you need to update.  

You need a pointer and variables based on it of all the data types of the
fields you're interested in.

You need a way to look up the information from DSPFFD.  Let's say an array
with overlays for the field name, offset, and data type.

Field X contains the value 'STATUS'.  Look up that value in the array and
find the offset and data type associated with the field name.

Use the data type information to decide which based variable you need.

Assign the address of the basing pointer to the beginning of the externally
defined data structure + the offset obtained from the array lookup.  

I believe the based variable you selected above should contain the value
you're looking for.  

If you're still with me you might be wondering if this is any better than a
select where you associate text with field names.  I don't know if it is.
It does mean that you don't necessarily need to know the field names in
advance, although in your case you probably do.

I haven't been able to test this, so it may be only smoke and mirrors.

If I remember from my Clipper days, X-base supported a kind of macro on the
fly that would do this sort of thing transparently.  It also meant that in
cases where you built the macro based on user input, "unpredictable results"
was one of the better outcomes you could hope for.   

> -----Original Message-----
> From: Vini.Kolathur@msasaro.com [mailto:Vini.Kolathur@msasaro.com]
> Sent: Thursday, April 13, 2000 2:28 PM
> To: RPG400-L@midrange.com; Lewis Libman
> Subject: Re[2]: Field value
> 
> 
>      Lewis,
>         What i want is something like this ,
>        
>      
>         C        eval fld=%fieldvalue(X)
>      
>                    X=STATUS ; STATUS is the name of another 
> field in the 
>      program/database ..  .
>      
>        The above hypothetical BIF should be assigning the 
> value stored in 
>      the field STATUS to fld. 
> 
> 
> ______________________________ Reply Separator 
> _________________________________
> Subject: Re: Field value
> Author:  "Lewis Libman" <LLibman@behr.com> at ARO-INTERNET
> Date:    4/13/00 12:40 PM
> 
> 
> If you are saying:
>              C                If        Status = 'STATUS' 
>              C                     whatever
>              C                Endif
>      
> Whynot???????????????             
>      
> Lewis Libman
> llibman@behr.com
> 714 545 7101 x2118
>      
> >>> Vini Kolathur <Vini.Kolathur@msasaro.com> Thursday, April 
> 13, 2000 10:09:06 
> AM >>>
>      Hi ,
>         Just wanted to make sure if this is possible in 
> RPG/400 or ILE. Can 
>      i treat the value of a field as a field and do a 
> comparison operation.
>      
>      For eg: Field X= "STATUS" , this STATUS is the name of 
> field using 
>      this can i access the value of the field STATUS.
>      I guess i am clear in my question .
>      
>      
>      Can somebody help me with it.
>      
>      
>      Thank you,
>      Vini
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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 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.