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 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-2019 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].