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



FTP will not translate a CSV file, it'll either transfer as is ("bin"), or convert to EBCDIC ("asc"). And a Unix dweeb will have to tell you whether "sed" or "awk" can generate converted input to ftp on the fly.

But you might be able to "put" the file to the IFS, then execute "quote rcmd cpyfrmimpf ... etc.", all in the FTP script. Of course, error-handling is the big bugaboo.

But to answer the question about scripts, here's my stab.

This assumes a physical file that already exists on the 400.

In any shell, I think you redirect input from a file:

ftp hostname < script.ftp

script.ftp would be something like

userid
password
asc
quote site nam 1
put yourunixfile /qsys.lib/targetlib.lib/targetfile.file
quote rcmd cpyfrmimpf etc.     (optional)
quit

For security purposes, the script might need to be built on the fly, inserting userid & password at runtime.

"asc" => ascii, assuming the encoding in Unix. The 400 physical file should have no packed fields.

"quote site name 1" => forces the use of path-naming on the 400. This is almost always safest, IMO.

The "put" will write to the *FIRST membe, IIRC. To write to another member (assuming it's allowed), you add "/targetmbr.mbr" to the 400 file name.

HTH
Vern

At 01:14 PM 2/18/2004 -0600, you wrote:
Hey David!

So you work for MKS. You might just be my new best friend! This file I'm talking about is in CSV format. For processing on the AS400, I need the file in fixed fields. I was doing a CPYFRMIMPF FROMSTMF after getting it to the IFS to accomplish the conversion. If FTP can handle this all at one time do you think it would be better to use it instead of the two step process I run now? If so, do you have a sample of how to script ftp within a KornShell?

Thanks

Terry

-----Original Message-----
From: David Gibbs [mailto:david@xxxxxxxxxxxx]
Sent: Wednesday, February 18, 2004 10:18 AM
To: Midrange Systems Technical Discussion
Subject: Re: Anyone copying files from Unix to AS400?


James Rich wrote: >>>We have a new Intel server where the application runs KornShell under >>>MKS Toolkit on Win2k Server. We create files that need to go to the > Silly me! I forgot that you are on win2k. Since you are, the underlying > filesystem already understands the //host/destination so David's answer is > correct.

Actually, the standard Win2K command line does *NOT* understand a
forward slash ... it requires a backslash.

MKS KShell, however, understands the forward slash.

david
(who works for MKS, but not directly with Toolkit)



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.