|
From what I read, I need to have the script in a special file on theIFS.
FYI,then
You can key the FTP script as a source file member and override the
STDIN file to have FTP read the source member.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Thursday, January 19, 2012 2:26 PM
To: Midrange Systems Technical Discussion
Subject: Re: SFTP Questions
Scott,
I did not make myself clear.
I was refering to the sFTP commands being placed in a flat file and
copied to the IFS for use as a batch file in sFTP.should
The data file is being created as a flat file with the pipe delimiter.
If
I use the CPYTOIMPF command to place the file in the IFS, then I
bename
able to send that file to the vendor.
Again, I thank you for taking the time to respond and help resolve the
flaws in my understanding of how this works.
On Thu, Jan 19, 2012 at 1:51 PM, Scott Klement
<midrange-l@xxxxxxxxxxxxxxxx>wrote:
On 1/19/2012 9:09 AM, Jeff Young wrote:vendor
I have a customer that needs to transmit files using SFTP to their
on a periodic basis. Each transmission will have the same file
butand
featuresdifferent member names.
I've never had good luck with sending database members with sftp.
Please remember that sftp is a Unix tool. It knows nothing of
that only exist on IBM i (such as members).what
Since this is an automated task anyway, have the program that's
generating the file write it into a stream file object (*STMF).
Given that I know next to nothing about setting up or using SFTP,
to I
need to do to configure the IBM i to communicate with the server
canSo
Iinstalled.
use this same name format in the SFTP command to send the data?
You need TCP/IP configured and working. You need port 22 open in the
firewall. You need PASE, QShell, and 5733-SC1 base and option 1
FTP
sftp is a Unix tool, it does not have any IBM i native features like
does. All naming MUST be in IFS format (though, it looks like youwere
using that with FTP anyway.)
Unlike FTP, files cannot be converted... they will be sent as-is.
ifprior
your data is in fixed-length record-based EBCDIC, and you want it tobe
in stream-oriented ASCII or Unicode, then you need to convert it
farto calling sftp.or
If I create a flat file on the i and then use either the CPYTOIMPF
specialCPYTOSTMF commands to place the file on the IFS, are there any
parms that I need?
Sftp/scp doesn't know or care what the format of your file is. As
data.as sftp/scp is concerned, it's a big string of bytes. It will copythose
bytes to another computer, as-is.
CPYTOSTMF/CPYTOIMPF are tools for converting the format of your
dataTherefore, no parameter you specify will matter to scp/sftp. Itdoesn't
matter to sftp, because sftp doesn't care what the format of your
is.to
However, the folks who are receiving your file will care. You need
thatfind out what format THEY want the file in, and then use anappropriate
tool (or write one) to get it in that format.but I
I know that I can use the Unix API's to create the file directly,
API'sneed to code this so that someone who is not familiar with using
cangood
maintain it.
The data is plain text with a | character separating fields.
I have no problem with using the CPYTOIMPF tool for this, that's a
method... but I disagree with your philosophy!
For what you're doing, CPYTOIMPF will convert a database file into a
pipe-delimited file with one command call. If the format of data
itI
produces is what you want, then why /wouldn't/ you use it?Reinventing
the wheel is pointless, unless you're going build a better wheel!
But the philosophy that "I think the IFS APIs will work better, but
feel.won't use them because someone else might have to learn a skill" is
absolutely idiotic. Sorry for being so blunt, but that's how I
streamI'm mean seriously... another programmer is going to see you callingrecords
APIs named "open", "write" and "close" and they're going to be
completely stumped? How are you call the completely obscure write()
API?? Nobody will ever figure out what that does??? Really?
My suggestion is to have an RPG program that outputs a normal,
externally defined PF that contains the fields you want, and the
are in the sequence you want. Then use CPYTOIMPF to convert it to ait
pipe-delimited file.
Custom-building the pipe-delimited format in your file, then writing
to a flat file, and converting it to a stream file with CPYTOSTMF is
moronic, and shouldn't be done. If you're going to do the custom
formatting in your program, then it should also write it to the
mailingfile.have
Adding extra work and extra complexity so that someone else doesn't
to learn some trivial new technique is stupid.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
listlist
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
Jeff Young
Sr. Programmer Analyst
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.