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


  • Subject: Re: File fields are not global?
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Thu, 11 Jan 2001 16:21:38 -0600 (CST)


fields in a file are global to the program.  I've done what you're trying
to do, and it works.

A few things you might check:

1)  make sure you aren't accidentally re-defining the fields in the 
      subprocedure.  (File fields are defined & populated at the global
      level, but if the subprocedure has its own definitions, it'll
      use those instead of the globals)

2)  watch out that you don't use pointers or parameters to overwrite
      another variable's area of memory.  

     for example, this is very likely to screw up the value of field2:
     D field1          S             10A
     D field2          S              7P 0
     D field3          S             11A   BASED(pointer)
     D pointer         S               *

     C                   eval      pointer = %addr(field1)
     c                   move      *blanks       field3

     or perhaps even harder to find whilst debugging:
     D field1          S             50A
     D field2          S              7P 0
     c                   callp     myproc(field1: field2)A

     P myproc          B
     D myproc          PI
     D   field1                   32766A   options(*varsize)
     D   field2                       7P 0    
     C                   eval      field1 = *Blanks
     P                 E


On Thu, 11 Jan 2001 Contractor1@Parkdalemills.com wrote:

> I'm chaining to a file in a subprocedure and using values from that file as
> key values to another file. But when I chain the second file I'm getting a
> decimal data error because the field is not populated. Are file fields not
> global?
> 
> Patrick Conner
> www.ConnecTown.com
> (828) 244-0822
> 
> 

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

Replies:

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.