Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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: 8593
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us