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



We want to reformat a file on the AS400 to a
> variable length file to be processed by a server.

... and how does the server define 'variable record length?' The reason you're getting questions instead of answers is that the definition of the problem is somewhat incomplete.

The problem is the admixture of the words 'record' and 'variable.' A record is a block of data of a fixed size. Think about a punched card. You can't process one card that's 1 inch wide, and another card that's 30 inches wide. They're all the same size; the same record length.

A text file in Windows, by comparison, has no records at all! It has characters placed in the file one after the other. Even though one might see the following in Notepad:

Line one is medium sized.
Line two is somewhat longer then line one.
Three.

There are NOT three records in the file. Just a series of characters. Notepad has been written so that it positions the cursor at the beginning of the next line when is reads a carriage return/line feed combination of characters.

If your destination server wants a file like this, with some text followed by a CRLF followed by more text, then yes, RPG IV can do this, and Scott's answer is a great way to get started. If your destination server wants something else, I think you'll have to post a bit of detail on what that something else needs to look like.
  --buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.