× 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: Help - Can't see the forest for the trees
  • From: Dennis Munro <DMunro@xxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 18 May 1999 17:56:50 -0500

He is a bit of ILE code that is not working - and I needed it working Monday
for the auditors.

c     saveian       chain     gcrl03                             98
   c                   if        not *in98
   c                   eval      xxcomp = %subst(crsg01:1:1)
   c                   eval      xxfac  = %subst(crsg02:1:2)
   c                   eval      xxdept = %subst(crsg03:1:4)
   c                   eval      xxacnt = %subst(crsg04:1:6)
   c                   eval      xxprod = %subst(crsg05:1:3)
   c                   endif
    *  Check for valid fac/dept number combinations
   c                   if        xxfac = '20' and xxdept = '0200' or

   c                             xxfac = '30' and xxdept = '0200' or

   c                             xxfac = '40' and xxdept = '0200'

    *  Determine the correct account "type"
    *       1=Sales
   c                   if        xxacnt = seg4sls
   c                   eval      xxtype = '1'
   c                   endif
*       2=Built in freight
c                   if        xxacnt >= seg4bif1 and xxacnt <= seg4bif2
c                   eval      xxtype = '2'
c                   endif
   *       3=Cost of goods sold
c                   if        xxacnt >= seg4cog1 and xxacnt <= seg4cog2 or
c                             xxacnt >= seg4cog3 and xxacnt <= seg4cog4
c                   eval      xxtype = '3'
c                   endif
   *       4=Miscellaneouse income
c                   if        xxacnt >= seg4msc1 and xxacnt <= seg4msc2 and
c                             xxacnt <> seg4sls
c                   eval      xxtype = '4'
c                   endif
----------------------------------- more code goes here
-------------------------------------------
    *  Write the data record if all the below apply:
    *        facility <> 80
    *        type is not blank
    *        ledger year is >= to previous year
    *        ledger year is <= to current year
   c                   if        xxfac <> fac80 and
   c                             xxtype <> ' ' and
   c                             xxyear >= previous and
   c                             xxyear <= current
   c                   write     gsbincr
   c                   endif
    *  Reset all the data fields & for the "new" control break
   c                   eval      saveian = sbian
   c                   eval      saveyear = sbyear
   c                   eval      amt = 0
   c                   eval      xxcomp = ''
   c                   eval      xxfac = ''
   c                   eval      xxdept = ''
   c                   eval      xxacnt = ''
   c                   eval      xxprod = ''
   c                   eval      xxtype = ''
    *
   c                   endif
    *

The section of code that checks for valid fac/dept combinations is my
problem.

When I run this through the STRDBG, I see it hit the first line of that
section of code and the next line it hits is the ENDIF associated with it.
If I comment the 3 IF related lines and the ENDIF line, the program works
and writes 1145 records to the file - although I get more records than I
want.  All I want to do is limit the records being written to the file to
the three combinations on the IF statement.  I've put parentheses around the
logical groups and that has done nothing.  I have even coded it to only look
for just xxfac = '20' and that does not work.  Is there a book or web site
that might have examples to look at - I mean real life ones, not the kind
you generally see in some manuals?

I literally can't see the forest for the trees.  Another problem when you
are the only programmer and you don't have somebody in house to look at it.
In similar situations, I've thrown the program away and written a new
program and that seems to change the mindset so I approach it differently
and the new program works.

This is a similar situation.  Is there something I don't understand about
ILE related to IF's, OR's, and AND's that somebody can help me with?  This
is a simple read a record and write a reformatted record if it meets certain
criteria - nothing exotic, until today.

There is a lot about ILE that I have not even scratched the surface on
learning and I accept that but this has me completely frustrated.  It really
seems pretty simple and straight forward and probably is but I sure can't
see it.  Doesn't help to have auditors breathing down your neck looking for
the report either but that goes with the territory.

Thanks for your input.

Dilbert's Words Of Wisdom:
"I love deadlines.  I especially like the whooshing sound they make as they
go flying by."

Dennis Munro    
Badger Mining Corporation
dmunro@badgerminingcorp.com <mailto:dmunro@badgerminingcorp.com>





* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.