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




On Thu, 4 Sep 2003, McIntyre Don wrote:

> I have created a 1 field fixed length (16 length) file
> on the iSeries and need to copy this file/s to the IFS
> or a windows directory while retaining the fixed
> length.

I'm assuming that you're wanting to do this in RPG.  Why am I assuming
that?  Because this is the RPG programming list, so a non-RPG question
would be against the charter.

That said, this should be very easy in RPG.  I'm assuming that you're
already familiar with the IFS APIs.  If so, the main loop to write the
records with the trailing blanks is simple:

    c                   eval      CRLF = x'0d25'
    c                   read      MYFILE
    c                   dow       not %eof(MYFILE)
    c                   callp     write(fd: %addr(myrec): %size(myrec))
    c                   callp     write(fd: %addr(CRLF): %size(CRLF))
    c                   read      MYFILE
    c                   enddo

If, however, you're not familiar with the IFS APIs, then you can learn
about them here:
   http://www.scottklement.com/rpg/ifs.html

>
> I've tried cpytoimpf using many different parameter
> settings & also ftp.  In all attempts, the trailing
> spaces are trimmed on the target file. I need the
> target file to retain the 16 positions with carriage
> return.
>
> Does anyone have an idea how I can accomplish this?
>

Too bad we're discussing this on RPG400-L!  If we were discussing it on
MIDRANGE-L, I might suggest using CPYTOSTMF instead.   Or looking at the
"LOCSITE TRIM" command of the IBM FTP client, or the "quote site trim"
command from a PC FTP client.   But, those don't make sense in an RPG
context.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.