× 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 am puzzled by the syntax on the CHGVAR used to build the &CMD
variable. Specifically /BIN && sftp.

You might want to do a DMPCLPGM and check the variables to see if they
are formatted as you need.

John McKee

On Fri, Feb 3, 2012 at 3:00 PM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:
All,
I have finally gotten SFTP to work and was able to create a program to
transmitt data to the vendor.
When I run the program Interactivly, it works just fine.  I get my
sftplog.txt file that i specified in my environment variable with no
problems.
However, when I run it in the batch with the same user id, the data is not
sent, and the sftplog.txt file is not created.
How can I findout what is happening differently when I run it in batch vs
interactive?


            RTVDTAARA  DTAARA(IOMMSFTPIP) RTNVAR(&FTP_IP)

            ADDENVVAR  ENVVAR(SFTP_HOST) VALUE(&FTP_IP) +
                       REPLACE(*YES)

            ADDENVVAR  ENVVAR(QIBM_QSH_CMD_OUTPUT) +
                       VALUE('FILEAPPEND=/tmp/sftplog.txt') +
                       REPLACE(*YES)
            ADDENVVAR  ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) VALUE('Y') +
                       REPLACE(*YES)


               ADDENVVAR  ENVVAR(SFTP_USER) VALUE(&MMSFTPUSR)
+

REPLACE(*YES)


               CHGVAR     VAR(&CMD) VALUE('PATH=$PATH:/QOPENSYS/BIN&& sftp
-b +
                          /FACEYMMS/MMS_SCRIPT.FTPS -oPort=2222
+
                          $SFTP_USER@$SFTP_HOST')



               QSH
CMD(&CMD)


-
               CPYFRMSTMF FROMSTMF('/tmp/sftplog.txt')     +
                          TOMBR('/QSYS.LIB/' || &LIB || +
                          '.LIB/SFTPLOG.FILE/' || &MEMBER |< '.MBR') +
                          MBROPT(*ADD)

When I run in batch, this command fails with an object not found message.

All help will be appreciated.

Thanks,


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.


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.