IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamic panel using table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Mon Oct 03, 2011 3:00 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 3:15 pm
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
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
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM70
the same for TSO and REXX
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 03, 2011 5:23 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 04, 2011 12:25 pm
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 04, 2011 7:14 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top