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
 

 

Dynamic panel using table

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

New User


Joined: 03 Oct 2011
Posts: 6
Location: India

PostPosted: Mon Oct 03, 2011 2:52 pm    Post subject: Dynamic panel using table
Reply with quote

My intention is to display multiple row on to the panel. Using REXX i am able to find whether the table exists in DB2 or not. Now the challenge is to display the the multiple rows on to panel.

I had checked in few forums how to display multiple row on to the panel. They suggested to use status syntax i.e

Address ISPEXEC "TBSTATS" tblname "STATUS1("sta1") STATUS2("sta2")"

but my output status for the table is is 2 and 1!

before executing the ISPEXEC do we need to connect to the DB2 ?? or do we need add any piece of code ??
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1716
Location: UK

PostPosted: Mon Oct 03, 2011 3:00 pm    Post subject:
Reply with quote

Well, yes, of course you need to connect to DB2 if you are wanting to use DB2 data. DB2 tables are NOT the same thing as ISPF tables. They are totally unrelated. See the SQL user guide for the section on using rexx to communicate with DB2 and various posts here regarding the same although the user guide is quite sufficient if followed properly.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 03, 2011 3:15 pm    Post subject: Reply to: Dynamic panel using table
Reply with quote

all You might want to know on how to display a table and handle the relative line commands is explained very well here
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISRVPB01/CONTENTS?SHELF=&DT=19931028105440

old but still useful

and here for the full ispf knowledge
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM70
the same for TSO and REXX
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK90
Back to top
View user's profile Send private message
sampath786

New User


Joined: 03 Oct 2011
Posts: 6
Location: India

PostPosted: Mon Oct 03, 2011 5:18 pm    Post subject: Dynamic panel using table
Reply with quote

Hi Nic/Enrico,

Thank you very much ... till now i am confused with ISPF tables and DB2 table.

Now i am able to connect the DB2 successfully and also fetch each row in the table and number of row.

Now my challenge is to display all the rows on to the panel ? can you please help me out with this query !!!

thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 03, 2011 5:23 pm    Post subject: Reply to: Dynamic panel using table
Reply with quote

why are You confused icon_biggrin.gif they have nothing in common just the name

look at the first manual I pointed You to learn most of You' ll ever need about ispf tables


...
define an ispf table and remember the names of the ISPF-columns ==> REXX-variables

fill the rexx variables with the proper data , issue a tbadd
repeat for each row

when done issue a TBDISP

if You are querying a db2 table just fill the rexx variables for the ISPF tables
with the values You get from the DB2 query
Back to top
View user's profile Send private message
sampath786

New User


Joined: 03 Oct 2011
Posts: 6
Location: India

PostPosted: Tue Oct 04, 2011 12:15 pm    Post subject: Dynamic panel using table
Reply with quote

So in order to display the DB2 tables on to a REXX panel .... first we need to write the rows in to a ISPF table ( which is nothing but a member in a PDS) next we need to implement the logic to display this ISPF table on to the panel ??

is my understanding is correct ??
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 04, 2011 12:25 pm    Post subject: Reply to: Dynamic panel using table
Reply with quote

did You care to start reading the manuals I pointed You to ?
also terminology is important in IT ... there is no such a thing as REXX panels just ISPF ones

repeat on..
ISPF tables are not related to db2 tables,
the process of using them is as for any other entity ...
<define> a table
<display> a table (in this case You must create also an ISPF panel for it )
<add>/<delete>/<update> entries in a table

how you fill the variables is irrelevant for ispf table handling
the fact that the tables are stored as PDS members is irrelevant to the discussion

see here for an example
http://www.ibmmainframes.com/viewtopic.php?t=56254&highlight=ctbadd

furthermore ISPF tables is the format in which all the ISPF user related parameters are stored
equivalent places are
-- the registry for the wingarb opsys
-- various plists for mac osx
-- the .zzzzz stuff in the homedir for most of the linux distros

if You want to be able to analyze problems more effectively You must learn to decouple issues which are not related as in

Quote:
In software development, the term “decoupling” is used to identify the separation of software blocks that shouldn't depend on each other. Some building blocks are generic and shouldn't know details of others. Special design techniques allow software designers to have as few dependencies as possible. This typically reduces the risk of malfunction in one part of a system when the other part changed. It also forces the developer to focus on one thing at a time.
lazy cut and paste from wikipedia ( with the usual credits for fair use )
Back to top
View user's profile Send private message
sampath786

New User


Joined: 03 Oct 2011
Posts: 6
Location: India

PostPosted: Tue Oct 04, 2011 4:17 pm    Post subject: Dynamic panel using table
Reply with quote

Hi enrico,

I read the manual ... it is very helpfull for me ... and i created a panel aslo which takes table name nd creator successfully.

below is my spufi which i executed in REXX.
Code:

db2_sql_table_process:                                               
ssid = 'DBD3';                                                       
sqlstmt = "SELECT NAME, COLTYPE FROM SYSIBM.SYSCOLUMNS               
",                                                                   
"     WHERE ( TBNAME = '"tablename"' AND TBCREATOR = '"creator"') " 
'SUBCOM DSNREXX';     



where table name and creator name are taken from the panel
and below is my fetch statement for the above SPUFI

Code:

 /* Fetch cursor            */                                           
 'EXECSQL FETCH C1 INTO :NAME, : COLTYPE'                               
 If sqlcode = 100 then table_found = 'ko'                               
 Do While sqlcode = 0                                                   
    table_found = 'ok'                                                   
    i = i + 1                                                           
    /* Process data */                                                   
    oline1 = 'Column Name = 'NAME                                       
    oline2 = 'Column Type = 'COLTYPE                                     
    SAY NAME                                                             
    SAY COLTYPE                                                         
 'EXECSQL FETCH C1 INTO :NAME, :COLTYPE'                                 
 end   


here i hold 12 (total number of row for the SUPFI)...
where as on panle i had declared only 1 out put variable. Colname and type, but my output holds more that 1 column name and type....
below is the code of the panle

Code:

¬----- REXX TOOL TO DISPLAY MONTANT -----!DT         ¬|!TM       
       ¬Item Name   => *tabname          #>¬Creator => *cret           
       ¬-------------------------------------------------------!userid 
       ¬Sel Column Name           Type                                 
       +!S   !colname            !type                                 
       +                                                               
       +                                                               
       +                                                               
       +                                                               
   


So how to display my multiple rows that are fetched from DB2 table to the panle ?

please provide me any same code for my requriment.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 04, 2011 7:14 pm    Post subject: Reply to: Dynamic panel using table
Reply with quote

Quote:
please provide me any same code for my requriment.

hell will freeze before somebody will do Your work icon_biggrin.gif

reread carefully the manual in the first link I posted and You will see how to define a table an the relative panel to display it
the names of the fields in the panel must be the same names You used to define the table
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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm


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