|
hi Kirk,
What would be the proper way to create/capture the debug/log info without
filling the user's display with it? Or can that be done when running
interactively?
Personally, I like to set QIBM_QSH_CMD_OUTPUT for this.
Here's an example from my handout (I give talks on this subject at
conferences):
PGM
DCL VAR(&USER) TYPE(*CHAR) LEN(10) +
VALUE('klemscot')
DCL VAR(&HOST) TYPE(*CHAR) LEN(100) +
VALUE('buddy.example.com')
DCL VAR(&CMD) TYPE(*CHAR) LEN(500)
ADDENVVAR ENVVAR(SFTP_USER) VALUE(&USER) REPLACE(*YES)
ADDENVVAR ENVVAR(SFTP_HOST) VALUE(&HOST) REPLACE(*YES)
CHGVAR VAR(&CMD) VALUE('PATH=$PATH:/QOpenSys/usr/bin && +
sftp -b /tmp/example.sftp $SFTP_USER@$SFTP_HOST')
ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) +
VALUE('FILEAPPEND=/tmp/sftplog.txt') +
REPLACE(*YES)
ADDENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) VALUE(Y) +
REPLACE(*YES)
QSH CMD(&CMD)
MONMSG MSGID(QSH0000) EXEC(DO)
SNDMSG MSG('File transfer failed! See /tmp/sftplog.txt') +
TOUSR(KLEMSCOT)
ENDDO
ENDPGM
The full PDF handout can be downloaded here:
http://www.scottklement.com/presentations
--
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 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.