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



Very nice.

That gets me around the ALT keyword but what about using FROMFILE to
load the array? I know I could set up a loop and populate the array
first thing in the program. I was trying to take advantage of the built
in language capabilities.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Monday, October 15, 2007 3:51 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: How to reconcile conflicting array documentation

In this array DS structure, all sub-fields are considered arrays in
their own right. You can lookup on any subfield, which returns an index
value. Then, all other elements that need to be accessed can be ready
using the same index value. Sorting the array also retains the
logically grouped values, so if you need to search by City, then SORTA
city, then lookup on city.

Eric

-----Original Message-----
From: rpg400-l-bounces+edelong=sallybeauty.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+edelong=sallybeauty.com@xxxxxxxxxxxx]On Behalf
Of Rick.Chevalier@xxxxxxxxxxxxxxx
Sent: Monday, October 15, 2007 3:39 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: How to reconcile conflicting array documentation


Booth,

I thought of doing something like this but how do you handle lookup?


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Monday, October 15, 2007 3:04 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: How to reconcile conflicting array documentation

Here's some code I use to avoid using the ALT keyword:
D ds
D aArray dim(1200)
D aName like( NAME ) overlay(aArray)
D aCity like( CITY )
D overlay( aArray: *next)
D aAge like( AGE )
D overlay( aArray: *next) inz
D aPhone like( PHONE )
D overlay( aArray: *next) inz

Rick.Chevalier@xxxxxxxxxxxxxxx wrote:
I'm trying to add a prerun-time array to a program for the first time
in many years. After looking up the the nuances for a prerun-time
array I added the appropriate F and D specs. That's where the trouble

began. I need to add an alternating array which it sounds like I can
do from the documentation on coding a prerun-time array shown below
from the RPG Reference manual. However, the ALT keyword doesn't play
nice with the other keywords I need, specifically FROMFILE. The ALT
keyword documentation specifically says it cannot be used with
FROMFILE.

Am I missing something?

Coding a Prerun-Time Array In addition to the essential array
specifications, you can also code the following specifications or
keywords for prerun-time arrays. On the definition specifications, you

can specify v The name of the file with the array input data, using
the FROMFILE keyword. v The name of a file to which the array is
written at the end of the program, using the TOFILE keyword. v The
number of elements per input record, using the PERRCD keyword. v The
external format of numeric array data using the EXTFMT keyword. v An
alternating format using the ALT keyword.

ALT(array_name) The ALT keyword is used to indicate that the
compile-time or pre-runtime array or table is in alternating format.
The array defined with the ALT keyword is the alternating array and
the array name specified as the parameter is the main array. The
alternate array definition may precede or follow the main array
definition. The keywords on the main array define the loading for both

arrays. The initialization data is in alternating order, beginning
with the main array, as follows: main/alt/main/alt/... In the
alternate array definition, the PERRCD, FROMFILE, TOFILE, and CTDATA
keywords are not valid.



Rick Chevalier

AmeriCredit ITS

817-525-7178




Privileged and Confidential. This e-mail, and any attachments there
to, is intended only for use by the addressee(s) named herein and may
contain privileged or confidential information. If you have received
this e-mail in error, please notify me immediately by a return e-mail
and delete this e-mail. You are hereby notified that any dissemination,
distribution or copying of this e-mail and/or any attachments thereto,
is strictly prohibited.

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