× 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 don't quite understand >why<, but the error disappears when I supply the
desired string directly to the log_sysopr() function, instead of building the
string into an intermediate variable.

So, log_sysopr "SPBAHCNCL - Retrieving file: $i" functions correctly.

My only guess is that the the shell was breaking the variable based on the
defined characters in the IFS variable.

So, why does the above work?

John McKee

Quoting John McKee <jmmckee@xxxxxxxxxxxxxx>:

This is likely going to be a DUH! thing. I have a QSH script that will display
a message with a variable. Another one not only does not display the content
of the variable, but the trailing part of the constant part of the message is
missing as well.

This works:

log_sysopr() {
doubledquotes="${1//'/''}"
cmd=$(printf "CALL QMHSNDM (CPF9897 'QCPFMSG *LIBL' '%s' \
x'%08x' *INFO *SYSOPR x'00000001' ' ' x'00000000' \
x'00000000')" "$doubledquotes" ${#doubledquotes})
echo $cmd
system "$cmd"
}

file='Data file'
log_sysopr "SPBAHCNCL - Starting sFTP file retrieval - $file"


The echo shows the correct file name. The CPYFRMIMPF has the correct file name.
The line starting with: get_file $i is retrieving the correct file from the
remote site.

The function log_sysopr was copied into this script from the previous script.

echo $i
sysmsg="SPBAHCNCL - Retrieving file: $i"
log_sysopr $sysmsg
get_file $i | sftp_session
syscmd="CPYFRMIMPF FROMSTMF('$i') TOFILE(SPBAHCP4) \
RCDDLM(*CRLF) FLDDLM('|')"
system $syscmd

Given all that, how is it possible that QSYSOPR shows this:

SPBAHCNCL - Starting sFTP file retrieval
SPBAHCNCL
SPBAHCNCL - Ending sFTP file retrieval

The first and third lines are just text with no substitution. I could
understand if I saw nothing for the second line. This is how the first line is
sent:

log_sysopr "SPBAHCNCL - Starting sFTP file retrieval"

So, where is the rest of the fixed text (- retrieving file:) and/ the file
name?

Could this be an issue with yet another uninstalled PTF?

John McKee



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

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.