FTP from Unix to AS400 to EDI Server


    Sponsored Links


    Hello. It seems that "get diagnostics" command in exception handler of SQL SP sets SQLCODE special variable to 0. try to create this simple SQL SP: --- CREATE PROCEDURE DWHTEST.COMMAND ( IN STMT VARCHAR(4096), OUT RC INT, OUT MSG VARCHAR(4096) ) LANGUAGE SQL P1: BEGIN DECLARE SQLCODE INTEGER; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN GET DIAGNOSTICS EXCEPTION 1 COMMAND.MSG = MESSAGE_TEXT; SET COMMAND.RC = SQLCODE; END; SET RC=0; SET MSG=''; EXECUTE IMMEDIATE STMT; END; --- As you see, this SP simple executes your command passed in parameter 1. Try to call this sp with a error command (in iSeries Navigator, for example): Sincerely, Mark B.
  • 2. Immortal UDF
    Hello. V5R3, V5R2. Try this: CREATE PROCEDURE DWHTEST.DUMMYPROC (OUT MSG VARCHAR(4096)) LANGUAGE SQL P1: BEGIN SELECT DWHTEST.DUMMYFUNC() INTO MSG FROM SYSIBM.SYSDUMMY1; END; As you see SP simple calls UDF and returns result. After that call SP TWICE OR MORE times (in iseries navigator, for example): call dwhtest.dummyproc(?); call dwhtest.dummyproc(?); Now drop UDF and call SP again: drop function dwhtest.dummyproc; call dwhtest.dummyproc(?); SP works as if function dwhtest.dummypfunc exists!!! And select dwhtest.dummyfunc() from sysibm.sysdummy1; doesn't work (that is right). What do you think about this? P.S.: In DB2 for LUW this situation is impossible: after dropping UDF you can't call SP at all - package for SP is invalidated after dropping UDF since this UDF used in SP in static sql. Sincerely, Mark B.
  • 3. Semi-unique key?
    We have a requirement to have a file (or SQL table) with a semi-unique key. By this I mean that there is a certain field that must have a unique value, unless it is empty. By empty, I was initially thinking all spaces or all low-values, but I couldn't see how to avoid a duplicate key problem like this. But then I wondered about null capable fields (which is not something we have ever used before) : If a field is null capable, and a file contains multiple records with that field null, and all the records where that field is not null have a unique value in that field, can we set up a uniquely-keyed logical file with the null-capable field being the key field? Or will the multiple nulls cause a duplicate key error?
  • 4. Virtual device questions
    This is more decriptive of the problem we're having. We use Jwalk for GUI and are getting a message "virtual device already in use". We looked at the system value for virtual devices and it's set for 600. We upped it incrementally and discovered we could fix our Jwalk problem. We have another question. Neither of us are system programmers. What uses virtual devices? How do we list all the virtual devices in use? If we have some that aren't being released properly, what is the best way to handle that? Thanks for any and all responses.

FTP from Unix to AS400 to EDI Server

Postby k_morland » Wed, 17 Dec 2003 02:01:19 GMT

I have been working on an FTP issue that is driving me nuts.  And of
course it is one that is out of the ordinary.

A client sends us a file to the ISeries that is in a Data Stream which
uses the IFS.  I then send it down to our EDI server where they are
supposed to edit it.  (I just work here).  They then send me the
results which I forward back to the client.  The problem is that when
I send it binary, it adds low values to the end of the file which both
Aetna and our EDI group can't handle.  If I send it ASCII then  I have
a limit of 32,766 bytes.  I've tried using the TRIM command with no

namefmt 1
put /qsys.lib/kwmlib.lib/testfile.file/testmbr.mbr testfile

This example gives me the low values are spaces at the end.  Any help
would be appreciated.

Re: FTP from Unix to AS400 to EDI Server

Postby sclind » Wed, 17 Dec 2003 07:00:09 GMT

If the file starts in the IFS, then why do you bring it back into the
library file system?  Files in the library file system have fixed
lengths, and that is probably the source of your problem.

(BTW, a similar questions/answer was posted earlier).


Re: FTP from Unix to AS400 to EDI Server

Postby k_morland » Wed, 17 Dec 2003 21:56:55 GMT

Actually, I am not bringing it back into the library file system.  On
this command I am trying to FTP the file from the IFS on the AS400
down to our server.


Re: FTP from Unix to AS400 to EDI Server

Postby sclind » Thu, 18 Dec 2003 06:47:18 GMT

This is the part that confuses me:

put /qsys.lib/kwmlib.lib/testfile.file/testmbr.mbr testfile

This is not a file in the IFS, this is a file in the 'traditional'
library file system.  It would have a fixed record length.


Re: FTP from Unix to AS400 to EDI Server

Postby Drew Dekreon » Thu, 18 Dec 2003 10:37:25 GMT

you could try issuing a
in FTP before PUTting the file (treats as stream instead of records)
might help (always trims tailing blanks from records)

Re: FTP from Unix to AS400 to EDI Server

Postby Steve Landess » Thu, 18 Dec 2003 14:41:54 GMT

Technically, You're NOT ftp'ing the file from the IFS...

The file /qsys.lib/kwmlib.lib/testfile.file/testmbr.mbr on your iSeries
system is the file named TESTFILE that has a member named TESTMBR in library
KWMLIB.  The long name is simply the way to access this file in the library
file system via the IFS file system.

As Scott pointed out, this file should have fixed length records.

You can view the raw data in TESTFILE from a green screen (5250 emulation
session) using the command:


Once you are viewing the data on the "Display Physical File Member" screen,
press F10, then F11.

This will show the data in the file on three lines:
1) The first line shows the data in character (text) representation
2) The next line shows the first hexadecimal character of the data in hex
3) The next line shows the second hexadecimal character of the data in hex

Steve Landess
Austin, Texas
(512) 423-0935

Similar Threads:

1.AS400 FTP to FTP Server Write problem

I have an FTP site on our W2K server (SP4) that I FTP files to from our
AS400. To do this I need write authority, which is OK, but users
accessing this site from a browser can upload/create anything on this
folder. Is there a way in Internet Information Services, or the folder
itself to stop users from writing to this folder yet still give me
rights to write to it? Permissions on the folder, or on IIS doesn't
seem to check the write privilages.
Anyone know how I can accomplish this?

2.FTP from UNIX to AS400

Hello All,

We receive the following message when we  transfer a flat text file in
ASCII from UNIX to AS400 ftp server :

Error [426-Records written to file FILE1 in library QGPL have been
truncated. Data in file may not be valid.
426 Data transfer ended.]"

Can someone explain the message and suggest how to transfer a file
without data corruption and without error messages. 


3.export library to unix server by as400 box


I wanted to know how to export(exportfs) a library by nfs to unix
server.Also please clear me what is mounting and exporting. why we use
nfs server for this.
Please reply.


4.Securely Connect AS400 to Unix Web Server

Good morning,

We are building a new website and need to securely send/receive data
to/from Unix web server.  I do not know anything about Unix/Linix
boxes and the guy whom I am working with does not know anything about
Any suggestions would be greatly appreciated.

We are running on:

Thank you in advance.

5.VB.NET - Issues with VB.NET FTP Class to UNIX FTP Server

6. "My Network Places" + FTP + Unix FTP Server == no symlinks or dotfiles displayed

7. FTP Problem from AS400 to Windows server 2003 IIS 6.0

8. AS400 FTP, can you launch a bat file on W2K3 server

Return to as400


Who is online

Users browsing this forum: No registered users and 84 guest