Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
Enrico, I agree with you about the LIBDEF, but so far the TS has not tried the correct syntax for RXSUBCOM. In a couple of cases he supplied too many parameters (which generated the "Incorrect call..." message) and in the others the quotes were incorrect.
I don't know if fixing the quotes will correct the problem, but it is the next logical thing to try.
BTW I'd like to compliment the TS for attempting to solve the problem on his own, and showing us what he tried. A refreshing change.
Don.leahy,
i tried the same code but did not work.
Code:
s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
TRACE
Code:
12 *-* s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
>L> "ADD"
>L> "DSNREXX"
>L> "DSNREXX"
IRX0250E System abend code 806, reason code 00000004.
IRX0253E Abend in external function RXSUBCOM.
12 +++ s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
IRX0040I Error running DESC1, line 12: Incorrect call to routine
Akatsukami,
Yes, i borrowed this code but from REDBOOK, not from forum.
I used s_rc for RXSUBCOM but SAYing RC for SUBCOM & CONNECT.
Please suggest what needs to be fixed.
Enrico,
you are correct, i have seen this.
After ADDRESS ISPEXEC "LIBDEF ISPLLIB, i can see
Code:
DDname Data Set Name Actio
ISP00383 SYS1.DSND00A.SDSNLOAD
SYS1.DSNVFST.SDSNEXIT
and
SYS1.DSND00A.SDSNLOAD
=>
Name Prompt Lib Alias-of
RXSUBCOM 1 DSNREXX
I would like to try everything rather than hearing a big No from them.
Let me try with Support people.
Actuallly i spoke to support group but seems the person is not able to answer. I am waiting for another team who may like to answer me.
So instead of waiting i was trying from my side... :-)
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
devmisra wrote:
Akatsukami,
Yes, i borrowed this code but from REDBOOK, not from forum.
As, presumably, did the previous querents...none of whom actually understood what they were doing.
Quote:
I used s_rc for RXSUBCOM but SAYing RC for SUBCOM & CONNECT.
Please suggest what needs to be fixed.
Very well. I don’t have the time that I ordinarily would this morning, but we will see how far we can get.
Code:
ADDRESS TSO "SUBCOM DSNREXX"
I said before that this was a worthless thing to do. I still do. Why do I say that?
TSO maintains an environment table; Rexx is not the only user of this table, although it is probably the best and most widely known. Each row in the table has three columns: name, routine, and token. name is the name of the environment, and can be anything that would be valid as a PDS member name. routine is the name of the load module that handles commands sent to the name environment; it must be in the LPA or the linklist, but need not be the same as name. token is a 16-byte field that is passed to routine on every invocation.
What does “SUBCOM name” do? It checks for the existence of a name row in the environment table…but does not validate that row! It is possible (in principle; I definitely recommend that you not try this) to add a row to the table, delete the routine, invoke SUBCOM against the name, and still get RC=0 from SUBCOM.
If you are genuinely concerned over the possibility of a bogus row for your environment in the table, I suggest that you code something like this:
Code:
“SUBCOM FOO”
if (rc=0) then /* There is a row named FOO */
rc = RXSUBCOM(“DELETE”,”FOO”,”FOOHNDLR”) /* Get rid of it */
rc = RXSUBCOM(“ADD”,”FOO”,”FOOHNDLR”)
if (rc¬=0) then do /* The call to RXSUBCOM failed */
/* Error handling here */
end
And I see that I’m out of time for now. I’ll get back to the other problems with this code later.
I have worked on REXX and DB2 a BIT.. and have the below code to offer:
Code:
/* REXX */
/*FIXED LIST SELECT WITH PARAMETER MARKERS*/
EMP_ID="'051029'"
ADDRESS TSO
'SUBCOM DSNREXX'
IF RC = 1 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
END
ADDRESS DSNREXX
"CONNECT DB2R"
QRY="SELECT FIRST_NAME,MIDDLE_NAME,LAST_NAME" ,
"FROM IBMGRP.EMP" ,
"WHERE EMP_ID = CAST ( ? AS CHAR(6) )"
'EXECSQL DECLARE C1 CURSOR FOR S1'
IF SQLCODE /= 0 THEN CALL SQLCA
'EXECSQL PREPARE S1 FROM :QRY'
IF SQLCODE /= 0 THEN CALL SQLCA
"EXECSQL OPEN C1 USING :EMP_ID"
IF SQLCODE /= 0 THEN CALL SQLCA
DO UNTIL(SQLCODE /= 0)
"EXECSQL FETCH C1 INTO :FIRST_NAME, :MIDDLE_NAME :MIND, :LAST_NAME"
IF SQLCODE /= 0 THEN
CALL SQLCA
ELSE
DO
SAY 'FIRST NAME: ' FIRST_NAME
IF MIND == 0 THEN
SAY 'MIDDLE NAME: ' MIDDLE_NAME
ELSE
SAY 'NULL VALUE RECEIVED'
SAY 'LAST NAME: ' LAST_NAME
SAY
END
END
"EXECSQL CLOSE C1"
IF SQLCODE /= 0 THEN CALL SQLCA
"DISCONNECT"
IF SQLCODE /= 0 THEN CALL SQLCA
S_RC = RXSUBCOM('DELETE','DSNREXX','DSNREXX')
SQLCA:
SAY "SQLCODE = " SQLCODE
SAY "SQLERRMC = " SQLERRMC
SAY "SQLERRP = " SQLERRP
SAY "SQLERRD.1= " SQLERRD.1
SAY "SQLERRD.2= " SQLERRD.2
SAY "SQLERRD.3= " SQLERRD.3
SAY "SQLERRD.4= " SQLERRD.4
SAY "SQLERRD.5= " SQLERRD.5
SAY "SQLERRD.6= " SQLERRD.6
SAY "SQLWARN.0= " SQLWARN.0
SAY "SQLWARN.1= " SQLWARN.1
SAY "SQLWARN.2= " SQLWARN.2
SAY "SQLWARN.3= " SQLWARN.3
SAY "SQLWARN.4= " SQLWARN.4
SAY "SQLWARN.5= " SQLWARN.5
SAY "SQLWARN.6= " SQLWARN.6
SAY "SQLWARN.7= " SQLWARN.7
SAY "SQLWARN.8= " SQLWARN.8
SAY "SQLWARN.9= " SQLWARN.9
SAY "SQLWARN.10= " SQLWARN.10
SAY "SQLSTATE = " SQLSTATE
EXIT
In REXX all SQL is DYNAMIC NO MATTER WHAT..
this one is the simpler form of select as such.. but if you need I have examples of all the 3 variations(NON-SELECT/FIXED-LIST SELECT/VARYING-LIST SELECT) w/o parameter markers (6 in all) and I can share
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
(Note that Yuvraj copied the first few lines of his code from the same source as did Dev Misra and the other querents, and therefore it has the same weaknesses.)
where you fail to add a row to the environment table named DSNREXX for the command processor DSNREXX (the two names need not be the same).
Mr. Leahy is correct that the proper syntax is:
Code:
s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
There's something more than RXSUBCOM/DSNREXX not being in STEPLIB, the LPA, or the linklist; not finding it ought not to give you a S806-04 abend in TSO. I would check the RXSUBCOM alias directory entry's attributes against those of the DSNREXX directory entry's, and also ensure that RXSUBCOM doesn't appear twice in the library list.
When you've gotten that problem resolved, note that this still won't ensure a return code of zero from RXSUBCOM; you must check it. And, everyone who copies that code snippet from the manual (DB2 UDB V8, I think) seems incapable of understanding that the return code from RXSUBCOM is in variable s_rc, notrc. So I don't really give a reservoir if you display rc a lakh of times at this point; show me s_rc and we'll talk.
(rc ought to be considered, of course, when it is meaningful; e.g., after your ADDRESS statement. But that's another post.)
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
devmisra wrote:
Thanks a lot all..
Don.leahy,
i tried the same code but did not work.
Code:
s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
TRACE
Code:
12 *-* s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
>L> "ADD"
>L> "DSNREXX"
>L> "DSNREXX"
IRX0250E System abend code 806, reason code 00000004.
IRX0253E Abend in external function RXSUBCOM.
12 +++ s_rc=RXSUBCOM('ADD','DSNREXX','DSNREXX')
IRX0040I Error running DESC1, line 12: Incorrect call to routine
In our shop RXSUBCOM (alias of DSNREXX) is loaded from the ISPLLIB. (I know this because I FREE'd my ISPLLIB and received S806 when I tried to run RXSUBCOM). Do you see RXSUBCOM in your ISPLLIB?
Is anyone else using DSNREXX in your shop? Not every shop has bothered to activate it.
Akatsukami,
Thank you so much for this explanation. crystal clear ..
here s_rc is behaving like a variable, Below is a trace output
Code:
18 *-* s_rc="RXSUBCOM('ADD','DSNREXX','DSNREXX')"
19 *-* say s_rc
RXSUBCOM('ADD','DSNREXX','DSNREXX')
don.leahy,
I checked the ISPLLIB(from ISRDDN) but did not find RXSUBCOM. but found in VFST.DB2.SDSNLOAD and this library used in STEPLIB in VFSTMSTR. i.e VFST.DB2.SDSNLOAD is not activated as ISPLLIB.
Enrico,
Please be cool... .. I contacted the support people but they were not able to answer.
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
dbzTHEdinosauer wrote:
Akatsukami,
your subtlety is inspiring as well as educational.
much better than being confrontational.
I try...sometimes; my bad leg is giving me very little trouble at the moment, so I'm in a much better mood than if I were experiencing pain at every step.
Dev Misra, your first problem (and there could be many other problems concealed by this one) is obvious. Your code and trace snippet make it clear that in the line
Code:
s_rc="RXSUBCOM('ADD','DSNREXX','DSNREXX')"
you have defined a string (enclosed in double quotes), which you then assign to s_rc. As Don Leahy suggested Thursday, drop the double quotes.
devmisra wrote:
Enrico,
Please be cool... .. I contacted the support people but they were not able to answer.
Probably and unfortunately true; the querents on these and similar fora show that the rot is spreading upwards, with unskilled, inexperienced, and incapable people being given the roles of system programmer, DBA, etc.
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
OK, that indicates that RXSUBCOM is not in an allocated load library.
I'm a bit uncertain how to proceed here. It would be easy enough to invoke RXSUBCOM, but as you've been told, RXSUBCOM is an alias for DSNREXX, the IBM Rexx/DB2 interface, and there's no way to specify to TSO that it should use a command processor not in STEPLIB/LPA/linklist. I can see a couple of possibilities, but I'll need to do some experimentation when I get into my office, which won't be for a couple of hours yet.
Thank you Akatsukami..
I also was trying TSOLIB ACTIVATE but its also throwing an error
Code:
IDY00046I TSOLIB terminated. A valid TSOLIB environment does not exist.+
IDY00046I The TSOLIB command with the ACTIVATE, DEACTIVATE or RESET operands mu
st be invoked from the TSO/E READY environment.
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
The TSO READY environment (aka the "READY prompt") is what you see when you exit ISPF in order to issue the LOGOFF command. That is where the TSOLIB command needs to be issued.
I mentioned earlier that I pick up RXSUBCOM from ISPLLIB. What I failed to mention is that my ISPLLIB allocation is set up by my logon proc before the ISPF environment is initiated. LIBDEF can be used to add libraries to ISPLLIB, but not every software product can see them.
If you have access to your logon procedure, then ISPLLIB would probably be the easier way to go. If not, then try TSOLIB from the READY prompt.