× 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: Varying the length in a array
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Fri, 19 Nov 1999 15:06:24 -0500

Ron,
If you're using RPG, you should be able to simply create what ever output
file size your end-user requires.  This code works whether FlatFile is 10
recl or 8000 recl:

FFlatFile  O    F32766        Disk                       
D Array           s          32766a   dim(10)            
D ArraySize       s              7  0                    
D Index           s              7  0                    
D OutputField     s          32766a                      
                                                         
C                   eval      ArraySize = %elem(Array)   
 * Create dummy data                                     
C     1             Do        ArraySize     Index        
C                   MoveL     Index         Array(Index) 
C                   EndDo                                
 * Write out the results                                 
C     1             Do        ArraySize     Index        
C                   MoveL     Array(Index)  OutputField  
C                   Except    WriteRec                   
C                   EndDo                                
                                                         
C                   eval      *InLR = *On                
                                                         
OFlatFile  E            WriteRec                         
O                       OutputField      32766

Buck Calabro
Aptis; Albany, NY

> -----Original Message-----
> From: Klein Ron 
> Sent: Friday, November 19, 1999 12:23 PM
> To:   'MIDRANGE-L (E-mail)
> Subject:      Varying the length in a array
> 
> Hi All,
> 
> Is it possible to vary the lengths of the elements in an array in ILE.
> What
> I am trying to accomplish is to be able to write out each element of an
> array to a flat file.  I want to do a CRTPF len(parm), and then take the
> data in my array and write each element as a record in that file.  The
> array
> has a length of somewhere around 2000 characters.  I will write each
> element
> that is not blank as the next record to the file.  When the elements are
> blank I will process my next record and write out the new data in the
> array.
> This software goes out to a lot of people and they do not all agree on
> what
> length they want the file generated as.
> 
> TIA
> Ron Klein
> 
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 ...


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.