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



I believe the file was being created with blanks at the end. Just ran it through again and looks like trimming the trailing blanks at the end of the file name was my problem.

Thanks for that input!!

On Aug 26, 2015, at 11:05 AM, Raul A Jager W <raul@xxxxxxxxxx> wrote:

The file name may have trailing blanks. Make sure you trim the name
when creating the file.

Also, I had very good experience sending files with ftp using Scott's
program: http://www.scottklement.com/ftpapi/ftpapi_zip.html
At the end of your program just make a call to this API.

On 08/25/2015 01:23 PM, Mary Lynn Riggins wrote:
Need some help with IFS stream file.

Client requires a file to be sent to them with no trailing spaces and no CRLF or EOR.


I thought the best way to accomplish this was to write to a stream file on the IFS directly from RPGLE program and then FTP stream file to client from CL program.

The program does create the stream file. I can see it using WRKLNK and can display that there is data, however when trying to FTP the file, I get the error message:


“No such path or directory: /edi/out/myfolder/edi7850.txt. The directory or a component of the path name does not exist.”

Also receive CPFA0A9 Object not found when trying to use IFS command on file. Also receive error message when trying to use QShell to convert ccsid:

iconv: 001-0023 Error found opening file /edi/out/myfolder/edi7850.txt.

However, if manually using WRKLNK green screen, I use option 7- Rename, and rename the file I can then successfully work with the file and use the QShell command and FTP the file. So, there must be something I’m missing when creating the file to begin with. If anyone can lend some insight I would appreciate it.






RPG Code to write to IFS:

**********************************************************************

* Write the IFS Ascii file directly

**********************************************************************

/free

begsr writeIFS;

flags = O_WRONLY + O_CREAT + O_TRUNC;

mode = S_IRUSR + S_IWUSR + S_IRGRP + S_IROTH + S_IWOTH;

filename = '/edi/out/myfolder/edi7850.txt';




fd = open(filename : flags : mode);

if fd < 0;

Msg = 'open() : failed for writing';

eval *Inlr = *on;

return;

endif;



// write the line of data to the IFS file

wrdata = %trim(edata);

callp write(fd: %addr(wrdata): %len(%trim(wrdata)));



//close the file

callp close(fd);

endsr;



Qshell Command used for conversion:

iconv -f 37 -t 819 /edi/out/myfolder/edi7850.txt > /edi/out/pleatco/edi7850c.txt &&setccsid 819 /edi/out/myfolder/edi7850c.txt



Thanks in advance for any help or insights.


MLR


-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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 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.