Page 2 of 3

RC=4 in GETMSG

PostPosted: Sun Aug 12, 2012 7:26 am
by v1gnesh
Hi,

That is present. :)

Re: rc 4 in GETMSG

PostPosted: Sun Aug 12, 2012 7:32 am
by dick scherrer
Hello,

What else might not have been posted . . .

Re: rc 4 in GETMSG

PostPosted: Sun Aug 12, 2012 10:40 am
by Pedro
This works for me... (extracted from larger exec):
Address TSO             
"CONSPROF SOLDISPLAY(NO)"
"CONSOLE ACTIVATE NAME(TSTCHANG)" 
Address CONSOLE   
"CART TSTCHADD"             
"d u,dasd,online,000,9999"   
xx = getmsg('TSTCHADD.','sol','TSTCHADD',,59)
vollist = ''                                 
do z1 = 3 to TSTCHADD.0                     
  parse var TSTCHADD.z1 . . . vol .         
  vollist = vollist vol                     
End

Re: rc 4 in GETMSG

PostPosted: Sun Aug 12, 2012 12:10 pm
by v1gnesh
dick scherrer wrote:Hello,

What else might not have been posted . . .


This is the whole package.
I'll try Pedro's suggestion and report back.

EDIT: Thank you, Pedro. This works for me. I would still like to find out what was wrong with the one I coded..

v1gnesh

Re: rc 4 in GETMSG

PostPosted: Sun Aug 12, 2012 1:06 pm
by v1gnesh
I'm trying to do this so that I can issue commands to EMC's started task(EMCRDF) and read its output. The command I'll be using finally is there as a comment in the code I had pasted in the first post. The task takes a few seconds to send a return the result and hence I need a wait time of about 10-20 seconds.

Pedro's code works, but when I change SOLDISPLAY to YES, I end up getting the rc 4.

Re: rc 4 in GETMSG

PostPosted: Mon Aug 13, 2012 9:39 pm
by Pedro
I would still like to find out what was wrong with the one I coded..

I am not sure how you missed it when you read the manual.

From TSO/E System Programming Command Reference, SA22-7793-04, referring to CONSPROF:
SOLDISPLAY(YES | NO)
...
NO ... If NO is specified, solicited messages are stored ... where you can retrieve them using GETMSG.


It is not explicitly stated, but probably specifying SOLDISPLAY(YES) prevent the GETMSG from working.

And from the Rexx Reference:
To use GETMSG, you must:
* Have solicited or unsolicited messages stored rather than displayed at
the terminal during a console session. ...
You can also use the TSO/E CONSPROF command to specify that solicited
or unsolicited messages should not be displayed during a console
session.

Re: rc 4 in GETMSG

PostPosted: Tue Aug 14, 2012 9:07 am
by v1gnesh
OK.. my bad. Thanks again!
v1gnesh wrote:I'm trying to do this so that I can issue commands to EMC's started task(EMCRDF) and read its output. The command I'll be using finally is there as a comment in the code I had pasted in the first post. The task takes a few seconds to send a return the result and hence I need a wait time of about 10-20 seconds.
I'm unable to obtain the responses in the array even after quoting a delay.

Re: rc 4 in GETMSG

PostPosted: Tue Aug 14, 2012 10:55 am
by NicC
Did you have SOLDISPLAY(NO) specified?

Re: rc 4 in GETMSG

PostPosted: Tue Aug 14, 2012 4:00 pm
by v1gnesh
NicC wrote:Did you have SOLDISPLAY(NO) specified?


Yep.

Re: rc 4 in GETMSG

PostPosted: Tue Aug 14, 2012 4:53 pm
by enrico-sorichetti
my working snippet ...
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /*                                                                   */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005 Parse Source _sys _how _cmd .
000006 args = "d grs,enq,contention"
000007 cart = "OPER0001"
000008 _msg = msg("OFF")
000009 zrc = $tsoex("CONSOLE DEACTIVATE ")
000010 zrc = $tsoex("CONSPROF SOLDISP(NO) SOLNUM(9999)" )
000011 zrc = $tsoex("CONSOLE ACTIVATE")
000012 if zrc = 0 then do
000013    zrc = $tsoex("CONSOLE SYSCMD("args") CART("cart") ")
000014    if zrc = 0 then do
000015       zrc = getmsg("consrepl.",,cart,,120)
000016    end
000017    zrc = $tsoex("CONSOLE DEACTIVATE ")
000018 end
000019 do i = 1 to consrepl.0
000020    say i consrepl.i
000021 end
000022 _msg = msg(_msg)
000023 exit
000024
000025 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000026 $tsoex:
000027    tso_0tr = trace("O")
000028    Address TSO arg(1)
000029    tso_0rc = rc
000030    trace value(tso_0tr)
000031    return tso_0rc
000032
000033 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000034 $ispex:
000035    isp_tr = trace("O")
000036    Address ISPEXEC arg(1)
000037    isp_rc = rc
000038    trace value(isp_tr)
000039    return isp_rc
000040 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000041 $isred:
000042    isr_tr = trace("O")
000043    Address ISREDIT arg(1)
000044    isr_rc = rc
000045    trace value(isr_tr)
000046    return isr_rc
000047
****** **************************** Bottom of Data ****************************