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



Yes!  :D

On Thursday, April 18, 2019, 10:42:02 AM EDT, Alan Shore via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Hi Mark

Todays a good day - I believe that I learnt something new

Are you saying that information can be written to the job log, by using this command
/* send information to job log */
  SNDPGMMSG  MSGID(CPF9898) MSGF(QSYS/QCPFMSG) +
                MSGDTA(&VARIABLE) TOPGMQ(*PRV (*)) +
                MSGTYPE(*DIAG)

Where &VARIABLE contains the text that you would like to be inserted into the job log


Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
‘If you're going through hell, keep going.’
Winston Churchill

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Mark Waterbury
Sent: Thursday, April 18, 2019 10:36 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] Re: SSH submit remote command with parameter contain special character

Andrew,
Do not attempt to mix single-quotes and double-quotes.  And, never use "back-quotes."

Use only single quotes. (Single-quote is usually under the double-quote on many keyboards, unshifted).

Inside a quoted string, two single-quotes in a row means "one single-quote" inside the quoted string, vis:
    'Mark''s name.'
Also, you can create a variable, e.g.:

DCL  VAR(&CMD) TYPE(*CHAR) LEN(512) DCL  VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(512)


Then, use CHGVAR to concatenate all the parts of your command, as follows:

  CHGVAR VAR(&CMD) VALUE('ssh -Tvvv -n USERID@MACHINE +
    ''system ''''SBMJOB CMD(CALL PGM (MSBTRWRST/WASSTR) +
    PARM(''''9.0.0'''' ''''S'''' '''' '''')) +
    JOB(WASSTR_TST) HOLD(*YES) JOBQ(QUSRNOMAX)''')          


Then, before running it, echo it to the job log and interactive session as follows:

/* send command to job log */
   SNDPGMMSG  MSGID(CPF9898) MSGF(QSYS/QCPFMSG) +
                MSGDTA(&CMD) TOPGMQ(*PRV (*)) +
                MSGTYPE(*DIAG)
/* send command to screen ... */
   SNDPGMMSG  MSGID(CPF9898) MSGF(QSYS/QCPFMSG) +
                MSGDTA(&CMD) TOPGMQ(*EXT) +
                MSGTYPE(*STATUS)                     


Then, use QCMDEXC to run the command:
    CALL       PGM(QSYS/QCMDEXC) PARM(&CMD &CMDLEN)
    MONMSG     CPF0000 ...


Hope that helps,

Mark S. Waterbury

    On Thursday, April 18, 2019, 9:33:37 AM EDT, Andrew Smith <Andrew.Smith@xxxxxxxxxxxxx> wrote: 

Hello,

I’ve tried combinations of single quotes, double quotes etc but no avail.
The output sent to the log file says there is some about the . in 9.0.0 that it does like, but I am a loss
on how to fix it.

Thankyou

Regards
Andy


 

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.