|
If the file is externally described, then it will bring in QTY1, QTY2, QTY3... QTY366. There is no way to map them directly into an array named QTY. :( You have to do a data structure D Input E DS ExtName(InputFile) D* .... input data fields will appear here (including QTY1... QTY366) D D pData S * Based(QTY1) D LargeArray S Dim(366) Like(Qty1) based(pData) D WorkArray S Dim(366) Like(Qty1) In your program the array you're filling up with the quantities is named WORKARRAY. You would then just move that array to the LARGEARRAY field and it should work fine---no need to move in a DO Loop. C MOVE WORKARRAY LARGEARRAY Bob Cozzi cozzi@rpgiv.com Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum > -----Original Message----- > From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On > Behalf Of Tyra_Brodsky@vfc.com > Sent: Monday, December 17, 2001 2:01 PM > To: rpg400-l@midrange.com > Subject: Moving array elements to a file > > Hi: > > I have a file that has warehouse, sku and 366 quantity fields (one for each > day of the year). > > My program calculates the quantity in an array (366 elements...one for each > day of the year). > > I know that I can individually move the array elements to the file fields. > I also know I can create a data structure for the file fields and then move > the array to the data structure in a do loop. > > Is there another way where I don't have to redefine my output file? > > Thanks > > Tyra Brodsky > Sr. Programmer Analyst > The North Face, Inc. > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > 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 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.