× 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 Tue, 17 Feb 2004, Terry Grider 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
> AS400 and under the old DOS Based version of the system, I just use a
> DOS COPY to the IFS and then execute this command to get the data to the
> native AS400 file system:
>
> RMTCMD CPYFRMIMPF FROMSTMF('qdls\OPERATNS\EXTMNTCF.CSV') 
> TOFILE(SFNBACH/SLCIFNEW) RCDDLM(*CRLF) MBROPT(*REPLACE)
>
> I replaced the DOS COPY with:
>
> cp ${CHARTER_FILES}/EXTMNTCF.CSV \\S103080D\QDLS\OPERATNS\EXTMNTCF.CSV
>
> These commands seem to fail.  Anyone with experience in these system
> know if the CP command supports the UNC File syntax and how do you
> format the RMTCMD so as not to get a syntax error from the parenthesis
> in the command parms?  Quotes?

Your cp command is using an invalid combination of regular unix filesystem
naming and windows network naming.  cp cannot copy across different hosts,
only different places on (possibly different) filesystems.

You can certainly achieve what you want, however.  You have at least two
choices:

1.  mount the AS/400 filesystem on the unix machine
2.  use ftp

In order to mount the AS/400 filesystem on the unix machine you can use
either NFS or smbmount.  Judging by your command, it looks like smbmount
is familiar to you.  smbmount works just like the regular unix mount
command (and is in fact a part of it on modern unix OSes).  You specify
the SMB name and share followed by the mount point with optional username
and password.  So for example you could do something like this:

smbmount '\\S103080D\QDLS\OPERATNS\EXTMNTCF.CSV' /as400

and then your cp command would be simply:

cp ${CHARTER_FILES}/EXTMNTCF.CSV /as400

Pretty easy, huh?  NFS works similarly.

If you don't want to mess with iSeries Netserver or NFS or smbmount or any
of that stuff just use ftp.  ftp is super easy to script.  Just put your
iSeries username and password in ${HOME}/.netrc and make a little script
like this:

#!/bin/sh
ftp S103080D <<END_SCRIPT
NAMEFMT 1
cd /QDLS/OPERATNS
put EXTMNTCF.CSV
quit
END_SCRIPT
exit 0

This will probably need little changes to work on your system but you get
the idea.

James Rich

"As for security, being lectured by Microsoft is like receiving wise words
on the subject of compassion from Stalin."
      -- mormop on lwn.net

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.