× 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.



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

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.