View previous topic :: View next topic
|
Author |
Message |
sampath786
New User
Joined: 03 Oct 2011 Posts: 6 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
sampath786
New User
Joined: 03 Oct 2011 Posts: 6 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why are You confused 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 |
|
|
sampath786
New User
Joined: 03 Oct 2011 Posts: 6 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
sampath786
New User
Joined: 03 Oct 2011 Posts: 6 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
please provide me any same code for my requriment. |
hell will freeze before somebody will do Your work
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 |
|
|
|