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







----- Forwarded by John Fortwengler/incourts on 02/09/2004 08:40 AM -----
                                                                           
             "Jon Paris"                                                   
             <Jon.Paris@Partne                                             
             r400.com>                                                  To 
                                       <jfortwen@xxxxxxxxxxxxxxxxxx>       
             02/07/2004 06:20                                           cc 
             PM                                                            
                                                                   Subject 
                                       RE: Array ? going from RPG to ILE   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hope you got my earlier reply OK.

Just as a follow up - why have the alternating array at all?  Since all the
moth entries are in strict sequence, with a base number of 1, why not just
use the month number as the array subscript?

Something like this is what I normally use (I have an aversion to compile
time arrays).

     D DayData         DS
     D                                9    Inz('Monday')
     D                                9    Inz('Tuesday')
     D                                9    Inz('Wednesday')
     D                                9    Inz('Thursday')
     D                                9    Inz('Friday')
     D                                9    Inz('Saturday')
     D                                9    Inz('Sunday')

     D DayArray                       9    Dim(7) Overlay(DayData)

Reference to the elements is simply Eval DayName = DayAyrray(DayNumber).

Translate "Day" to "Month" etc. and this scenario would work for you.

Frankly I don't use Tables at all - they are only part of RPG IV for
compatibility purposes - a legacy from the days when the language couldn't
support subscripts.

Jon Paris
Partner400
www.Partner400.com

-----Original Message-----
From: jfortwen@xxxxxxxxxxxxxxxxxx [mailto:jfortwen@xxxxxxxxxxxxxxxxxx]
Sent: Friday, February 06, 2004 12:01 PM
To: Jon.Paris@xxxxxxxxxxxxxx
Subject: Array ? going from RPG to ILE








__________________

0051.00  **
                    Hi I saw your class at Common in Indianapolis and it
was great but I'm having a senior moment and am new to ILE
the first example is in my ILE program and I get an error on the TABNBR
entries at the bottom of the program  *RNF0258 30      6 Form-Type entry is
not valid for subprocedures, or is out of
                    sequence.
 I was wondering if I need to do something in D specs instead of items at
the bottom of the program to get the same effect
Thanks in advance for any help you can offer

jfortwen@xxxxxxxxxxxxxxxxxx

0052.00 D TABNBR          S              2  0 DIM(12) CTDATA PERRCD(2)
ASCEND      MTH #S & NAMES
0053.00 D TABNAM          S              9    DIM(12) ALT(TABNBR)
0054.00  *****************************************************************
0055.00  ***     0558.68 c                   return    Wrk#Text
040
0558.69  ***
040
0558.70 P$FirstCap        E
040
0559.00
**************************************************************************
040
0560.00  ***
040
0561.00  *** END OF SOURCE--- TABLE ENTRIES FOLLOW
040
0562.00  ***
040
0563.00
**************************************************************************
040
0564.00  ** TABNBR
040
0565.00   01January  02February
040
0566.00   03March    04April
040
0567.00   05May      06June
040
0568.00   07July     08August
040
0569.00   09September10October
040
0570.00   11November 12December
040
        ****************** End of data
************************************************************************
Below is the old RPG code that works fine in the old pgm
0050.00      E                    TABNBR  2  12  2 0ATABNAM  9   MTH #S &
NAMES
0051.00
*****************************************************************
0052.00       ***
0452.00       ************************************************************
0453.00       ***
0454.00       *** END OF SOURCE--- TABLE ENTRIES FOLLOW
0455.00       ***
0456.00       ************************************************************
0457.00 ** TABNBR
0458.00 01January  02February
0459.00 03March    04April
0460.00 05May      06June
0461.00 07July     08August
0462.00 09September10October
0463.00 11November 12December
        ****************** End of data ***********************************





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.