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




One of our business partners are sending us data which arrives as one long
stream of data.  We need to download this using FTP to our AS/400 and then
process it.  However, the stream they send is of variable length and often
larger than the AS/400's maximum 32766 record length.

Does anyone know how to read a variable length record and split it into 80
column records?

For now we upload to a PC, split into 80 column records using a PC program
and then FTP to our AS/400.

The program I wrote on the PC reads the input file byte by byte and simply
outputs to a new file, adding control codes 13 and 10 when it reaches 80
characters.  I need to be able to do similar in RPG.. or any other means!

The BASIC code is:

 open f$ for binary as #1
 open n$ for binary as #2

 fread:
 get$ #1, 80, C$
 put$ #2, C$
 put$ #2, chr$(13)
 put$ #2, chr$(10)

 if not (eof(1)) then goto fread
 close #1
 close #2

HELP!!! Please!!


This message has been virus checked with appropriate software used by
KeyMed (Medical & Industrial Equipment) Ltd., but neither it nor any
attachments can be guaranteed free from viruses or other defects and the
recipient accepts sole responsibility for any consequences arising from
opening this message or any attachments.  The comments contained in this
message are personal to the sender, who accepts sole responsibility for
them.  They should not be taken to represent the company's views or
position, which may differ in whole or in part from those expressed by the
sender.

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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-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.