Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REXX DB2 issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Thu Jul 02, 2009 4:52 pm    Post subject: REXX DB2 issue
Reply with quote

Hello!
I am executing the below code to fetch the TSNAME for a table from database . My requirement is to display TSNAME on panel after user enters SSID and table name in the panel.
The issue is that the TSNAME is always blank on panel. I am not sure whether the problem is with DB2 query or my REXX program / panel. When I am executing the query in QMF it is fetching the result correctly. Please help me with this.

The code is as shoen below.

/*REXX*/
/*TRACE I */


" ISPEXEC LIBDEF ISPPLIB DATASET ID("USER.REXX.UTILS")" ;
IF RC \= 0 THEN
CALL RTNTHROWERRORMESSAGE 1, RC;

"ISPEXEC DISPLAY PANEL (PNLTSNME)";

/* GET THE INPUTS FROM THE USER */
"ISPEXEC VGET (SSID, TBNAME) PROFILE";
TBL_NAME = "'" || TBNAME || "'"

ADDRESS TSO "SUBCOM DSNREXX"

S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
IF S_RC <> 0 THEN
SAY 'PROBLEM LOADING DB2 ENVIRONMENT'
ELSE
ADDRESS DSNREXX
"CONNECT" SSID
IF RC = 0 THEN DO
SQLSTMT = "SELECT TSNAME FROM SYSIBM.SYSTABLES
WHERE TSNAME <> 'SYSDBAUT' AND
NAME =" TBL_NAME

ADDRESS DSNREXX "EXECSQL PREPARE S1 INTO :SQLDA FROM :SQLSTMT"
ADDRESS DSNREXX "EXECSQL DECLARE C1 CURSOR FOR S1"
ADDRESS DSNREXX "EXECSQL OPEN C1"

IF RC = 0 THEN DO UNTIL (SQLCODE <> 0)
ADDRESS DSNREXX "EXECSQL FETCH C1 USING DESCRIPTOR :SQLDA"
SAY SQLCODE
IF SQLCODE = 0 THEN
ADDRESS DSNREXX "EXECSQL FETCH C1 INTO :PTSNAME"
END
END
ADDRESS DSNREXX "EXECSQL CLOSE C4"
ADDRESS DSNREXX "DISCONNECT"
S_RC = RXSUBCOM('DELETE','DSNREXX','DSNREXX')

/* TO DISPLAY THE PANEL */
ADDRESS TSO "ISPEXEC DISPLAY PANEL (PNLTSNME)";

ADDRESS TSO "ISPEXEC VPUT (SSID, TBNAME, PTSNAME) PROFILE";

RETURN;
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Thu Jul 02, 2009 4:59 pm    Post subject:
Reply with quote

why display the panel and then populate the variables?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Thu Jul 02, 2009 5:15 pm    Post subject:
Reply with quote

And do the panel variables match the REXX variables ?
Back to top
View user's profile Send private message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Fri Jul 03, 2009 2:57 pm    Post subject: Reply to: REXX DB2 issue
Reply with quote

ooppss...stupid me!!
I was displaying the panel before populating the values.
It's working fine now.
Thanks Dick!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us