Page 1 of 3

RC 4 in GETMSG create CONSOLE

PostPosted: Fri Aug 10, 2012 3:37 pm
by v1gnesh
Hi,

Here's the job I'm using to run a REXX to create a CONSOLE and obtain the message response in an array.

//STEP010  EXEC PGM=IKJEFT01,PARM='%ULOGREX'
//SYSEXEC  DD DISP=SHR,DSN=TECH.ZMSSAV.PROCLIB
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN  DD DUMMY



Address TSO
"CONSPROF SOLDISP(YES) UNSOLDISPLAY(YES) SOLNUM(400)"
"CONSOLE ACTIVATE,NAME(DIS1)"
/* "CONSOLE SYSCMD(#SQ VOL,9000,INV_TRKS) CART('MAINT')" */
"CONSOLE SYSCMD(D R,R) CART('maint')"
SAY "Return code = "RC
getcode = GETMSG('msg.','either','maint',,10)
SAY "GETMSG ended with "getcode
"CONSOLE DEACTIVATE"


Please help me fix this.

Thanks!

Re: rc 4 in GETMSG

PostPosted: Fri Aug 10, 2012 7:43 pm
by Pedro
The manual describes three reasons for getting return code 4. Do any of them apply?

Re: rc 4 in GETMSG

PostPosted: Fri Aug 10, 2012 9:36 pm
by Pedro
You should display the return code of each command issued (CONSPROF, CONSOLE, CONSOLE).

Most people do not have authority to issue operator commands through the CONSOLE command. Check your job output and the syslog to see if you are generating any messages.

Re: rc 4 in GETMSG

PostPosted: Fri Aug 10, 2012 11:29 pm
by v1gnesh
Could this be?
http://www-01.ibm.com/support/docview.w ... sg1OA27497

I'll provide the return codes when I login to the system again..

Thanks

Re: rc 4 in GETMSG

PostPosted: Sat Aug 11, 2012 2:06 am
by Pedro
The APAR you cite was closed in 2009. Surely it is on your system already.

Did it ever work for you, or is this your first time trying this? I am more inclined to believe a setup problem rather than a system problem.

Re: rc 4 in GETMSG

PostPosted: Sat Aug 11, 2012 7:59 am
by v1gnesh
If I remember correctly, this is the first time I'm trying this.

-No messages were available to be retrieved.
D R,R should be having a reply

-The messages did not match the search criteria you specified on the function call.
Please help me understand what this is..

-You specified the time argument and the time limit expired before the message was available.
I've specified '10'. I think thats time enough.

And here's the output of a 'SAY rc' after CONSPROF, CONSOLE, CONSOLE.

Return code = 0
Return code = 0
Return code = 0
0
GETMSG ended with 4


Thank you. I appreciate your help.

Re: rc 4 in GETMSG

PostPosted: Sat Aug 11, 2012 10:04 am
by dick scherrer
Hello,

From an IBM manual:
You issued an MVS command using a CART value of 'C1D7D7D3F2F9F6F8'X. You want to retrieve the message that was issued in response to the command and place the message in variables starting with the stem "DMSG". You want GETMSG to wait up to 1 minute (60 seconds) for the message. Specify GETMSG as follows.

msgrett = getmsg('dmsg','sol','C1D7D7D3F2F9F6F8'X,,60)


From your code:
getcode = GETMSG('msg.','either','maint',,10)


The sample in the manual shows the stem with no period. The code Has the period. Could this make a difference?

Is the posted code only a bit of the whole?

Re: rc 4 in GETMSG

PostPosted: Sat Aug 11, 2012 10:28 am
by v1gnesh
Did a quick lookup -
http://publib.boulder.ibm.com/infocente ... getmsg.htm

msgstem

the stem of the list of variables into which GETMSG places the message text. To place the message text into compound variables, which allow for indexing, msgstem should end with a period (for example, "messg."). GETMSG places each line of the retrieved message into successive variables. For example, if GETMSG retrieves a message that has three lines of text, GETMSG places each line of message text into the variables messg.1, messg.2, messg.3. GETMSG stores the number of lines of message text in the variable ending in 0, messg.0.

Note:
If messg.0=0, no lines are associated with this message. This message might be a delete operator message (DOM) request. For more information about the DOM macro, see z/OS MVS Programming: Authorized Assembler Services Reference ALE-DYN.
If msgstem does not end with a period, the variable names are appended with consecutive numbers. For example, suppose you specify msgstem as "conmsg" (without a period). If GETMSG retrieves a message that has two lines of message text, GETMSG places the text into the variables conmsg1 and conmsg2. The variable conmsg0 contains the number of lines of message text, which is 2.

In addition to the variables into which GETMSG places the retrieved message text, GETMSG also sets additional variables. The additional variables relate to the field names in the message data block (MDB) for MVS/ESA™ System Product. For more information about these variables, see Additional variables that GETMSG sets.


This is the code in its entirety. I tried with 'msg' and I still got the same rc.

v1gnesh

Re: rc 4 in GETMSG

PostPosted: Sat Aug 11, 2012 8:02 pm
by v1gnesh
Temporarily avoided this problem by using the @SYSCMD example from SDSF in REXX Redbook.

v1gnesh

Re: rc 4 in GETMSG

PostPosted: Sun Aug 12, 2012 3:50 am
by dick scherrer
Hello,

Address TSO
"CONSPROF SOLDISP(YES) UNSOLDISPLAY(YES) SOLNUM(400)"
"CONSOLE ACTIVATE,NAME(DIS1)"
/* "CONSOLE SYSCMD(#SQ VOL,9000,INV_TRKS) CART('MAINT')" */
"CONSOLE SYSCMD(D R,R) CART('maint')"
SAY "Return code = "RC
getcode = GETMSG('msg.','either','maint',,10)
SAY "GETMSG ended with "getcode
"CONSOLE DEACTIVATE"


Every REXX module i've ever seen begins with
/* REXX */ (or very similar).

Which is why i asked if this was the complete code.