Discussion:
MVS send command in REXX
Add Reply
saurabh khandelwal
2018-06-08 10:36:41 UTC
Reply
Permalink
Raw Message
Hello Group,

In this below REXX, I want to send message only to operator AG54 but, not
sure why this send command sending message to all users in system , not
only AG54.

I checked syntax for this send command but result is same,





EDIT NETVIEW.CNMCLST(FAIREXX1) - 01.14

****** ***************************** Top of Data ********

000100 /* REXX */

000120 parse arg mtxt . mtxt

000240 say 'AG54LST Job STARTED at' mtxt

000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"

000600 exit

****** **************************** Bottom of Data ******

Can you please help.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Elardus Engelbrecht
2018-06-08 10:53:01 UTC
Reply
Permalink
Raw Message
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message command will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
Change above to this (replacing two spaces with two commas):

mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"

Look up SEND for specific message receivers in

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ieag100/s1mess1.htm


Disclaimer - I am not a NETVIEW expert anymore...

So, you, not me, need to double check all those ' and " are properly balanced.

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
saurabh khandelwal
2018-06-09 04:27:28 UTC
Reply
Permalink
Raw Message
Hello,

Thanks for reply.

below command doesn't work. After changing

mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"

to

mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"

I stopped getting any notification as i was getting on any system.

Is there any other syntax for this command .


here mtxt is notthing but a tapped message from syslog , we tried to
capture using netview and we should like to display it to particular tso
user when even triger.

but instead , it was displaying it to all users. I am unable to find
correct way to isolate this issue.

On Fri, Jun 8, 2018 at 1:52 PM, Elardus Engelbrecht <
Post by Elardus Engelbrecht
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message command
will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
Look up SEND for specific message receivers in
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/
com.ibm.zos.v2r2.ieag100/s1mess1.htm
Disclaimer - I am not a NETVIEW expert anymore...
So, you, not me, need to double check all those ' and " are properly balanced.
Groete / Greetings
Elardus Engelbrecht
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
CM Poncelet
2018-06-09 05:26:23 UTC
Reply
Permalink
Raw Message
Hello,
 
Here is a Clist version, invoked in TSO batch. Check it against what you
are doing in REXX. (I am putting everything in quotes to avoid my
email's data being interpreted as commands.)

 MEMBER NAME  TSOSEND (JCL)
"// ... <job card> ...                                                  "
"/*JOBPARM SYSAFF=(<LPAR>)                                              "
"//*                                                                    "
"//*********************************************************************"
"//* NOTE: NO LINE NUMBERS IN COLS 73-80 ALLOWED, ELSE CLIST FAILS!    *"
"//* ¯¯¯¯¯                                                             *"
"//*********************************************************************"
"//* NOTE: 'U' => TSO USERID(S); SPECIFY LIST OF USERIDS UNDER DESTIDS *"
"//* ¯¯¯¯¯ 'C' -> CONSOLE; SPECIFY MASTER ETC. UNDER CONSIDS           *"
"//*                                                                   *"
"//* 04/01/95 CMP                                                      *"
"//*********************************************************************"
"//*                                                                    "
"//*                                                                    "
"//CLIST   EXEC PGM=IKJEFT01,                                           "
"//             REGION=512K,                                            "
"//*           PARM='%TSOSEND DESTIDS SYSIN USERID'                     "
"//            PARM='%TSOSEND CONSIDS SYSIN CONSOLE'                    "
"//*                                                                    "
"//SYSPROC  DD  DISP=SHR,DSN=<Clist DSN>                                "
"//SYSTSIN  DD  DUMMY                                                   "
"//SYSTSPRT DD  SYSOUT=*                                                "
"//CONSIDS  DD  *                                                       "
"... <master console ID> ...                                            "
"//*                                                                    "
"//DESTIDS  DD  *                                                       "
"... <userid(s)> ...                                                    "
"//SYSIN    DD  *                                                       "
"... <multi-line message> ...                                           "
"... <... ditto etc etc.> ...                                           "
"                                                                       "
"/*                                                                     "
"//*                                                                    "
"//                                                                     "

 MEMBER NAME  TSOSEND
"PROC 2 DESTLIST MESSAGE DEBUG USERID CONSOLE                           "
"/*------------------------------------------------------------------*/ "
"/* N.B. DEFAULT IS 'NOW'                                            */ "
"/* 'LOGON' -> 'NOW' IF LOGGED ON, ELSE AT LOGON TIME.               */ "
"/* 'SAVE' -> ONLY AT NEXT LOGON TIME (OR LISTBC)                    */ "
"/*                                                                  */ "
"/* PARMS: DESTLIST DDNAME OF USERS/CONSOLES TO WHOM MESSAGE ISTO    */ "
"/*                 BE SENT - DEFAULT=NONE                           */ "
"/*        MESSAGE: DDNAME OF MESSAGE TEXT TO BE SENT - DEFAULTNONE  */ "
"/*        DEBUG:   SETS TRACE ON - DEFAULT=OFF                      */ "
"/*                                                                  */ "
"/* 13/12/94 CMP - ALLOW SENDING TO USERID(S) OR TO MVS CONSOLES)    */ "
"/* 17/04/89 CMP                                                     */ "
"/*------------------------------------------------------------------*/ "
"CONTROL: +                                                             "
"  CONTROL END(ENDO)                                                    "
"  IF &DEBUG = DEBUG | &DEBUG = D THEN +                                "
"    CONTROL LIST SYMLIST CONLIST MSG ASIS                              "
"  ELSE +                                                               "
"    CONTROL NOLIST NOSYMLIST NOCONLIST NOMSG ASIS                      "
"ERROR: +                                                               "
"ERROR DO                                                               "
"  SET CC = &LASTCC                                                     "
"  IF &CC = 400 THEN RETURN                                             "
"  ELSE DO                                                              "
"  WRITE ERROR WITH CONDITION CODE = &CC OCCURRED : INTERRUPT A LABEL + "
"        'ERROR'                                                        "
"  WRITE CLIST RUN ABANDONED                                            "
"  GOTO EXIT                                                            "
"  ENDO                                                                 "
"  ENDO                                                                 "
"                                                                       "
"IF &USERID ¬= THEN SET TO = USER                                       "
"ELSE IF &CONSOLE ¬= THEN SET TO = CN                                   "
"ELSE +                                                                 "
"WHERE: +                                                               "
"  DO                                                                   "
"  WRITE YOU MUST SPECIFY PARAMETER 'USERID' OR 'CONSOLE'               "
"  WRITE                                                                "
"  GOTO EXIT                                                            "
"  ENDO WHERE                                                           "
"                                                                       "
"SET SENDTO =                                                           "
"SET K = &&K                                                            "
"SET USREC  = &&&DESTLIST                                               "
"SET MSGREC = &&&MESSAGE                                                "
"SET MAXCC = 0                                                          "
"OPENFILE &DESTLIST INPUT                                               "
"GETFILE &DESTLIST                                                      "
"DO I = 0 TO 99 WHILE &MAXCC = 0                                        "
"  SET USER = &USREC                                                    "
"  SET J = &SYSINDEX(&STR( ),&USER,1)                                   "
"  SET J = &J - 1                                                       "
"  SET USER = &SUBSTR(1:&J,&USER)                                       "
"  SET SENDTO = &STR(&SENDTO&USER,)                                     "
"  GETFILE &DESTLIST                                                    "
"  ENDO                                                                 "
"CLOSFILE &DESTLIST                                                     "
"IF &I > 0 THEN +                                                       "
"  DO                                                                   "
"  SET LSENDTO = &LENGTH(&STR(&SENDTO)) - 1                             "
"  SET SENDTO = &SUBSTR(1:&LSENDTO,&STR(&SENDTO))                       "
"  SET MSG = &&MSG                                                      "
"  SET MAXCC = 0                                                        "
"  OPENFILE &MESSAGE INPUT                                              "
"  GETFILE &MESSAGE                                                     "
"  DO J = 1 TO 99 WHILE &MAXCC = 0                                      "
"    SET MSG&J = &SUBSTR(1:71,&MSGREC)                                  "
"    SET K0 = 1                                                         "
"    DO I = 1 TO 99 WHILE &K&EVAL(&I-1) > 0                             "
"      SET K&I = &SYSINDEX(&STR('),&STR(&MSG&J),&K&EVAL(&I-1))          "
"      IF &K&I > 0 THEN SET K&I = &K&I + 1                              "
"      ENDO                                                             "
"    DO L = &I-2 TO 1 BY -1 WHILE &K&L > 0                              "
"      SET MSG&J = &SUBSTR(1:&K&L-1,&STR(&MSG&J))&STR(')+               "
"                  &SUBSTR(&K&L:&LENGTH(&STR(&MSG&J)),&STR(&MSGJ))      "
"      ENDO                                                             "
"    GETFILE &MESSAGE                                                   "
"    ENDO                                                               "
"  SET J = &J - 1                                                       "
"  DO I = 1 TO &J                                                       "
"    SEND '&MSG&I' +                                                    "
"    &TO(&STR(&SENDTO)) LOGON                                           "
"    ENDO                                                               "
"  ENDO                                                                 "
"EXIT: +                                                                "
"  EXIT CODE(0)                                                         "
 
Cheers, CP (retired sysprog)
Post by saurabh khandelwal
Hello,
Thanks for reply.
below command doesn't work. After changing
mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
to
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
I stopped getting any notification as i was getting on any system.
Is there any other syntax for this command .
here mtxt is notthing but a tapped message from syslog , we tried to
capture using netview and we should like to display it to particular tso
user when even triger.
but instead , it was displaying it to all users. I am unable to find
correct way to isolate this issue.
On Fri, Jun 8, 2018 at 1:52 PM, Elardus Engelbrecht <
Post by Elardus Engelbrecht
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message command
will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
Look up SEND for specific message receivers in
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/
com.ibm.zos.v2r2.ieag100/s1mess1.htm
Disclaimer - I am not a NETVIEW expert anymore...
So, you, not me, need to double check all those ' and " are properly balanced.
Groete / Greetings
Elardus Engelbrecht
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Nims,Alva John , Al
2018-06-11 14:13:55 UTC
Reply
Permalink
Raw Message
Does the contents of "mtxt" happen to have a parentheses ["(" or ")"]? Several years ago, I worked at a shop that we maintained the broadcast messages, this was a multiple send situation, but might be applicable, but if one line had a "(" in it and with the closing ")" on the next line, it would totally mess up and we had to rework the message so that both "(" and ")" were on the same send command to work.

Don't know if that is your problem, but thought I would put that out there.

Al Nims
Systems Admin/Programmer III
UF Information Technology
East Campus
P.O. Box 112050
Gainesville, FL. 32611
(e) ***@ufl.edu
(p) (352) 273-1298

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of saurabh khandelwal
Sent: Saturday, June 09, 2018 12:27 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: MVS send command in REXX

Hello,

Thanks for reply.

below command doesn't work. After changing

mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"

to

mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"

I stopped getting any notification as i was getting on any system.

Is there any other syntax for this command .


here mtxt is notthing but a tapped message from syslog , we tried to capture using netview and we should like to display it to particular tso user when even triger.

but instead , it was displaying it to all users. I am unable to find correct way to isolate this issue.
Post by Elardus Engelbrecht
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message
command will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
Look up SEND for specific message receivers in
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ibm.com_suppo
rt_knowledgecenter_SSLTBW-5F2.2.0_&d=DwIBaQ&c=pZJPUDQ3SB9JplYbifm4nt2l
EVG5pWx2KikqINpWlZM&r=0Ef64GJS77DVfhr5GGKZeQ&m=ChEpTjtAfIGIeIguFdpbIOZ
9it2jm0UHEzW4CP3CBJc&s=MRuaj8EZbz1UR_mOmI804GVPybeqMi6oXDIJ1JYv1z4&e=
com.ibm.zos.v2r2.ieag100/s1mess1.htm
Disclaimer - I am not a NETVIEW expert anymore...
So, you, not me, need to double check all those ' and " are properly balanced.
Groete / Greetings
Elardus Engelbrecht
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-06-08 15:46:46 UTC
Reply
Permalink
Raw Message
What is in mtxt? You display it with a say statement but didn't include the output in your query. Is it pssible that it include an apostrophe/


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of saurabh khandelwal <***@GMAIL.COM>
Sent: Friday, June 8, 2018 6:36 AM
To: IBM-***@listserv.ua.edu
Subject: MVS send command in REXX

Hello Group,

In this below REXX, I want to send message only to operator AG54 but, not
sure why this send command sending message to all users in system , not
only AG54.

I checked syntax for this send command but result is same,





EDIT NETVIEW.CNMCLST(FAIREXX1) - 01.14

****** ***************************** Top of Data ********

000100 /* REXX */

000120 parse arg mtxt . mtxt

000240 say 'AG54LST Job STARTED at' mtxt

000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"

000600 exit

****** **************************** Bottom of Data ******

Can you please help.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Elardus Engelbrecht
2018-06-08 16:55:55 UTC
Reply
Permalink
Raw Message
Post by Seymour J Metz
What is in mtxt? You display it with a say statement but didn't include the output in your query. Is it pssible that it include an apostrophe/
Excellent catch! Thanks! I forgot about that about apostrophe inside a variable inside that line. Really confusing and certainly would trip a parser into a black hole! ;-)

Ok, it is a long time ago I had to handle a similar problem where lots of apostrophes are in a parsed line. It is a real PITA to handle such characters which could throw later parsing astray.

I would suggest that a parse/checking and re-parse to be run on that mtxt before passing it on to "mvs send".

Thanks Shmuel for your kind and helpful reply.

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-06-08 17:12:14 UTC
Reply
Permalink
Raw Message
In general, when you run into such problems "trace I" is your friend. I've stared blindly at lot's of code without spotting what was wrong, only to say "Aha!" the instant that I looked at a trace.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Elardus Engelbrecht <***@SITA.CO.ZA>
Sent: Friday, June 8, 2018 12:55 PM
To: IBM-***@listserv.ua.edu
Subject: Re: MVS send command in REXX
Post by Seymour J Metz
What is in mtxt? You display it with a say statement but didn't include the output in your query. Is it pssible that it include an apostrophe/
Excellent catch! Thanks! I forgot about that about apostrophe inside a variable inside that line. Really confusing and certainly would trip a parser into a black hole! ;-)

Ok, it is a long time ago I had to handle a similar problem where lots of apostrophes are in a parsed line. It is a real PITA to handle such characters which could throw later parsing astray.

I would suggest that a parse/checking and re-parse to be run on that mtxt before passing it on to "mvs send".

Thanks Shmuel for your kind and helpful reply.

Groete / Greetings
Elardus Engelbrecht

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
CM Poncelet
2018-06-08 20:06:07 UTC
Reply
Permalink
Raw Message
Should you not be using TSO SEND?
 
Here is a Clist version, invoked in batch.
 
 MEMBER NAME  TSOSEND
 // <Job card etc.>
 //*********************************************************************
 //* NOTE: NO LINE NUMBERS IN COLS 73-80 ALLOWED, ELSE CLIST FAILS!    *
 //* ¯¯¯¯¯                                                             *
 //*********************************************************************
 //* NOTE: 'U' => TSO USERID(S); SPECIFY LIST OF USERIDS UNDER DESTIDS *
 //* ¯¯¯¯¯ 'C' -> CONSOLE; SPECIFY MASTER ETC. UNDER CONSIDS           *
 //*                                                                   *
 //* 04/01/95 CMP                                                      *
 //*********************************************************************
 //*
 //CLIST   EXEC PGM=IKJEFT01,
 //             REGION=512K,
 //*           PARM='%TSOSEND DESTIDS SYSIN USERID'
 //            PARM='%TSOSEND CONSIDS SYSIN CONSOLE'
 //*
 //SYSPROC  DD  DISP=SHR,DSN=<Clist PDS DSN>
 //SYSTSIN  DD  DUMMY
 //SYSTSPRT DD  SYSOUT=*
 //CONSIDS  DD  *
 <console IDs, if any>
 //*
 //DESTIDS  DD  *
 <user IDs, if any>
 //SYSIN    DD  *
 <whatever message to send line #1>
 <whatever message to send line #2>
 <etc.>
 //*
 //
 
 MEMBER NAME  TSOSEND
 PROC 2 DESTLIST MESSAGE DEBUG USERID CONSOLE
 /*-------------------------------------------------------------------*/
 /* N.B. DEFAULT IS 'NOW'                                             */
 /* 'LOGON' -> 'NOW' IF LOGGED ON, ELSE AT LOGON TIME.                */
 /* 'SAVE' -> ONLY AT NEXT LOGON TIME (OR LISTBC)                     */
 /*                                                                   */
 /* PARMS: DESTLIST DDNAME OF USERS/CONSOLES TO WHOM MESSAGE IS TO    */
 /*                 BE SENT - DEFAULT=NONE                            */
 /*        MESSAGE: DDNAME OF MESSAGE TEXT TO BE SENT - DEFAULT=NONE  */
 /*        DEBUG:   SETS TRACE ON - DEFAULT=OFF                       */
 /*                                                                   */
 /* 13/12/94 CMP - ALLOW SENDING TO USERID(S) OR TO MVS CONSOLE(S)    */
 /* 17/04/89 CMP                                                      */
 /*-------------------------------------------------------------------*/
 CONTROL: +
   CONTROL END(ENDO)
   IF &DEBUG = DEBUG | &DEBUG = D THEN +
     CONTROL LIST SYMLIST CONLIST MSG ASIS
   ELSE +
     CONTROL NOLIST NOSYMLIST NOCONLIST NOMSG ASIS
 ERROR: +
 ERROR DO                                                               
   SET CC = &LASTCC                                                     
   IF &CC = 400 THEN RETURN                                             
   ELSE DO                                                              
   WRITE ERROR WITH CONDITION CODE = &CC OCCURRED : INTERRUPT AT LABEL +
         'ERROR'
   WRITE CLIST RUN ABANDONNED
   GOTO EXIT
   ENDO
   ENDO                                                                 

 IF &USERID ¬= THEN SET TO = USER
 ELSE IF &CONSOLE ¬= THEN SET TO = CN
 ELSE +
 WHERE: +
   DO
   WRITE YOU MUST SPECIFY PARAMETER 'USERID' OR 'CONSOLE'
   WRITE
   GOTO EXIT
   ENDO WHERE

 SET SENDTO =
 SET K = &&K
 SET USREC  = &&&DESTLIST
 SET MSGREC = &&&MESSAGE
 SET MAXCC = 0
 OPENFILE &DESTLIST INPUT
 GETFILE &DESTLIST
 DO I = 0 TO 99 WHILE &MAXCC = 0
   SET USER = &USREC
   SET J = &SYSINDEX(&STR( ),&USER,1)
   SET J = &J - 1
   SET USER = &SUBSTR(1:&J,&USER)
   SET SENDTO = &STR(&SENDTO&USER,)
   GETFILE &DESTLIST
   ENDO
 CLOSFILE &DESTLIST
 IF &I > 0 THEN +
   DO
   SET LSENDTO = &LENGTH(&STR(&SENDTO)) - 1
   SET SENDTO = &SUBSTR(1:&LSENDTO,&STR(&SENDTO))
   SET MSG = &&MSG
   SET MAXCC = 0
   OPENFILE &MESSAGE INPUT
   GETFILE &MESSAGE
   DO J = 1 TO 99 WHILE &MAXCC = 0
     SET MSG&J = &SUBSTR(1:71,&MSGREC)
     SET K0 = 1
     DO I = 1 TO 99 WHILE &K&EVAL(&I-1) > 0
       SET K&I = &SYSINDEX(&STR('),&STR(&MSG&J),&K&EVAL(&I-1))
       IF &K&I > 0 THEN SET K&I = &K&I + 1
       ENDO
     DO L = &I-2 TO 1 BY -1 WHILE &K&L > 0
       SET MSG&J = &SUBSTR(1:&K&L-1,&STR(&MSG&J))&STR(')+
                   &SUBSTR(&K&L:&LENGTH(&STR(&MSG&J)),&STR(&MSG&J))
       ENDO
     GETFILE &MESSAGE
     ENDO
   SET J = &J - 1
   DO I = 1 TO &J
     SEND '&MSG&I' +
     &TO(&STR(&SENDTO)) LOGON
     ENDO
   ENDO
 EXIT: +
 EXIT CODE(0)
 
Cheers, CP
 
Post by saurabh khandelwal
Hello Group,
In this below REXX, I want to send message only to operator AG54 but, not
sure why this send command sending message to all users in system , not
only AG54.
I checked syntax for this send command but result is same,
EDIT NETVIEW.CNMCLST(FAIREXX1) - 01.14
****** ***************************** Top of Data ********
000100 /* REXX */
000120 parse arg mtxt . mtxt
000240 say 'AG54LST Job STARTED at' mtxt
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
000600 exit
****** **************************** Bottom of Data ******
Can you please help.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-06-08 21:02:29 UTC
Reply
Permalink
Raw Message
Post by Elardus Engelbrecht
Post by Seymour J Metz
What is in mtxt? You display it with a say statement but didn't include the output in your query. Is it pssible that it include an apostrophe/
Excellent catch! Thanks! I forgot about that about apostrophe inside a variable inside that line. Really confusing and certainly would trip a parser into a black hole! ;-)
https://xkcd.com/327/
Post by Elardus Engelbrecht
Ok, it is a long time ago I had to handle a similar problem where lots of apostrophes are in a parsed line. It is a real PITA to handle such characters which could throw later parsing astray.
I applaud ISPF Edit for allowing, in some cases, a reference to a variable
rather than constructing a command line containing the value of that variable.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
CM Poncelet
2018-06-08 23:53:38 UTC
Reply
Permalink
Raw Message
Here is a Clist version, invoked from batch TSO (JCL):
 
'// ... <job card> ...                                                  '
'/*JOBPARM SYSAFF=(<LPAR>)                                              '
'//*                                                                    '
'//*********************************************************************'
'//* NOTE: NO LINE NUMBERS IN COLS 73-80 ALLOWED, ELSE CLIST FAILS!    *'
'//* ¯¯¯¯¯                                                             *'
'//*********************************************************************'
'//* NOTE: 'U' => TSO USERID(S); SPECIFY LIST OF USERIDS UNDER DESTIDS *'
'//* ¯¯¯¯¯ 'C' -> CONSOLE; SPECIFY MASTER ETC. UNDER CONSIDS           *'
'//*                                                                   *'
'//* 04/01/95 CMP                                                      *'
'//*********************************************************************'
'//*                                                                    '
'//*                                                                    '
'//CLIST   EXEC PGM=IKJEFT01,                                           '
'//             REGION=512K,                                            '
'//*           PARM='%TSOSEND DESTIDS SYSIN USERID'                     '
'//            PARM='%TSOSEND CONSIDS SYSIN CONSOLE'                    '
'//*                                                                    '
'//SYSPROC  DD  DISP=SHR,DSN=<Clist DSN>                                '
'//SYSTSIN  DD  DUMMY                                                   '
'//SYSTSPRT DD  SYSOUT=*                                                '
'//CONSIDS  DD  *                                                       '
'... <master console ID> ...                                            '
'//*                                                                    '
'//DESTIDS  DD  *                                                       '
'... <userid(s)> ...                                                    '
'//SYSIN    DD  *                                                       '
'... <multi-line message> ...                                           '
'... <... ditto etc etc.> ...                                           '
'                                                                       '
'/*                                                                     '
'//*                                                                    '
'//                                                                     '


MEMBER NAME  TSOSEND
PROC 2 DESTLIST MESSAGE DEBUG USERID CONSOLE
/*-------------------------------------------------------------------*/
/* N.B. DEFAULT IS 'NOW'                                             */
/* 'LOGON' -> 'NOW' IF LOGGED ON, ELSE AT LOGON TIME.                */
/* 'SAVE' -> ONLY AT NEXT LOGON TIME (OR LISTBC)                     */
/*                                                                   */
/* PARMS: DESTLIST DDNAME OF USERS/CONSOLES TO WHOM MESSAGE IS TO    */
/*                 BE SENT - DEFAULT=NONE                            */
/*        MESSAGE: DDNAME OF MESSAGE TEXT TO BE SENT - DEFAULT=NONE  */
/*        DEBUG:   SETS TRACE ON - DEFAULT=OFF                       */
/*                                                                   */
/* 13/12/94 CMP - ALLOW SENDING TO USERID(S) OR TO MVS CONSOLE(S)    */
/* 17/04/89 CMP                                                      */
/*-------------------------------------------------------------------*/
CONTROL: +
  CONTROL END(ENDO)
  IF &DEBUG = DEBUG | &DEBUG = D THEN +
    CONTROL LIST SYMLIST CONLIST MSG ASIS
  ELSE +
    CONTROL NOLIST NOSYMLIST NOCONLIST NOMSG ASIS
ERROR: +
ERROR DO
  SET CC = &LASTCC
  IF &CC = 400 THEN RETURN
  ELSE DO
  WRITE ERROR WITH CONDITION CODE = &CC OCCURRED : INTERRUPT AT LABEL +
        'ERROR'
  WRITE CLIST RUN ABANDONED
  GOTO EXIT
  ENDO
  ENDO

IF &USERID ¬= THEN SET TO = USER
ELSE IF &CONSOLE ¬= THEN SET TO = CN
ELSE +
WHERE: +
  DO
  WRITE YOU MUST SPECIFY PARAMETER 'USERID' OR 'CONSOLE'
  WRITE
  GOTO EXIT
  ENDO WHERE

SET SENDTO =
SET K = &&K
SET USREC  = &&&DESTLIST
SET MSGREC = &&&MESSAGE
SET MAXCC = 0
OPENFILE &DESTLIST INPUT
GETFILE &DESTLIST
DO I = 0 TO 99 WHILE &MAXCC = 0
  SET USER = &USREC
  SET J = &SYSINDEX(&STR( ),&USER,1)
  SET J = &J - 1
  SET USER = &SUBSTR(1:&J,&USER)
  SET SENDTO = &STR(&SENDTO&USER,)
  GETFILE &DESTLIST
  ENDO
CLOSFILE &DESTLIST
IF &I > 0 THEN +
  DO
  SET LSENDTO = &LENGTH(&STR(&SENDTO)) - 1
  SET SENDTO = &SUBSTR(1:&LSENDTO,&STR(&SENDTO))
  SET MSG = &&MSG
  SET MAXCC = 0
  OPENFILE &MESSAGE INPUT
  GETFILE &MESSAGE
  DO J = 1 TO 99 WHILE &MAXCC = 0
    SET MSG&J = &SUBSTR(1:71,&MSGREC)
    SET K0 = 1
    DO I = 1 TO 99 WHILE &K&EVAL(&I-1) > 0
      SET K&I = &SYSINDEX(&STR('),&STR(&MSG&J),&K&EVAL(&I-1))
      IF &K&I > 0 THEN SET K&I = &K&I + 1
      ENDO
    DO L = &I-2 TO 1 BY -1 WHILE &K&L > 0
      SET MSG&J = &SUBSTR(1:&K&L-1,&STR(&MSG&J))&STR(')+
                  &SUBSTR(&K&L:&LENGTH(&STR(&MSG&J)),&STR(&MSG&J))
      ENDO
    GETFILE &MESSAGE
    ENDO
  SET J = &J - 1
  DO I = 1 TO &J
    SEND '&MSG&I' +
    &TO(&STR(&SENDTO)) LOGON
    ENDO
  ENDO
EXIT: +
  EXIT CODE(0)
Post by saurabh khandelwal
Hello Group,
In this below REXX, I want to send message only to operator AG54 but, not
sure why this send command sending message to all users in system , not
only AG54.
I checked syntax for this send command but result is same,
EDIT NETVIEW.CNMCLST(FAIREXX1) - 01.14
****** ***************************** Top of Data ********
000100 /* REXX */
000120 parse arg mtxt . mtxt
000240 say 'AG54LST Job STARTED at' mtxt
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
000600 exit
****** **************************** Bottom of Data ******
Can you please help.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Eric Jackson
2018-06-09 03:26:00 UTC
Reply
Permalink
Raw Message
Is Netview Rexx executing a TSO command or and MVS system command here?
The system command SEND has a different syntax and operands than the TSO
SEND command; in particular, a blank outside quotes is the start of the
COMMENT field for an MVS operator command.
Post by saurabh khandelwal
Post by saurabh khandelwal
Hello Group,
In this below REXX, I want to send message only to operator AG54 but, not
sure why this send command sending message to all users in system , not
only AG54.
I checked syntax for this send command but result is same,
EDIT NETVIEW.CNMCLST(FAIREXX1) - 01.14
****** ***************************** Top of Data ********
000100 /* REXX */
000120 parse arg mtxt . mtxt
000240 say 'AG54LST Job STARTED at' mtxt
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
000600 exit
****** **************************** Bottom of Data ******
Can you please help.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
Bill Godfrey
2018-06-09 13:39:09 UTC
Reply
Permalink
Raw Message
According to the Knowledge Center link that was given, user(AG54) should be user=(AG54).

Bill
Post by saurabh khandelwal
Hello,
Thanks for reply.
below command doesn't work. After changing
mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
to
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
I stopped getting any notification as i was getting on any system.
Is there any other syntax for this command .
here mtxt is notthing but a tapped message from syslog , we tried to
capture using netview and we should like to display it to particular tso
user when even triger.
but instead , it was displaying it to all users. I am unable to find
correct way to isolate this issue.
Post by Elardus Engelbrecht
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message command
will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
Look up SEND for specific message receivers in
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/
com.ibm.zos.v2r2.ieag100/s1mess1.htm
Disclaimer - I am not a NETVIEW expert anymore...
So, you, not me, need to double check all those ' and " are properly
balanced.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-06-09 17:24:52 UTC
Reply
Permalink
Raw Message
tso and console send commad syntax is different.

ITschak
Post by Bill Godfrey
According to the Knowledge Center link that was given, user(AG54) should be user=(AG54).
Bill
Post by saurabh khandelwal
Hello,
Thanks for reply.
below command doesn't work. After changing
mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
to
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
I stopped getting any notification as i was getting on any system.
Is there any other syntax for this command .
here mtxt is notthing but a tapped message from syslog , we tried to
capture using netview and we should like to display it to particular tso
user when even triger.
but instead , it was displaying it to all users. I am unable to find
correct way to isolate this issue.
Post by Elardus Engelbrecht
Post by saurabh khandelwal
000120 parse arg mtxt . mtxt
How long is that mtxt? If it is too long, the rest of the message
command
Post by saurabh khandelwal
Post by Elardus Engelbrecht
will be trimmed off.
Post by saurabh khandelwal
000500 mvs "send 'AG54LST JOB "mtxt"' user(AG54) now"
mvs "send 'AG54LST JOB "mtxt"',user(AG54),now"
Look up SEND for specific message receivers in
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/
com.ibm.zos.v2r2.ieag100/s1mess1.htm
Disclaimer - I am not a NETVIEW expert anymore...
So, you, not me, need to double check all those ' and " are properly
balanced.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
saurabh khandelwal
2018-06-10 19:22:27 UTC
Reply
Permalink
Raw Message
changing user=(AG54) from user(AG54) finally worked for me and now this
command performing correctly.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...