rc 4 in GETMSG

IBM's Command List programming language & Restructured Extended Executor

rc 4 in GETMSG

Postby v1gnesh » Fri Aug 10, 2012 3:37 pm

Hi,

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

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



Code: Select all
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!
v1gnesh
v1gnesh
 
Posts: 72
Joined: Wed Sep 28, 2011 8:24 pm

Re: rc 4 in GETMSG

Postby Pedro » Fri Aug 10, 2012 7:43 pm

The manual describes three reasons for getting return code 4. Do any of them apply?
Pedro Vera
User avatar
Pedro
 
Posts: 443
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley

Re: rc 4 in GETMSG

Postby Pedro » Fri Aug 10, 2012 9:36 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 443
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley

Re: rc 4 in GETMSG

Postby v1gnesh » Fri Aug 10, 2012 11:29 pm

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
v1gnesh
v1gnesh
 
Posts: 72
Joined: Wed Sep 28, 2011 8:24 pm

Re: rc 4 in GETMSG

Postby Pedro » Sat Aug 11, 2012 2:06 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 443
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley

Re: rc 4 in GETMSG

Postby v1gnesh » Sat Aug 11, 2012 7:59 am

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.

Code: Select all
Return code = 0
Return code = 0
Return code = 0
0
GETMSG ended with 4


Thank you. I appreciate your help.
v1gnesh
v1gnesh
 
Posts: 72
Joined: Wed Sep 28, 2011 8:24 pm

Re: rc 4 in GETMSG

Postby dick scherrer » Sat Aug 11, 2012 10:04 am

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?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6324
Joined: Sat Jun 09, 2007 8:58 am

Re: rc 4 in GETMSG

Postby v1gnesh » Sat Aug 11, 2012 10:28 am

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
v1gnesh
v1gnesh
 
Posts: 72
Joined: Wed Sep 28, 2011 8:24 pm

Re: rc 4 in GETMSG

Postby v1gnesh » Sat Aug 11, 2012 8:02 pm

Temporarily avoided this problem by using the @SYSCMD example from SDSF in REXX Redbook.

v1gnesh
v1gnesh
v1gnesh
 
Posts: 72
Joined: Wed Sep 28, 2011 8:24 pm

Re: rc 4 in GETMSG

Postby dick scherrer » Sun Aug 12, 2012 3:50 am

Hello,

Code: Select all
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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6324
Joined: Sat Jun 09, 2007 8:58 am

Next

Return to CLIST & REXX